OLD | NEW |
1 // Copyright (c) 2015, 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 library dart._runtime; | 5 library dart._runtime; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:collection'; | 8 import 'dart:collection'; |
9 | 9 |
10 import 'dart:_foreign_helper' show JS, JSExportName, rest, spread; | 10 import 'dart:_foreign_helper' show JS, JSExportName, rest, spread; |
(...skipping 17 matching lines...) Expand all Loading... |
28 part 'types.dart'; | 28 part 'types.dart'; |
29 part 'errors.dart'; | 29 part 'errors.dart'; |
30 part 'generators.dart'; | 30 part 'generators.dart'; |
31 part 'operations.dart'; | 31 part 'operations.dart'; |
32 part 'utils.dart'; | 32 part 'utils.dart'; |
33 | 33 |
34 // TODO(vsm): Move polyfill code to dart:html. | 34 // TODO(vsm): Move polyfill code to dart:html. |
35 // Note, native extensions are registered onto types in dart.global. | 35 // Note, native extensions are registered onto types in dart.global. |
36 // This polyfill needs to run before the corresponding dart:html code is run. | 36 // This polyfill needs to run before the corresponding dart:html code is run. |
37 @JSExportName('global') | 37 @JSExportName('global') |
38 final global_ = JS('', ''' | 38 final global_ = JS( |
| 39 '', |
| 40 ''' |
39 function () { | 41 function () { |
40 if (typeof NodeList !== "undefined") { | 42 if (typeof NodeList !== "undefined") { |
41 // TODO(vsm): Do we still need these? | 43 // TODO(vsm): Do we still need these? |
42 NodeList.prototype.get = function(i) { return this[i]; }; | 44 NodeList.prototype.get = function(i) { return this[i]; }; |
43 NamedNodeMap.prototype.get = function(i) { return this[i]; }; | 45 NamedNodeMap.prototype.get = function(i) { return this[i]; }; |
44 DOMTokenList.prototype.get = function(i) { return this[i]; }; | 46 DOMTokenList.prototype.get = function(i) { return this[i]; }; |
45 HTMLCollection.prototype.get = function(i) { return this[i]; }; | 47 HTMLCollection.prototype.get = function(i) { return this[i]; }; |
46 | 48 |
47 // Expose constructors for DOM types dart:html needs to assume are | 49 // Expose constructors for DOM types dart:html needs to assume are |
48 // available on window. | 50 // available on window. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 85 } |
84 } | 86 } |
85 var globalState = (typeof window != "undefined") ? window | 87 var globalState = (typeof window != "undefined") ? window |
86 : (typeof global != "undefined") ? global | 88 : (typeof global != "undefined") ? global |
87 : (typeof self != "undefined") ? self : {}; | 89 : (typeof self != "undefined") ? self : {}; |
88 return globalState; | 90 return globalState; |
89 }() | 91 }() |
90 '''); | 92 '''); |
91 | 93 |
92 final JsSymbol = JS('', 'Symbol'); | 94 final JsSymbol = JS('', 'Symbol'); |
OLD | NEW |