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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 case '_constructor': | 201 case '_constructor': |
202 case '_prototype': | 202 case '_prototype': |
203 return $name.substring(1); | 203 return $name.substring(1); |
204 } | 204 } |
205 } | 205 } |
206 return $name; | 206 return $name; |
207 })()'''); | 207 })()'''); |
208 | 208 |
209 Symbol _dartSymbol(name) { | 209 Symbol _dartSymbol(name) { |
210 return (JS('bool', 'typeof # === "symbol"', name)) | 210 return (JS('bool', 'typeof # === "symbol"', name)) |
211 ? JS('', '#(new #.es6(#, #))', const_, _internal.Symbol, | 211 ? JS('', '#(new #(#, #))', const_, _internal.PrivateSymbol, |
212 _toSymbolName(name), name) | 212 _toSymbolName(name), name) |
213 : JS('', '#(#.new(#))', const_, Symbol, _toDisplayName(name)); | 213 : JS('', '#(#.new(#))', const_, Symbol, _toDisplayName(name)); |
214 } | 214 } |
215 | 215 |
216 /// Extracts the named argument array from a list of arguments, and returns it. | 216 /// Extracts the named argument array from a list of arguments, and returns it. |
217 // TODO(jmesserly): we need to handle named arguments better. | 217 // TODO(jmesserly): we need to handle named arguments better. |
218 extractNamedArgs(args) { | 218 extractNamedArgs(args) { |
219 if (JS('bool', '#.length > 0', args)) { | 219 if (JS('bool', '#.length > 0', args)) { |
220 var last = JS('', '#[#.length - 1]', args, args); | 220 var last = JS('', '#[#.length - 1]', args, args); |
221 if (JS( | 221 if (JS( |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 name = '+' + name; | 967 name = '+' + name; |
968 } | 968 } |
969 return name; | 969 return name; |
970 } | 970 } |
971 | 971 |
972 /// Emulates the implicit "loadLibrary" function provided by a deferred library. | 972 /// Emulates the implicit "loadLibrary" function provided by a deferred library. |
973 /// | 973 /// |
974 /// Libraries are not actually deferred in DDC, so this just returns a future | 974 /// Libraries are not actually deferred in DDC, so this just returns a future |
975 /// that completes immediately. | 975 /// that completes immediately. |
976 Future loadLibrary() => new Future.value(); | 976 Future loadLibrary() => new Future.value(); |
OLD | NEW |