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/implementation/lib/js_helper.dart

Issue 11574032: Make unit testing of the compiler work with the new isolate helper library. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 months 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/js_helper.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/lib/js_helper.dart (revision 16793)
+++ sdk/lib/_internal/compiler/implementation/lib/js_helper.dart (working copy)
@@ -1145,13 +1145,18 @@
if (closure == null) return null;
var function = JS('var', r'#.$identity', closure);
if (JS('bool', r'!!#', function)) return function;
+ // Fetch the current isolate in a local variable to prevent the
+ // compiler from inlining its use in the following JS expression:
+ // the current isolate may have changed so if we read it from the JS
+ // closure, it leads to the wrong isolate.
+ var currentIsolate = JS_CURRENT_ISOLATE();
function = JS("var", r"""function() {
return #(#, #, #, arguments[0], arguments[1]);
}""",
DART_CLOSURE_TO_JS(invokeClosure),
closure,
- JS_CURRENT_ISOLATE(),
+ currentIsolate,
arity);
JS('void', r'#.$identity = #', closure, function);

Powered by Google App Engine
This is Rietveld 408576698