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

Unified Diff: pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart

Issue 1224363004: Accept 'null' as document.contentScript. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart
diff --git a/pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart
index 3423d30833aba3d5304e043936ee89858e8fd112..f391ed903190fd1536a18838df1015620b4f2b3d 100644
--- a/pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/main_call_stub_generator.dart
@@ -52,7 +52,9 @@ class MainCallStubGenerator {
callback(null);
return;
}
- if (document.currentScript) {
+ // When running as a content-script of a chrome-extension the
+ // 'currentScript' is `null` (but not undefined).
+ if (typeof document.currentScript != 'undefined') {
callback(document.currentScript);
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698