| 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 runtime operations on objects used by the code | 5 /// This library defines runtime operations on objects used by the code |
| 6 /// generator. | 6 /// generator. |
| 7 part of dart._runtime; | 7 part of dart._runtime; |
| 8 | 8 |
| 9 class InvocationImpl extends Invocation { | 9 class InvocationImpl extends Invocation { |
| 10 final Symbol memberName; | 10 final Symbol memberName; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 function callNSM() { | 236 function callNSM() { |
| 237 return $noSuchMethod(originalTarget, new $InvocationImpl( | 237 return $noSuchMethod(originalTarget, new $InvocationImpl( |
| 238 $name, $args, | 238 $name, $args, |
| 239 {namedArguments: $extractNamedArgs($args), isMethod: true})); | 239 {namedArguments: $extractNamedArgs($args), isMethod: true})); |
| 240 } | 240 } |
| 241 if (!($f instanceof Function)) { | 241 if (!($f instanceof Function)) { |
| 242 // We're not a function (and hence not a method either) | 242 // We're not a function (and hence not a method either) |
| 243 // Grab the `call` method if it's not a function. | 243 // Grab the `call` method if it's not a function. |
| 244 if ($f != null) { | 244 if ($f != null) { |
| 245 $ftype = $getMethodType($getType($f), 'call'); | 245 $ftype = $getMethodType($getType($f), 'call'); |
| 246 $f = $f.call; | 246 $f = f.call ? $bind($f, 'call') : void 0; |
| 247 } | 247 } |
| 248 if (!($f instanceof Function)) { | 248 if (!($f instanceof Function)) { |
| 249 return callNSM(); | 249 return callNSM(); |
| 250 } | 250 } |
| 251 } | 251 } |
| 252 // If f is a function, but not a method (no method type) | 252 // If f is a function, but not a method (no method type) |
| 253 // then it should have been a function valued field, so | 253 // then it should have been a function valued field, so |
| 254 // get the type from the function. | 254 // get the type from the function. |
| 255 if ($ftype === void 0) { | 255 if ($ftype === void 0) { |
| 256 $ftype = $_getRuntimeType($f); | 256 $ftype = $_getRuntimeType($f); |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 name = '+' + name; | 975 name = '+' + name; |
| 976 } | 976 } |
| 977 return name; | 977 return name; |
| 978 } | 978 } |
| 979 | 979 |
| 980 /// Emulates the implicit "loadLibrary" function provided by a deferred library. | 980 /// Emulates the implicit "loadLibrary" function provided by a deferred library. |
| 981 /// | 981 /// |
| 982 /// Libraries are not actually deferred in DDC, so this just returns a future | 982 /// Libraries are not actually deferred in DDC, so this just returns a future |
| 983 /// that completes immediately. | 983 /// that completes immediately. |
| 984 Future loadLibrary() => new Future.value(); | 984 Future loadLibrary() => new Future.value(); |
| OLD | NEW |