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 ddc.runtime.dart_runtime; | 5 library dev_compiler.runtime.dart_runtime; |
6 | 6 |
7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
8 | 8 |
9 import 'package:dev_compiler/config.dart'; | 9 import 'package:dev_compiler/config.dart'; |
10 | 10 |
11 dynamic dload(dynamic obj, String field) { | 11 dynamic dload(dynamic obj, String field) { |
12 var symbol = new Symbol(field); | 12 var symbol = new Symbol(field); |
13 var mirror = reflect(obj); | 13 var mirror = reflect(obj); |
14 // TODO(vsm): Does this create an NSM? | 14 // TODO(vsm): Does this create an NSM? |
15 var fieldMirror = mirror.getField(symbol); | 15 var fieldMirror = mirror.getField(symbol); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 ret1 = call1.returnType; | 315 ret1 = call1.returnType; |
316 params1 = call1.parameters; | 316 params1 = call1.parameters; |
317 } | 317 } |
318 | 318 |
319 // Any type that implements a call method implicitly subtypes Function. | 319 // Any type that implements a call method implicitly subtypes Function. |
320 if (_reflects(c2, Function)) return true; | 320 if (_reflects(c2, Function)) return true; |
321 | 321 |
322 // Check structural function subtyping | 322 // Check structural function subtyping |
323 return _isFunctionSubType(ret1, params1, c2.returnType, c2.parameters); | 323 return _isFunctionSubType(ret1, params1, c2.returnType, c2.parameters); |
324 } | 324 } |
OLD | NEW |