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 var dart, _js_helper, _js_primitives; | 5 var dart, _js_helper, _js_primitives; |
6 (function (dart) { | 6 (function (dart) { |
7 'use strict'; | 7 'use strict'; |
8 | 8 |
9 let defineProperty = Object.defineProperty; | 9 let defineProperty = Object.defineProperty; |
10 let getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; | 10 let getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 | 959 |
960 // TODO(jmesserly): right now this is a sentinel. It should be a type object | 960 // TODO(jmesserly): right now this is a sentinel. It should be a type object |
961 // of some sort, assuming we keep around `dynamic` at runtime. | 961 // of some sort, assuming we keep around `dynamic` at runtime. |
962 dart.dynamic = { toString() { return 'dynamic'; } }; | 962 dart.dynamic = { toString() { return 'dynamic'; } }; |
963 dart.void = { toString() { return 'void'; } }; | 963 dart.void = { toString() { return 'void'; } }; |
964 dart.bottom = { toString() { return 'bottom'; } }; | 964 dart.bottom = { toString() { return 'bottom'; } }; |
965 | 965 |
966 dart.global = window || global; | 966 dart.global = window || global; |
967 dart.JsSymbol = Symbol; | 967 dart.JsSymbol = Symbol; |
968 | 968 |
| 969 function import_(value) { |
| 970 if (!value) throw 'missing required module'; |
| 971 return value; |
| 972 } |
| 973 dart.import = import_; |
| 974 |
| 975 function lazyImport(value) { |
| 976 return defineLibrary(value, {}); |
| 977 } |
| 978 dart.lazyImport = lazyImport; |
| 979 |
| 980 function defineLibrary(value, defaultValue) { |
| 981 return value ? value : defaultValue; |
| 982 } |
| 983 dart.defineLibrary = defineLibrary; |
| 984 |
969 // TODO(jmesserly): hack to bootstrap the SDK | 985 // TODO(jmesserly): hack to bootstrap the SDK |
970 _js_helper = _js_helper || {}; | 986 _js_helper = _js_helper || {}; |
971 _js_helper.checkNum = notNull; | 987 _js_helper.checkNum = notNull; |
972 | 988 |
973 _js_primitives = _js_primitives || {}; | 989 _js_primitives = _js_primitives || {}; |
974 _js_primitives.printString = (s) => console.log(s); | 990 _js_primitives.printString = (s) => console.log(s); |
975 | 991 |
976 })(dart || (dart = {})); | 992 })(dart || (dart = {})); |
OLD | NEW |