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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Javascript preamble, that lets the output of dart2js run on JSShell. 5 // Javascript preamble, that lets the output of dart2js run on JSShell.
6 6
7 (function(self) { 7 (function(self) {
8 // Using strict mode to avoid accidentally defining global variables. 8 // Using strict mode to avoid accidentally defining global variables.
9 "use strict"; // Should be first statement of this function. 9 "use strict"; // Should be first statement of this function.
10 10
11 // Location (Uri.base) 11 // Location (Uri.base)
12 12
13 var workingDirectory = environment["PWD"]; 13 var workingDirectory = environment["PWD"];
14 self.location = { href: "file://" + workingDirectory + "/" };
15 14
16 // Global properties. "self" refers to the global object, so adding a 15 // Global properties. "self" refers to the global object, so adding a
17 // property to "self" defines a global variable. 16 // property to "self" defines a global variable.
18 self.self = self; 17 self.self = self;
18
19 self.location = { href: "file://" + workingDirectory + "/" };
20
21 // Support for deferred loading.
22 self.dartDeferredLibraryLoader = function(uri, successCallback, errorCallback) {
23 try {
24 load(uri);
25 successCallback();
26 } catch (error) {
27 errorCallback(error);
28 }
29 };
19 })(this) 30 })(this)
31
32 var getKeys = function(obj){
33 var keys = [];
34 for(var key in obj){
35 keys.push(key);
36 }
37 return keys;
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698