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

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

Issue 16135004: Rename JS_CURRENT_ISOLATE to JS_CURRENT_ISOLATE_CONTEXT. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 months 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: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index 6ecbfd5099e1e4ab723fd545a494966e5544cb0b..36c3a8866e700e07259caa102cb28940ec35a44c 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -3021,13 +3021,13 @@ if (typeof document !== "undefined" && document.readyState !== "complete") {
mainBuffer.write(';');
}
mainBuffer
- ..write(REFLECTION_DATA_PARSER)
+ ..write(getReflectionDataParser())
..write('([$n');
emitDeferredPreambleWhenEmpty(deferredBuffer);
deferredBuffer.add('\$\$$_=$_{};$n');
deferredBuffer
- ..write(REFLECTION_DATA_PARSER)
+ ..write(getReflectionDataParser())
..write('([$n');
var sortedLibraries = Elements.sortedByPosition(libraryBuffers.keys);
for (LibraryElement library in sortedLibraries) {
@@ -3212,25 +3212,10 @@ if (typeof document !== "undefined" && document.readyState !== "complete") {
MessageKind.GENERIC.error({'text': message}),
api.Diagnostic.WARNING);
}
-}
-
-const String GENERATED_BY = """
-// Generated by dart2js, the Dart to JavaScript compiler.
-""";
-
-const String HOOKS_API_USAGE = """
-// The code supports the following hooks:
-// dartPrint(message) - if this function is defined it is called
-// instead of the Dart [print] method.
-// dartMainRunner(main) - if this function is defined, the Dart [main]
-// method will not be invoked directly.
-// Instead, a closure that will invoke [main] is
-// passed to [dartMainRunner].
-""";
-// TODO(ahe): This code should be integrated in finishClasses.
-// TODO(ahe): The uri field below is fake.
-const String REFLECTION_DATA_PARSER = r'''
+ // TODO(ahe): This code should be integrated in finishClasses.
+ String getReflectionDataParser() {
+ return '''
(function (reflectionData) {
if (!init.libraries) init.libraries = [];
var libraries = init.libraries;
@@ -3247,10 +3232,10 @@ const String REFLECTION_DATA_PARSER = r'''
if (!hasOwnProperty.call(descriptor, property)) continue;
var element = descriptor[property];
if (typeof element === "function") {
- $[property] = element;
+ ${namer.CURRENT_ISOLATE}[property] = element;
functions.push(property);
} else {
- $$[property] = element;
+ $classesCollector[property] = element;
classes.push(property);
classes.push(element[""]);
}
@@ -3258,3 +3243,19 @@ const String REFLECTION_DATA_PARSER = r'''
libraries.push([name, uri, classes, functions]);
}
})''';
+ }
+}
+
+const String GENERATED_BY = """
+// Generated by dart2js, the Dart to JavaScript compiler.
+""";
+
+const String HOOKS_API_USAGE = """
+// The code supports the following hooks:
+// dartPrint(message) - if this function is defined it is called
+// instead of the Dart [print] method.
+// dartMainRunner(main) - if this function is defined, the Dart [main]
+// method will not be invoked directly.
+// Instead, a closure that will invoke [main] is
+// passed to [dartMainRunner].
+""";

Powered by Google App Engine
This is Rietveld 408576698