| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 let sigObj = $type[$_methodSig]; | 210 let sigObj = $type[$_methodSig]; |
| 211 if (sigObj === void 0) return void 0; | 211 if (sigObj === void 0) return void 0; |
| 212 return sigObj[$name]; | 212 return sigObj[$name]; |
| 213 })()'''); | 213 })()'''); |
| 214 | 214 |
| 215 getFieldType(type, name) => JS( | 215 getFieldType(type, name) => JS( |
| 216 '', | 216 '', |
| 217 '''(() => { | 217 '''(() => { |
| 218 let sigObj = $type[$_fieldSig]; | 218 let sigObj = $type[$_fieldSig]; |
| 219 if (sigObj === void 0) return void 0; | 219 if (sigObj === void 0) return void 0; |
| 220 return sigObj[$name]; | 220 let fieldType = sigObj[$name]; |
| 221 // workaround to handle metadata. |
| 222 return (fieldType instanceof Array) ? fieldType[0] : fieldType; |
| 221 })()'''); | 223 })()'''); |
| 222 | 224 |
| 223 getSetterType(type, name) => JS( | 225 getSetterType(type, name) => JS( |
| 224 '', | 226 '', |
| 225 '''(() => { | 227 '''(() => { |
| 226 let sigObj = $type[$_setterSig]; | 228 let sigObj = $type[$_setterSig]; |
| 227 if (sigObj === void 0) return void 0; | 229 if (sigObj === void 0) return void 0; |
| 228 return sigObj[$name]; | 230 return sigObj[$name]; |
| 229 })()'''); | 231 })()'''); |
| 230 | 232 |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 '''(() => { | 619 '''(() => { |
| 618 let values = []; | 620 let values = []; |
| 619 for (var i = 0; i < $names.length; i++) { | 621 for (var i = 0; i < $names.length; i++) { |
| 620 let value = $const_(new $enumClass(i)); | 622 let value = $const_(new $enumClass(i)); |
| 621 values.push(value); | 623 values.push(value); |
| 622 Object.defineProperty($enumClass, $names[i], | 624 Object.defineProperty($enumClass, $names[i], |
| 623 { value: value, configurable: true }); | 625 { value: value, configurable: true }); |
| 624 } | 626 } |
| 625 $enumClass.values = $constList(values, $enumClass); | 627 $enumClass.values = $constList(values, $enumClass); |
| 626 })()'''); | 628 })()'''); |
| OLD | NEW |