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); |
} |
/** |