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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 12288047: Change IsolateNatives.computeThisScript to use captured value of document.currentScript. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use typeof object and don't use JS_CURRENT_ISOLATE before _globalState has been initialized. Created 7 years, 10 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
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/lib/foreign_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
index c195512b4bc623017f68f4b8890cb0f894c28f71..79d2ab847210f185ed700bb9bf6f8d2a33ec461c 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
@@ -578,6 +578,17 @@ class CodeEmitterTask extends CompilerTask {
js['isolateProperties'].def(
js['oldIsolate'][namer.isolatePropertiesName]),
+ // isolateProperties.$currentScript =
+ // (typeof document == "object") && (document.currentScript ||
+ // document.scripts[document.scripts.length - 1]);
+ js['isolateProperties'][r'$currentScript'].assign(
+ js['document'].typeof.equals(js.string('object')).binary(
+ '&&',
+ js['document']['currentScript'].binary(
+ '||',
+ js['document']['scripts'][
+ js['document']['scripts']['length'] - 1]))),
+
// var isolatePrototype = oldIsolate.prototype;
js['isolatePrototype'].def(js['oldIsolate']['prototype']),
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/lib/foreign_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698