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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 if (names.length == 0) return false; | 67 if (names.length == 0) return false; |
68 for (var name of names) { | 68 for (var name of names) { |
69 if (!($hasOwnProperty.call($type.named, name))) { | 69 if (!($hasOwnProperty.call($type.named, name))) { |
70 return false; | 70 return false; |
71 } | 71 } |
72 if (!$instanceOfOrNull(opts[name], $type.named[name])) return false; | 72 if (!$instanceOfOrNull(opts[name], $type.named[name])) return false; |
73 } | 73 } |
74 return true; | 74 return true; |
75 })()'''); | 75 })()'''); |
76 | 76 |
| 77 _dartSymbol(name) => JS('', ''' |
| 78 $const_($Symbol.new($name.toString())) |
| 79 '''); |
77 | 80 |
78 throwNoSuchMethod(obj, name, pArgs, nArgs, extras) => JS('', '''(() => { | 81 throwNoSuchMethod(obj, name, pArgs, nArgs, extras) => JS('', '''(() => { |
79 $throw_(new $NoSuchMethodError($obj, $name, $pArgs, $nArgs, $extras)); | 82 $throw_(new $NoSuchMethodError($obj, $_dartSymbol($name), $pArgs, $nArgs, $ext
ras)); |
80 })()'''); | 83 })()'''); |
81 | 84 |
82 throwNoSuchMethodFunc(obj, name, pArgs, opt_func) => JS('', '''(() => { | 85 throwNoSuchMethodFunc(obj, name, pArgs, opt_func) => JS('', '''(() => { |
83 if ($obj === void 0) $obj = $opt_func; | 86 if ($obj === void 0) $obj = $opt_func; |
84 $throwNoSuchMethod($obj, $name, $pArgs); | 87 $throwNoSuchMethod($obj, $name, $pArgs); |
85 })()'''); | 88 })()'''); |
86 | 89 |
87 checkAndCall(f, ftype, obj, args, name) => JS('', '''(() => { | 90 checkAndCall(f, ftype, obj, args, name) => JS('', '''(() => { |
88 let originalFunction = $f; | 91 let originalFunction = $f; |
89 if (!($f instanceof Function)) { | 92 if (!($f instanceof Function)) { |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 constructor(dartIterator) { | 425 constructor(dartIterator) { |
423 this.dartIterator = dartIterator; | 426 this.dartIterator = dartIterator; |
424 } | 427 } |
425 next() { | 428 next() { |
426 let i = this.dartIterator; | 429 let i = this.dartIterator; |
427 let done = !i.moveNext(); | 430 let done = !i.moveNext(); |
428 return { done: done, value: done ? void 0 : i.current }; | 431 return { done: done, value: done ? void 0 : i.current }; |
429 } | 432 } |
430 } | 433 } |
431 '''); | 434 '''); |
OLD | NEW |