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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
878 objectKey.push(name); | 878 objectKey.push(name); |
879 objectKey.push(obj[name]); | 879 objectKey.push(obj[name]); |
880 } | 880 } |
881 return multiKeyPutIfAbsent(constants, objectKey, () => obj); | 881 return multiKeyPutIfAbsent(constants, objectKey, () => obj); |
882 } | 882 } |
883 dart.const = constant; | 883 dart.const = constant; |
884 | 884 |
885 /** Sets the type of `obj` to be `type` */ | 885 /** Sets the type of `obj` to be `type` */ |
886 function setType(obj, type) { | 886 function setType(obj, type) { |
887 obj.__proto__ = type.prototype; | 887 obj.__proto__ = type.prototype; |
| 888 return obj; |
888 } | 889 } |
889 dart.setType = setType; | 890 dart.setType = setType; |
890 | 891 |
891 /** Sets the internal runtime type of `obj` to be `type` */ | 892 /** Sets the internal runtime type of `obj` to be `type` */ |
892 function setRuntimeType(obj, type) { | 893 function setRuntimeType(obj, type) { |
893 obj[_runtimeType] = type; | 894 obj[_runtimeType] = type; |
894 } | 895 } |
895 dart.setRuntimeType = setRuntimeType; | 896 dart.setRuntimeType = setRuntimeType; |
896 | 897 |
897 // The following are helpers for Object methods when the receiver | 898 // The following are helpers for Object methods when the receiver |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 dart.defineLibrary = defineLibrary; | 985 dart.defineLibrary = defineLibrary; |
985 | 986 |
986 // TODO(jmesserly): hack to bootstrap the SDK | 987 // TODO(jmesserly): hack to bootstrap the SDK |
987 _js_helper = _js_helper || {}; | 988 _js_helper = _js_helper || {}; |
988 _js_helper.checkNum = notNull; | 989 _js_helper.checkNum = notNull; |
989 | 990 |
990 _js_primitives = _js_primitives || {}; | 991 _js_primitives = _js_primitives || {}; |
991 _js_primitives.printString = (s) => console.log(s); | 992 _js_primitives.printString = (s) => console.log(s); |
992 | 993 |
993 })(dart || (dart = {})); | 994 })(dart || (dart = {})); |
OLD | NEW |