Index: lib/isolate/isolate_frog.dart |
diff --git a/lib/isolate/isolate_frog.dart b/lib/isolate/isolate_frog.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5accc1f18cba79d5c4c3cc18a172379c7e0ede8f |
--- /dev/null |
+++ b/lib/isolate/isolate_frog.dart |
@@ -0,0 +1,36 @@ |
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+ |
+// Dart isolate's API and implementation for frog. |
+#library("dart:isolate"); |
+ |
+#import("frog/isolateimpl.dart"); |
+#import("frog/ports.dart"); |
+ |
+#source("isolate_api.dart"); |
+#source("frog/compiler_hooks.dart"); |
+ |
+/** Default factory for [Isolate2]. */ |
+class _IsolateFactory { |
+ |
+ factory Isolate2.fromCode(Function topLevelFunction) { |
+ final name = IsolateNatives._getJSFunctionName(topLevelFunction); |
+ if (name == null) { |
+ throw new UnsupportedOperationException( |
+ "only top-level functions can be spawned."); |
+ } |
+ return new Isolate2Impl(IsolateNatives._spawn2(name, null, false)); |
+ } |
+ |
+ factory Isolate2.fromUri(String uri) { |
+ return new Isolate2Impl(IsolateNatives._spawn2(null, uri, false)); |
+ } |
+} |
+ |
+class _IsolateNatives { |
+ static Future<SendPort> spawn(Isolate isolate, bool isLight) { |
+ return IsolateNatives.spawn(isolate, isLight); |
+ } |
+} |