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

Unified Diff: dart/sdk/lib/_internal/lib/preambles/jsshell.js

Issue 345533004: Use "self" instead of globalThis. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r37482. Created 6 years, 6 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 | « dart/sdk/lib/_internal/lib/preambles/d8.js ('k') | dart/sdk/lib/js/dart2js/js_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/lib/preambles/jsshell.js
diff --git a/dart/sdk/lib/_internal/lib/preambles/jsshell.js b/dart/sdk/lib/_internal/lib/preambles/jsshell.js
index f24555fd54405ea0b535d771bf16d1a6cff9703b..e3b4f1aae35b8331be29ad66d2fa1648432758a2 100644
--- a/dart/sdk/lib/_internal/lib/preambles/jsshell.js
+++ b/dart/sdk/lib/_internal/lib/preambles/jsshell.js
@@ -3,3 +3,12 @@
// BSD-style license that can be found in the LICENSE file.
// Javascript preamble, that lets the output of dart2js run on JSShell.
+
+(function(self) {
+ // Using strict mode to avoid accidentally defining global variables.
+ "use strict"; // Should be first statement of this function.
+
+ // Global properties. "self" refers to the global object, so adding a
+ // property to "self" defines a global variable.
+ self.self = self;
+})(this)
« no previous file with comments | « dart/sdk/lib/_internal/lib/preambles/d8.js ('k') | dart/sdk/lib/js/dart2js/js_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698