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 /* This library defines a set of general javascript utilities for us | 5 /* This library defines a set of general javascript utilities for us |
6 * by the Dart runtime. | 6 * by the Dart runtime. |
7 */ | 7 */ |
8 | 8 |
9 var dart_utils; | 9 var dart_utils; |
10 (function (dart_utils) { | 10 (function (dart_utils) { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 /** | 106 /** |
107 * Copy properties from source to destination object. | 107 * Copy properties from source to destination object. |
108 * This operation is commonly called `mixin` in JS. | 108 * This operation is commonly called `mixin` in JS. |
109 */ | 109 */ |
110 function copyProperties(to, from) { | 110 function copyProperties(to, from) { |
111 return copyTheseProperties(to, from, getOwnNamesAndSymbols(from)); | 111 return copyTheseProperties(to, from, getOwnNamesAndSymbols(from)); |
112 } | 112 } |
113 dart_utils.copyProperties = copyProperties; | 113 dart_utils.copyProperties = copyProperties; |
114 | 114 |
| 115 |
| 116 function instantiate(type, args) { |
| 117 return new type(...args); |
| 118 } |
| 119 dart_utils.instantiate = instantiate; |
| 120 |
115 })(dart_utils || (dart_utils = {})); | 121 })(dart_utils || (dart_utils = {})); |
OLD | NEW |