| Index: pkg/compiler/lib/src/compiler.dart
|
| diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
|
| index 5abb3e1dd0b086b48c4a4fa2e67d6a456db698ca..8cca351c2d7ca1b5d7cd14d3afb15aa690d30534 100644
|
| --- a/pkg/compiler/lib/src/compiler.dart
|
| +++ b/pkg/compiler/lib/src/compiler.dart
|
| @@ -437,22 +437,31 @@ abstract class Compiler implements LibraryLoaderListener {
|
| /// for [library].
|
| Future onLibraryScanned(LibraryElement library, LibraryLoader loader) {
|
| Uri uri = library.canonicalUri;
|
| - if (uri == Uris.dart_core) {
|
| - initializeCoreClasses();
|
| - identicalFunction = coreLibrary.find('identical');
|
| - } else if (uri == Uris.dart_mirrors) {
|
| - mirrorSystemClass = findRequiredElement(library, 'MirrorSystem');
|
| - mirrorsUsedClass = findRequiredElement(library, 'MirrorsUsed');
|
| - } else if (uri == Uris.dart_async) {
|
| - asyncLibrary = library;
|
| - deferredLibraryClass = findRequiredElement(library, 'DeferredLibrary');
|
| - _coreTypes.futureClass = findRequiredElement(library, 'Future');
|
| - _coreTypes.streamClass = findRequiredElement(library, 'Stream');
|
| - } else if (uri == Uris.dart__native_typed_data) {
|
| - typedDataClass = findRequiredElement(library, 'NativeTypedData');
|
| - } else if (uri == js_backend.BackendHelpers.DART_JS_HELPER) {
|
| - patchAnnotationClass = findRequiredElement(library, '_Patch');
|
| - nativeAnnotationClass = findRequiredElement(library, 'Native');
|
| + // If the script of the library is synthesized, the library does not exist
|
| + // and we do not try to load the helpers.
|
| + //
|
| + // This could for example happen if dart:async is disabled, then loading it
|
| + // should not try to find the given element.
|
| + // TODO(johnniwinther): This should just be library.isSynthesized, but that
|
| + // does not work yet for deserialized elements.
|
| + if (!library.compilationUnit.script.isSynthesized) {
|
| + if (uri == Uris.dart_core) {
|
| + initializeCoreClasses();
|
| + identicalFunction = coreLibrary.find('identical');
|
| + } else if (uri == Uris.dart_mirrors) {
|
| + mirrorSystemClass = findRequiredElement(library, 'MirrorSystem');
|
| + mirrorsUsedClass = findRequiredElement(library, 'MirrorsUsed');
|
| + } else if (uri == Uris.dart_async) {
|
| + asyncLibrary = library;
|
| + deferredLibraryClass = findRequiredElement(library, 'DeferredLibrary');
|
| + _coreTypes.futureClass = findRequiredElement(library, 'Future');
|
| + _coreTypes.streamClass = findRequiredElement(library, 'Stream');
|
| + } else if (uri == Uris.dart__native_typed_data) {
|
| + typedDataClass = findRequiredElement(library, 'NativeTypedData');
|
| + } else if (uri == js_backend.BackendHelpers.DART_JS_HELPER) {
|
| + patchAnnotationClass = findRequiredElement(library, '_Patch');
|
| + nativeAnnotationClass = findRequiredElement(library, 'Native');
|
| + }
|
| }
|
| return backend.onLibraryScanned(library, loader);
|
| }
|
|
|