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 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) { | 969 function import_(value) { |
970 if (!value) throw 'missing required module'; | 970 // TODO(jmesserly): throw once we're loading all of core libs. |
| 971 if (!value && console) console.warn('missing required module'); |
971 return value; | 972 return value; |
972 } | 973 } |
973 dart.import = import_; | 974 dart.import = import_; |
974 | 975 |
975 function lazyImport(value) { | 976 function lazyImport(value) { |
976 return defineLibrary(value, {}); | 977 return defineLibrary(value, {}); |
977 } | 978 } |
978 dart.lazyImport = lazyImport; | 979 dart.lazyImport = lazyImport; |
979 | 980 |
980 function defineLibrary(value, defaultValue) { | 981 function defineLibrary(value, defaultValue) { |
981 return value ? value : defaultValue; | 982 return value ? value : defaultValue; |
982 } | 983 } |
983 dart.defineLibrary = defineLibrary; | 984 dart.defineLibrary = defineLibrary; |
984 | 985 |
985 // TODO(jmesserly): hack to bootstrap the SDK | 986 // TODO(jmesserly): hack to bootstrap the SDK |
986 _js_helper = _js_helper || {}; | 987 _js_helper = _js_helper || {}; |
987 _js_helper.checkNum = notNull; | 988 _js_helper.checkNum = notNull; |
988 | 989 |
989 _js_primitives = _js_primitives || {}; | 990 _js_primitives = _js_primitives || {}; |
990 _js_primitives.printString = (s) => console.log(s); | 991 _js_primitives.printString = (s) => console.log(s); |
991 | 992 |
992 })(dart || (dart = {})); | 993 })(dart || (dart = {})); |
OLD | NEW |