Index: frog/gen.dart |
diff --git a/frog/gen.dart b/frog/gen.dart |
index 52e0ba5a90f9ad260290529bf428ecf12c317958..1af4307645b41e474888d8c71d77f09ffd4f1dd7 100644 |
--- a/frog/gen.dart |
+++ b/frog/gen.dart |
@@ -89,21 +89,13 @@ class WorldGenerator { |
} |
} |
- // Only include isolate-specific code if isolates are used. |
- if (world.corelib.types['Isolate'].isUsed |
- || world.coreimpl.types['ReceivePortImpl'].isUsed) { |
- |
- // Generate callbacks from JS to isolate code if needed |
- if (corejs.useWrap0 || corejs.useWrap1) { |
- genMethod(world.coreimpl.types['IsolateContext'].getMember('eval')); |
- genMethod(world.coreimpl.types['EventLoop'].getMember('run')); |
- } |
- |
+ // Only wrap the app as an isolate if the isolate library was imported. |
+ if (world.isolatelib != null) { |
corejs.useIsolates = true; |
MethodMember isolateMain = |
- world.coreimpl.lookup('startRootIsolate', main.span); |
- var isolateMainTarget = new TypeValue(world.coreimpl.topType, main.span); |
- mainCall = isolateMain.invoke(mainContext, null, isolateMainTarget, |
+ world.isolatelib.lookup('startRootIsolate', main.span); |
+ mainCall = isolateMain.invoke(mainContext, null, |
+ new TypeValue(world.isolatelib.topType, main.span), |
new Arguments(null, [main._get(mainContext, main.definition, null)])); |
} |