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

Unified Diff: sdk/lib/_internal/compiler/js_lib/preambles/jsshell.js

Issue 956953002: Support for a dart2js `dartDeferredLoader` hook. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix text in pkg/compiler/lib/src/js_emitter/old_emitter/declarations.dart Created 5 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: sdk/lib/_internal/compiler/js_lib/preambles/jsshell.js
diff --git a/sdk/lib/_internal/compiler/js_lib/preambles/jsshell.js b/sdk/lib/_internal/compiler/js_lib/preambles/jsshell.js
index 8f13bcc8f28fefa1adcad3488d1746cf590c35c1..e80401969c537aedb0e7fa34278aa3e9d0fa65d8 100644
--- a/sdk/lib/_internal/compiler/js_lib/preambles/jsshell.js
+++ b/sdk/lib/_internal/compiler/js_lib/preambles/jsshell.js
@@ -1,4 +1,4 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -11,9 +11,28 @@
// Location (Uri.base)
var workingDirectory = environment["PWD"];
- self.location = { href: "file://" + workingDirectory + "/" };
// Global properties. "self" refers to the global object, so adding a
// property to "self" defines a global variable.
self.self = self;
+
+ self.location = { href: "file://" + workingDirectory + "/" };
+
+ // Support for deferred loading.
+ self.dartDeferredLibraryLoader = function(uri, successCallback, errorCallback) {
+ try {
+ load(uri);
+ successCallback();
+ } catch (error) {
+ errorCallback(error);
+ }
+ };
})(this)
+
+var getKeys = function(obj){
+ var keys = [];
+ for(var key in obj){
+ keys.push(key);
+ }
+ return keys;
+}

Powered by Google App Engine
This is Rietveld 408576698