| Index: lib/compiler/implementation/dart_backend/backend.dart
|
| diff --git a/lib/compiler/implementation/dart_backend/backend.dart b/lib/compiler/implementation/dart_backend/backend.dart
|
| index b3795b1172c19f33ab328577384b12ef686896e3..ac03dfe86c7658f555d6a303d7397fb7859583d2 100644
|
| --- a/lib/compiler/implementation/dart_backend/backend.dart
|
| +++ b/lib/compiler/implementation/dart_backend/backend.dart
|
| @@ -64,12 +64,10 @@ class DartBackend extends Backend {
|
| compiler.jsHelperLibrary,
|
| compiler.interceptorsLibrary,
|
| ];
|
| - compiler.libraries.forEach((uri, lib) {
|
| - if (uri.startsWith('dart:')) LIBS_TO_IGNORE.add(lib);
|
| - });
|
| bool shouldOutput(Element element) =>
|
| element.kind !== ElementKind.VOID &&
|
| - LIBS_TO_IGNORE.indexOf(element.getLibrary()) == -1;
|
| + LIBS_TO_IGNORE.indexOf(element.getLibrary()) == -1 &&
|
| + !isDartCoreLib(compiler, element.getLibrary());
|
|
|
| try {
|
| Emitter emitter = new Emitter(compiler);
|
| @@ -103,3 +101,17 @@ main() {
|
|
|
| log(String message) => compiler.log('[DartBackend] $message');
|
| }
|
| +
|
| +/**
|
| + * Checks if [:libraryElement:] is a core lib, that is a library
|
| + * provided by the implementation like dart:core, dart:coreimpl, etc.
|
| + */
|
| +bool isDartCoreLib(Compiler compiler, LibraryElement libraryElement) {
|
| + final libraries = compiler.libraries;
|
| + for (final uri in libraries.getKeys()) {
|
| + if (libraryElement === libraries[uri]) {
|
| + if (uri.startsWith('dart:')) return true;
|
| + }
|
| + }
|
| + return false;
|
| +}
|
|
|