diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart index 33804f656a4..a9f6407372b 100644 --- a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart +++ b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart @@ -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; } diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart index f33fa7c346f..b1885bdc0a6 100644 --- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart +++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart @@ -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; diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart index 0154824bf1b..6b58b6f4575 100644 --- a/sdk/lib/_internal/lib/js_mirrors.dart +++ b/sdk/lib/_internal/lib/js_mirrors.dart @@ -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); } diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status index 38b41b798d9..662d9a969d0 100644 --- a/tests/language/language_dart2js.status +++ b/tests/language/language_dart2js.status @@ -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 diff --git a/tests/language/null2_test.dart b/tests/language/null2_test.dart deleted file mode 100644 index 16d3a8308bf..00000000000 --- a/tests/language/null2_test.dart +++ /dev/null @@ -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()); -} diff --git a/tests/language/null_test.dart b/tests/language/null_test.dart index 83ffd7b3d1b..c499c502991 100644 --- a/tests/language/null_test.dart +++ b/tests/language/null_test.dart @@ -37,10 +37,7 @@ class Generic2 { // 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; } diff --git a/tests/lib/lib.status b/tests/lib/lib.status index 1f0403d4945..fa7539b5080 100644 --- a/tests/lib/lib.status +++ b/tests/lib/lib.status @@ -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 diff --git a/tests/lib/mirrors/null2_test.dart b/tests/lib/mirrors/null2_test.dart deleted file mode 100644 index 4c5590d398f..00000000000 --- a/tests/lib/mirrors/null2_test.dart +++ /dev/null @@ -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); - } -}