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

Unified Diff: sdk/lib/js/dart2js/js_dart2js.dart

Issue 25138003: Cache the context proxy. Don't use window for global 'this'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « sdk/lib/_internal/lib/js_helper.dart ('k') | sdk/lib/js/dartium/js_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/js/dart2js/js_dart2js.dart
diff --git a/sdk/lib/js/dart2js/js_dart2js.dart b/sdk/lib/js/dart2js/js_dart2js.dart
index 7f806b73f3744794eeca4b725e61093b6cf12008..64b4af0b4771972ac4ac9b773480ece956d914b8 100644
--- a/sdk/lib/js/dart2js/js_dart2js.dart
+++ b/sdk/lib/js/dart2js/js_dart2js.dart
@@ -5,11 +5,9 @@
library dart.js;
import 'dart:_foreign_helper' show JS;
-import 'dart:_js_helper' show convertDartClosureToJS;
+import 'dart:_js_helper' show Primitives, convertDartClosureToJS;
-JsObject get context {
- return new JsObject._fromJs(JS('=Object', 'window'));
-}
+final JsObject context = new JsObject._fromJs(Primitives.computeGlobalThis());
JsObject jsify(dynamic data) => data == null ? null : new JsObject._json(data);
« no previous file with comments | « sdk/lib/_internal/lib/js_helper.dart ('k') | sdk/lib/js/dartium/js_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698