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

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

Issue 20224003: Implement IsolateMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 7 years, 5 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
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/lib/js_mirrors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4b1228f483387419e17bc1bfdf8df9f6d98cf2e6..b4083541a34e68bbb4e48124ed2307af41616398 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -3755,7 +3755,11 @@ if (typeof document !== "undefined" && document.readyState !== "complete") {
..write(',$_')
..write('{$n')
..addBuffer(buffer)
- ..write('}],$n');
+ ..write('}');
+ if (library == compiler.mainApp) {
+ mainBuffer.write(',${n}1');
+ }
+ mainBuffer.write('],$n');
}
buffer = buffers[1];
if (buffer != null) {
@@ -3972,10 +3976,22 @@ if (typeof document !== "undefined" && document.readyState !== "complete") {
var length = reflectionData.length;
for (var i = 0; i < length; i++) {
var data = reflectionData[i];
+'''
+// [data] contains these elements:
+// 0. The library name (not unique).
+// 1. The library URI (unique).
+// 2. A function returning the metadata associated with this library.
+// 3. An object literal listing the members of the library.
+// 4. This element is optional and if present it is true and signals that this
+// library is the root library (see dart:mirrors IsolateMirror.rootLibrary).
+//
+// The entries of [data] are built in [assembleProgram] above.
+'''
var name = data[0];
var uri = data[1];
var metadata = data[2];
var descriptor = data[3];
+ var isRoot = !!data[4];
var fields = descriptor && descriptor[""];
var classes = [];
var functions = [];
@@ -4017,7 +4033,7 @@ if (typeof document !== "undefined" && document.readyState !== "complete") {
}
}
processStatics(descriptor);
- libraries.push([name, uri, classes, functions, metadata, fields]);
+ libraries.push([name, uri, classes, functions, metadata, fields, isRoot]);
}
})''';
}
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/lib/js_mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698