diff --git a/pkg/compiler/lib/src/native/behavior.dart b/pkg/compiler/lib/src/native/behavior.dart index 5a03ca015c5..347dfcf82af 100644 --- a/pkg/compiler/lib/src/native/behavior.dart +++ b/pkg/compiler/lib/src/native/behavior.dart @@ -818,8 +818,9 @@ class NativeBehavior { // annotations. This means that to some degree we still use the return // type to decide whether to include native types, even if we don't // trust the type annotation. - typesInstantiated.add( - backend.helpers.jsJavaScriptObjectClass.thisType); + ClassElement cls = backend.helpers.jsJavaScriptObjectClass; + cls.ensureResolved(resolution); + typesInstantiated.add(cls.thisType); } else { // Otherwise, when the declared type is a Dart type, we do not // register an allocation because we assume it cannot be instantiated diff --git a/tests/html/js_dart_to_string_test.dart b/tests/html/js_dart_to_string_test.dart index 5293053332f..d2c23f4a2df 100644 --- a/tests/html/js_dart_to_string_test.dart +++ b/tests/html/js_dart_to_string_test.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. @JS() -library js_typed_interop_test; +library js_dart_to_string_test; import 'dart:html';