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

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

Issue 11308154: Stream isolates. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Fixes and test. Created 8 years, 1 month 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/isolate_patch.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/isolate_patch.dart b/sdk/lib/_internal/compiler/implementation/lib/isolate_patch.dart
index 9c7b19d2173ff9fa4f679eda9747b65d3369c595..752a6723b7510c8f90374fbc8d8e0138925dbb9f 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/isolate_patch.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/isolate_patch.dart
@@ -96,24 +96,27 @@ void _fillStatics(context) {
}
ReceivePort _lazyPort;
-patch ReceivePort get port {
- if (_lazyPort == null) {
- _lazyPort = new ReceivePort();
+
+patch class _Isolate {
+ patch static ReceivePort get port {
+ if (_lazyPort == null) {
+ _lazyPort = new ReceivePort();
+ }
+ return _lazyPort;
}
- return _lazyPort;
-}
-patch SendPort spawnFunction(void topLevelFunction()) {
- final name = _IsolateNatives._getJSFunctionName(topLevelFunction);
- if (name == null) {
- throw new UnsupportedError(
- "only top-level functions can be spawned.");
+ patch static SendPort spawnFunction(void topLevelFunction()) {
+ final name = _IsolateNatives._getJSFunctionName(topLevelFunction);
+ if (name == null) {
+ throw new UnsupportedError(
+ "only top-level functions can be spawned.");
+ }
+ return _IsolateNatives._spawn(name, null, false);
}
- return _IsolateNatives._spawn(name, null, false);
-}
-patch SendPort spawnUri(String uri) {
- return _IsolateNatives._spawn(null, uri, false);
+ patch static SendPort spawnUri(String uri) {
+ return _IsolateNatives._spawn(null, uri, false);
+ }
}
/** State associated with the current manager. See [globalState]. */

Powered by Google App Engine
This is Rietveld 408576698