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

Unified Diff: sdk/lib/_internal/compiler/js_lib/isolate_helper.dart

Issue 1130293002: dart2js: compute the currentScript in the preamble for d8 and jsshell. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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 | sdk/lib/_internal/compiler/js_lib/preambles/d8.js » ('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_helper.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/isolate_helper.dart b/sdk/lib/_internal/compiler/js_lib/isolate_helper.dart
index 2619c3507647e2935be43dd2490a19a7451ed0b0..ad6883c95f9c02494dc8b68050bf7d09cd08935f 100644
--- a/sdk/lib/_internal/compiler/js_lib/isolate_helper.dart
+++ b/sdk/lib/_internal/compiler/js_lib/isolate_helper.dart
@@ -753,29 +753,20 @@ class IsolateNatives {
static final Expando<int> workerIds = new Expando<int>();
/**
- * The src url for the script tag that loaded this Used to create
- * JavaScript workers.
+ * The src url for the script tag that loaded this function.
+ *
+ * Used to create JavaScript workers and load deferred libraries.
*/
static String computeThisScript() {
var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT);
floitsch 2015/05/07 21:09:51 The embedded global is set, if `document.currentSc
if (currentScript != null) {
return JS('String', 'String(#.src)', currentScript);
}
- if (Primitives.isD8) return computeThisScriptD8();
herhut 2015/05/08 08:06:27 Do we still need the Primitives.isXX helpers? It w
floitsch 2015/05/09 01:07:54 Removed in https://codereview.chromium.org/1132923
- if (Primitives.isJsshell) return computeThisScriptJsshell();
// A worker has no script tag - so get an url from a stack-trace.
if (_globalState.isWorker) return computeThisScriptFromTrace();
return null;
}
- static String computeThisScriptJsshell() {
- return JS('String|Null', 'thisFilename()');
- }
-
- // TODO(ahe): The following is for supporting D8. We should move this code
- // to a helper library that is only loaded when testing on D8.
- static String computeThisScriptD8() => computeThisScriptFromTrace();
-
static String computeThisScriptFromTrace() {
var stack = JS('String|Null', 'new Error().stack');
if (stack == null) {
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/js_lib/preambles/d8.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698