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

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: 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
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..6dda6e7f4811f7fb2b4d1a1fb930c2c958401b42 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 =
+ // document && (document.currentScript ||
ngeoffray 2013/02/19 15:22:26 Don't you need to use globalThis.document in the f
ahe 2013/02/19 15:50:37 I have changed this to (typeof document == 'object
+ // document.scripts[document.scripts.length - 1]);
+ js['isolateProperties'][r'$currentScript'].assign(
+ js['document'].binary(
+ '&&',
+ js['document']['currentScript'].binary(
+ '||',
+ js['document']['scripts'][
+ js['document']['scripts']['length'] - 1]))),
ngeoffray 2013/02/19 15:22:26 So this works on all browsers now?
ahe 2013/02/19 15:50:37 As far as I can tell.
+
// var isolatePrototype = oldIsolate.prototype;
js['isolatePrototype'].def(js['oldIsolate']['prototype']),

Powered by Google App Engine
This is Rietveld 408576698