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

Unified Diff: sdk/lib/_internal/compiler/js_lib/isolate_helper.dart

Issue 771993003: Add Isolate.current getter, returning the current isolate as an Isolate object. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test Created 6 years 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
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | sdk/lib/_internal/compiler/js_lib/isolate_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/js_lib/isolate_helper.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/isolate_helper.dart b/sdk/lib/_internal/compiler/js_lib/isolate_helper.dart
index 90620facc95632643c4a0b6486d6a212917866ff..ae27e0f9b6e5eafa6d25af9cac3b3879e5634156 100644
--- a/sdk/lib/_internal/compiler/js_lib/isolate_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/isolate_helper.dart
@@ -1015,6 +1015,13 @@ class IsolateNatives {
}, 'nonworker start');
}
+ static Isolate get currentIsolate {
+ _IsolateContext context = JS_CURRENT_ISOLATE_CONTEXT();
+ return new Isolate(context.controlPort.sendPort,
+ pauseCapability: context.pauseCapability,
+ terminateCapability: context.terminateCapability);
+ }
+
static void _startIsolate(Function topLevel,
List<String> args, message,
bool isSpawnUri,
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | sdk/lib/_internal/compiler/js_lib/isolate_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698