Index: sdk/lib/_internal/compiler/implementation/compiler.dart |
diff --git a/sdk/lib/_internal/compiler/implementation/compiler.dart b/sdk/lib/_internal/compiler/implementation/compiler.dart |
index 85cbe027324c46d48934480b00940ac58567560a..cbd205d4cc6757c487a70320587e106dd0adf790 100644 |
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart |
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart |
@@ -486,16 +486,21 @@ abstract class Compiler implements DiagnosticListener { |
/** Enable the 'JS' helper for a library if needed. */ |
void maybeEnableJSHelper(LibraryElement library) { |
String libraryName = library.uri.toString(); |
- if (library.entryCompilationUnit.script.name.contains( |
- 'dart/tests/compiler/dart2js_native') |
+ bool nativeTest = library.entryCompilationUnit.script.name.contains( |
+ 'dart/tests/compiler/dart2js_native'); |
+ if (nativeTest |
|| libraryName == 'dart:mirrors' |
|| libraryName == 'dart:isolate' |
|| libraryName == 'dart:math' |
|| libraryName == 'dart:html' |
|| libraryName == 'dart:svg' |
|| libraryName == 'dart:web_audio') { |
- if (libraryName == 'dart:html' || libraryName == 'dart:mirrors') { |
- // dart:html needs access to convertDartClosureToJS. |
+ if (nativeTest |
+ || libraryName == 'dart:html' |
+ || libraryName == 'dart:svg' |
+ || libraryName == 'dart:mirrors') { |
+ // dart:html and dart:svg need access to convertDartClosureToJS and |
+ // annotation classes. |
// dart:mirrors needs access to the Primitives class. |
importHelperLibrary(library); |
} |