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

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

Issue 11598006: Concept of how dart:mirrors LibraryMirror, ClassMirror can be implemented in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added enough closure support to get tests/lib/mirrors/mirrors_test.dart pass. Created 7 years, 12 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: sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
index 39e1c5c8f651b7254d2ac1d00b522d3925ff7525..53a10bf084bd2a4d4b4ad39983e1ef91b21c1464 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/js_helper.dart
@@ -767,10 +767,22 @@ class Primitives {
return JS('var', '#.apply(#, #)', jsFunction, function, arguments);
}
+ // When isolate support is present global statics are in
+ // JS('var', '#.isolateStatics', Primitives.getCurrentIsolate());
+ // When there is no isolate support, there is no isolateStatics in
+ // getCurrentIsolate(). Global statics are directly in '$', which
+ // is current isollate.
+ // So using '$' seems to work as a way to acces global statics
+ // whether there is isolate support or not.
+ static getGlobalStatics() => JS('var', r'$');
+
static getConstructor(String className) {
// TODO(ahe): How to safely access $?
- return JS('var', r'$[#]', className);
+ return JS('var', r'#[#]', getGlobalStatics(), className);
}
+
+ static getCurrentIsolate() => JS_CURRENT_ISOLATE();
+ static getIsolateID(isolate) => JS('var', '#.id', isolate);
}
/**

Powered by Google App Engine
This is Rietveld 408576698