| 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 _canonicalFieldName(obj, name, args, displayName) => JS('', '''(() => { | 9 _canonicalFieldName(obj, name, args, displayName) => JS('', '''(() => { |
| 10 $name = $canonicalMember($obj, $name); | 10 $name = $canonicalMember($obj, $name); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 if ($typeArgs == null) { | 123 if ($typeArgs == null) { |
| 124 $typeArgs = Array(formalCount).fill($dynamic); | 124 $typeArgs = Array(formalCount).fill($dynamic); |
| 125 } else if ($typeArgs.length != formalCount) { | 125 } else if ($typeArgs.length != formalCount) { |
| 126 // TODO(jmesserly): is this the right error? | 126 // TODO(jmesserly): is this the right error? |
| 127 $throwStrongModeError( | 127 $throwStrongModeError( |
| 128 'incorrect number of arguments to generic function ' + | 128 'incorrect number of arguments to generic function ' + |
| 129 $typeName($ftype) + ', got <' + $typeArgs + '> expected ' + | 129 $typeName($ftype) + ', got <' + $typeArgs + '> expected ' + |
| 130 formalCount + '.'); | 130 formalCount + '.'); |
| 131 } | 131 } |
| 132 // Instantiate the function. | 132 // Instantiate the function. |
| 133 $ftype = $ftype(...$typeArgs); | 133 $ftype = $ftype.apply(null, $typeArgs); |
| 134 } else if ($typeArgs != null) { | 134 } else if ($typeArgs != null) { |
| 135 $throwStrongModeError( | 135 $throwStrongModeError( |
| 136 'got type arguments to non-generic function ' + $typeName($ftype) + | 136 'got type arguments to non-generic function ' + $typeName($ftype) + |
| 137 ', got <' + $typeArgs + '> expected none.'); | 137 ', got <' + $typeArgs + '> expected none.'); |
| 138 } | 138 } |
| 139 | 139 |
| 140 if ($_checkApply($ftype, $args)) { | 140 if ($_checkApply($ftype, $args)) { |
| 141 if ($typeArgs != null) { | 141 if ($typeArgs != null) { |
| 142 return $f.apply($obj, $typeArgs).apply($obj, $args); | 142 return $f.apply($obj, $typeArgs).apply($obj, $args); |
| 143 } | 143 } |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 constructor(dartIterator) { | 504 constructor(dartIterator) { |
| 505 this.dartIterator = dartIterator; | 505 this.dartIterator = dartIterator; |
| 506 } | 506 } |
| 507 next() { | 507 next() { |
| 508 let i = this.dartIterator; | 508 let i = this.dartIterator; |
| 509 let done = !i.moveNext(); | 509 let done = !i.moveNext(); |
| 510 return { done: done, value: done ? void 0 : i.current }; | 510 return { done: done, value: done ? void 0 : i.current }; |
| 511 } | 511 } |
| 512 } | 512 } |
| 513 '''); | 513 '''); |
| OLD | NEW |