| 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 the operations that define and manipulate Dart | 5 /// This library defines the operations that define and manipulate Dart |
| 6 /// classes. Included in this are: | 6 /// classes. Included in this are: |
| 7 /// - Generics | 7 /// - Generics |
| 8 /// - Class metadata | 8 /// - Class metadata |
| 9 /// - Extension methods | 9 /// - Extension methods |
| 10 /// | 10 /// |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 map.set(arg, value); | 172 map.set(arg, value); |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 return value; | 176 return value; |
| 177 } | 177 } |
| 178 makeGenericType[$_genericTypeCtor] = $typeConstructor; | 178 makeGenericType[$_genericTypeCtor] = $typeConstructor; |
| 179 return makeGenericType; | 179 return makeGenericType; |
| 180 })()'''); | 180 })()'''); |
| 181 | 181 |
| 182 getGenericClass(type) => | 182 getGenericClass(type) => safeGetOwnProperty(type, _originalDeclaration); |
| 183 JS('', '$safeGetOwnProperty($type, $_originalDeclaration)'); | |
| 184 | 183 |
| 185 getGenericArgs(type) => JS('', '$safeGetOwnProperty($type, $_typeArguments)'); | 184 List getGenericArgs(type) => |
| 185 JS('List', '#', safeGetOwnProperty(type, _typeArguments)); |
| 186 | 186 |
| 187 // TODO(vsm): Collapse into one expando. | 187 // TODO(vsm): Collapse into one expando. |
| 188 final _constructorSig = JS('', 'Symbol("sigCtor")'); | 188 final _constructorSig = JS('', 'Symbol("sigCtor")'); |
| 189 final _methodSig = JS('', 'Symbol("sigMethod")'); | 189 final _methodSig = JS('', 'Symbol("sigMethod")'); |
| 190 final _fieldSig = JS('', 'Symbol("sigField")'); | 190 final _fieldSig = JS('', 'Symbol("sigField")'); |
| 191 final _getterSig = JS('', 'Symbol("sigGetter")'); | 191 final _getterSig = JS('', 'Symbol("sigGetter")'); |
| 192 final _setterSig = JS('', 'Symbol("sigSetter")'); | 192 final _setterSig = JS('', 'Symbol("sigSetter")'); |
| 193 final _staticSig = JS('', 'Symbol("sigStaticMethod")'); | 193 final _staticSig = JS('', 'Symbol("sigStaticMethod")'); |
| 194 final _staticFieldSig = JS('', 'Symbol("sigStaticField")'); | 194 final _staticFieldSig = JS('', 'Symbol("sigStaticField")'); |
| 195 final _staticGetterSig = JS('', 'Symbol("sigStaticGetter")'); | 195 final _staticGetterSig = JS('', 'Symbol("sigStaticGetter")'); |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 '''(() => { | 670 '''(() => { |
| 671 let values = []; | 671 let values = []; |
| 672 for (var i = 0; i < $names.length; i++) { | 672 for (var i = 0; i < $names.length; i++) { |
| 673 let value = $const_(new $enumClass(i)); | 673 let value = $const_(new $enumClass(i)); |
| 674 values.push(value); | 674 values.push(value); |
| 675 Object.defineProperty($enumClass, $names[i], | 675 Object.defineProperty($enumClass, $names[i], |
| 676 { value: value, configurable: true }); | 676 { value: value, configurable: true }); |
| 677 } | 677 } |
| 678 $enumClass.values = $constList(values, $enumClass); | 678 $enumClass.values = $constList(values, $enumClass); |
| 679 })()'''); | 679 })()'''); |
| OLD | NEW |