Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Unified Diff: sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 11419250: Add @JSName annotation for native fields and methods - second try. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698