| 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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 var extension = getExtensionType(obj); | 754 var extension = getExtensionType(obj); |
| 755 if (extension != null) { | 755 if (extension != null) { |
| 756 return JS('String', '#[dartx.toString]()', obj); | 756 return JS('String', '#[dartx.toString]()', obj); |
| 757 } | 757 } |
| 758 if (JS('bool', 'typeof # == "function"', obj)) { | 758 if (JS('bool', 'typeof # == "function"', obj)) { |
| 759 return JS( | 759 return JS( |
| 760 'String', r'"Closure: " + # + " from: " + #', getReifiedType(obj), obj); | 760 'String', r'"Closure: " + # + " from: " + #', getReifiedType(obj), obj); |
| 761 } | 761 } |
| 762 // TODO(jmesserly): restore this faster path once ES Symbol is treated as | 762 // TODO(jmesserly): restore this faster path once ES Symbol is treated as |
| 763 // an extension type (and thus hits the above code path). | 763 // an extension type (and thus hits the above code path). |
| 764 // See https://github.com/dart-lang/dev_compiler/issues/578. | 764 // See https://github.com/dart-lang/sdk/issues/28323 |
| 765 // return JS('', '"" + #', obj); | 765 // return JS('', '"" + #', obj); |
| 766 return JS('String', '#.toString()', obj); | 766 return JS('String', '#.toString()', obj); |
| 767 } | 767 } |
| 768 | 768 |
| 769 // TODO(jmesserly): is the argument type verified statically? | 769 // TODO(jmesserly): is the argument type verified statically? |
| 770 noSuchMethod(obj, Invocation invocation) { | 770 noSuchMethod(obj, Invocation invocation) { |
| 771 if (obj == null || JS('bool', 'typeof # == "function"', obj)) { | 771 if (obj == null || JS('bool', 'typeof # == "function"', obj)) { |
| 772 throw new NoSuchMethodError(obj, invocation.memberName, | 772 throw new NoSuchMethodError(obj, invocation.memberName, |
| 773 invocation.positionalArguments, invocation.namedArguments); | 773 invocation.positionalArguments, invocation.namedArguments); |
| 774 } | 774 } |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 name = '+' + name; | 841 name = '+' + name; |
| 842 } | 842 } |
| 843 return name; | 843 return name; |
| 844 } | 844 } |
| 845 | 845 |
| 846 /// Emulates the implicit "loadLibrary" function provided by a deferred library. | 846 /// Emulates the implicit "loadLibrary" function provided by a deferred library. |
| 847 /// | 847 /// |
| 848 /// Libraries are not actually deferred in DDC, so this just returns a future | 848 /// Libraries are not actually deferred in DDC, so this just returns a future |
| 849 /// that completes immediately. | 849 /// that completes immediately. |
| 850 Future loadLibrary() => new Future.value(); | 850 Future loadLibrary() => new Future.value(); |
| OLD | NEW |