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

Unified Diff: sdk/lib/_internal/compiler/js_lib/isolate_patch.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 | « sdk/lib/_internal/compiler/js_lib/isolate_helper.dart ('k') | sdk/lib/isolate/isolate.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_patch.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/isolate_patch.dart b/sdk/lib/_internal/compiler/js_lib/isolate_patch.dart
index cbba9e54b77d0913767ba013296f15d724bd6238..b612cced56949081ebe6afb65137b8acae2c7d37 100644
--- a/sdk/lib/_internal/compiler/js_lib/isolate_patch.dart
+++ b/sdk/lib/_internal/compiler/js_lib/isolate_patch.dart
@@ -14,6 +14,13 @@ import 'dart:_isolate_helper' show CapabilityImpl,
@patch
class Isolate {
+ static final _currentIsolateCache = IsolateNatives.currentIsolate;
+
+ // `current` must be a getter, not just a final field,
+ // to match the external declaration.
+ @patch
+ static Isolate get current => _currentIsolateCache;
+
@patch
static Future<Isolate> spawn(void entryPoint(message), var message,
{ bool paused: false }) {
« no previous file with comments | « sdk/lib/_internal/compiler/js_lib/isolate_helper.dart ('k') | sdk/lib/isolate/isolate.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698