| 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 library dart._js_mirrors; | 5 library dart._js_mirrors; |
| 6 | 6 |
| 7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
| 8 import 'dart:_foreign_helper' show JS; | 8 import 'dart:_foreign_helper' show JS; |
| 9 import 'dart:_internal' as _internal; | 9 import 'dart:_internal' as _internal; |
| 10 | 10 |
| 11 String getName(Symbol symbol) => | 11 String getName(Symbol symbol) => |
| 12 _internal.Symbol.getName(symbol as _internal.Symbol); | 12 _internal.Symbol.getName(symbol as _internal.Symbol); |
| 13 | 13 |
| 14 Symbol getSymbol(name, library) => | 14 Symbol getSymbol(name, library) => |
| 15 throw new UnimplementedError("MirrorSystem.getSymbol unimplemented"); | 15 throw new UnimplementedError("MirrorSystem.getSymbol unimplemented"); |
| 16 | 16 |
| 17 final currentJsMirrorSystem = throw new UnimplementedError( | 17 final currentJsMirrorSystem = throw new UnimplementedError( |
| 18 "MirrorSystem.currentJsMirrorSystem unimplemented"); | 18 "MirrorSystem.currentJsMirrorSystem unimplemented"); |
| 19 | 19 |
| 20 InstanceMirror reflect(reflectee) => new JsInstanceMirror._(reflectee); | 20 InstanceMirror reflect(reflectee) => new JsInstanceMirror._(reflectee); |
| 21 | 21 |
| 22 TypeMirror reflectType(Type key) { | 22 TypeMirror reflectType(Type key) { |
| 23 // TODO(vsm): Might not be a class. | 23 // TODO(vsm): Might not be a class. |
| 24 return new JsClassMirror._(key); | 24 return new JsClassMirror._(key); |
| 25 } | 25 } |
| 26 | 26 |
| 27 final dynamic _dart = JS('', 'dart'); | 27 final dynamic _dart = JS('', 'dart'); |
| 28 final _metadata = JS('', '#.metadata', _dart); | |
| 29 | 28 |
| 30 dynamic _dload(obj, String name) { | 29 dynamic _dload(obj, String name) { |
| 31 return JS('', '#.dload(#, #)', _dart, obj, name); | 30 return JS('', '#.dload(#, #)', _dart, obj, name); |
| 32 } | 31 } |
| 33 | 32 |
| 34 void _dput(obj, String name, val) { | 33 void _dput(obj, String name, val) { |
| 35 JS('', '#.dput(#, #, #)', _dart, obj, name, val); | 34 JS('', '#.dput(#, #, #)', _dart, obj, name, val); |
| 36 } | 35 } |
| 37 | 36 |
| 38 dynamic _dsend(obj, String name, List args) { | 37 dynamic _dsend(obj, String name, List args) { |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 throw new UnimplementedError("MethodMirror.owner unimplemented"); | 345 throw new UnimplementedError("MethodMirror.owner unimplemented"); |
| 347 Symbol get qualifiedName => | 346 Symbol get qualifiedName => |
| 348 throw new UnimplementedError("MethodMirror.qualifiedName unimplemented"); | 347 throw new UnimplementedError("MethodMirror.qualifiedName unimplemented"); |
| 349 TypeMirror get returnType => | 348 TypeMirror get returnType => |
| 350 throw new UnimplementedError("MethodMirror.returnType unimplemented"); | 349 throw new UnimplementedError("MethodMirror.returnType unimplemented"); |
| 351 Symbol get simpleName => | 350 Symbol get simpleName => |
| 352 throw new UnimplementedError("MethodMirror.simpleName unimplemented"); | 351 throw new UnimplementedError("MethodMirror.simpleName unimplemented"); |
| 353 String get source => | 352 String get source => |
| 354 throw new UnimplementedError("MethodMirror.source unimplemented"); | 353 throw new UnimplementedError("MethodMirror.source unimplemented"); |
| 355 } | 354 } |
| OLD | NEW |