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

Unified Diff: pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart

Issue 2558133002: Enable more async code on node (Closed)
Patch Set: Created 4 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 | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/tool/input_sdk/private/isolate_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart b/pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart
index b49a23b6a350f6ac28ef00b24d178c7bc369066c..cd898d0194e9b6fa2b4a5bc54149d18c150df2b8 100644
--- a/pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart
+++ b/pkg/dev_compiler/tool/input_sdk/patch/async_patch.dart
@@ -10,6 +10,7 @@ import 'dart:_js_helper' show
import 'dart:_isolate_helper' show
IsolateNatives,
TimerImpl,
+ global,
leaveJsAsync,
enterJsAsync,
isWorker;
@@ -33,14 +34,14 @@ class _AsyncRun {
static _TakeCallback _initializeScheduleImmediate() {
// TODO(rnystrom): Not needed by dev_compiler.
// requiresPreamble();
- if (JS('', 'self.scheduleImmediate') != null) {
+ if (JS('', '#.scheduleImmediate', global) != null) {
return _scheduleImmediateJsOverride;
}
- if (JS('', 'self.MutationObserver') != null &&
- JS('', 'self.document') != null) {
+ if (JS('', '#.MutationObserver', global) != null &&
+ JS('', '#.document', global) != null) {
// Use mutationObservers.
- var div = JS('', 'self.document.createElement("div")');
- var span = JS('', 'self.document.createElement("span")');
+ var div = JS('', '#.document.createElement("div")', global);
+ var span = JS('', '#.document.createElement("span")', global);
_Callback storedCallback;
internalCallback(_) {
@@ -50,7 +51,7 @@ class _AsyncRun {
f();
};
- var observer = JS('', 'new self.MutationObserver(#)', internalCallback);
+ var observer = JS('', 'new #.MutationObserver(#)', global, internalCallback);
JS('', '#.observe(#, { childList: true })',
observer, div);
@@ -64,7 +65,7 @@ class _AsyncRun {
JS('', '#.firstChild ? #.removeChild(#): #.appendChild(#)',
div, div, span, div, span);
};
- } else if (JS('', 'self.setImmediate') != null) {
+ } else if (JS('', '#.setImmediate', global) != null) {
return _scheduleImmediateWithSetImmediate;
}
// TODO(20055): We should use DOM promises when available.
@@ -77,7 +78,7 @@ class _AsyncRun {
callback();
};
enterJsAsync();
- JS('void', 'self.scheduleImmediate(#)', internalCallback);
+ JS('void', '#.scheduleImmediate(#)', global, internalCallback);
}
static void _scheduleImmediateWithSetImmediate(void callback()) {
@@ -86,7 +87,7 @@ class _AsyncRun {
callback();
};
enterJsAsync();
- JS('void', 'self.setImmediate(#)', internalCallback);
+ JS('void', '#.setImmediate(#)', global, internalCallback);
}
static void _scheduleImmediateWithTimer(void callback()) {
« no previous file with comments | « pkg/dev_compiler/lib/sdk/ddc_sdk.sum ('k') | pkg/dev_compiler/tool/input_sdk/private/isolate_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698