mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 23:41:50 +00:00
Revert "Fix null.runtimeType, reflect(null).type.superinterfaces, and reflect(null).getField."
This reverts commit r32650. Review URL: https://codereview.chromium.org//163513003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32652 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
6e0b2d61c4
commit
9cbc78cd36
|
@ -739,8 +739,6 @@ class Namer implements ClosureNamer {
|
|||
return 'String';
|
||||
} else if (cls == backend.jsArrayClass) {
|
||||
return 'List';
|
||||
} else if (cls == backend.jsNullClass) {
|
||||
return 'Null';
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -803,7 +803,7 @@ class ResolverTask extends CompilerTask {
|
|||
element.origin.ensureResolved(compiler);
|
||||
// Ensure that the type is computed.
|
||||
element.computeType(compiler);
|
||||
// Copy class hierarchy from origin.
|
||||
// Copy class hiearchy from origin.
|
||||
element.supertype = element.origin.supertype;
|
||||
element.interfaces = element.origin.interfaces;
|
||||
element.allSupertypesAndSelf = element.origin.allSupertypesAndSelf;
|
||||
|
|
|
@ -878,11 +878,10 @@ class JsInstanceMirror extends JsObjectMirror implements InstanceMirror {
|
|||
/// reflective information to know how to to invoke a specific member.
|
||||
get _classInvocationCache {
|
||||
String cacheName = Primitives.mirrorInvokeCacheName;
|
||||
var cacheHolder = (reflectee == null) ? getInterceptor(null) : reflectee;
|
||||
var cache = JS('', r'#.constructor[#]', cacheHolder, cacheName);
|
||||
var cache = JS('', r'#.constructor[#]', reflectee, cacheName);
|
||||
if (cache == null) {
|
||||
cache = JsCache.allocate();
|
||||
JS('void', r'#.constructor[#] = #', cacheHolder, cacheName, cache);
|
||||
JS('void', r'#.constructor[#] = #', reflectee, cacheName, cache);
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
@ -1071,7 +1070,7 @@ class JsInstanceMirror extends JsObjectMirror implements InstanceMirror {
|
|||
// interceptor between multiple different instances of [InstanceMirror].
|
||||
var interceptor = getInterceptor(object);
|
||||
if (!useEval) return _newInterceptGetterNoEvalFn(name, interceptor);
|
||||
String className = JS('String', '#.constructor.name', interceptor);
|
||||
String className = JS('String', '#.constructor.name', object);
|
||||
var body = "(function $className\$$name(o){return i.$name(o)})";
|
||||
return JS('', '(function(b,i){return eval(b)})(#,#)', body, interceptor);
|
||||
}
|
||||
|
|
|
@ -146,6 +146,8 @@ canonical_const2_test: RuntimeError, OK # Issue 1533
|
|||
bit_operations_test: RuntimeError, OK # Issue 1533
|
||||
expect_test: RuntimeError, OK # Issue 13080
|
||||
|
||||
null_test/none: RuntimeError # Issue 12482
|
||||
|
||||
[ ($compiler == dart2js || $compiler == dart2dart) && $checked ]
|
||||
cyclic_typedef_test/07: Crash # Issue 15237
|
||||
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
// Second dart test program.
|
||||
|
||||
import "package:expect/expect.dart";
|
||||
|
||||
// Magic incantation to avoid the compiler recognizing the constant values
|
||||
// at compile time. If the result is computed at compile time, the dynamic code
|
||||
// will not be tested.
|
||||
confuse(x) {
|
||||
try {
|
||||
if (new DateTime.now().millisecondsSinceEpoch == 42) x = 42;
|
||||
throw [x];
|
||||
} on dynamic catch (e) { return e[0]; }
|
||||
return 42;
|
||||
}
|
||||
|
||||
main() {
|
||||
Expect.equals("Null", null.runtimeType.toString());
|
||||
Expect.equals("Null", confuse(null).runtimeType.toString());
|
||||
}
|
|
@ -37,10 +37,7 @@ class Generic2<T, S> {
|
|||
// at compile time. If the result is computed at compile time, the dynamic code
|
||||
// will not be tested.
|
||||
confuse(x) {
|
||||
try {
|
||||
if (new DateTime.now().millisecondsSinceEpoch == 42) x = 42;
|
||||
throw [x];
|
||||
} on dynamic catch (e) { return e[0]; }
|
||||
try { throw [x]; } on dynamic catch (e) { return e[0]; }
|
||||
return 42;
|
||||
}
|
||||
|
||||
|
|
|
@ -78,6 +78,7 @@ mirrors/method_mirror_source_line_ending_test : RuntimeError # Issue 6490
|
|||
mirrors/mirrors_test: RuntimeError # TODO(ahe): I'm working on fixing this.
|
||||
mirrors/mixin_test: RuntimeError # Issue 12464
|
||||
mirrors/mixin_application_test/none: RuntimeError # Issue 12464
|
||||
mirrors/null_test : RuntimeError # Issue 12129
|
||||
mirrors/parameter_test/none: RuntimeError # Issue 6490
|
||||
mirrors/parameter_metadata_test: RuntimeError # Issue 10905
|
||||
mirrors/private_symbol_test: CompileTimeError # Issue 13597
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
library test.null_test;
|
||||
|
||||
import 'dart:mirrors';
|
||||
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
main() {
|
||||
InstanceMirror nullMirror = reflect(null);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
Expect.isTrue(nullMirror.getField(#hashCode).reflectee is int);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue