OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 class MemberSet { | 5 class MemberSet { |
6 final String name; | 6 final String name; |
7 final List<Member> members; | 7 final List<Member> members; |
8 final String jsname; | 8 final String jsname; |
9 final bool isVar; | 9 final bool isVar; |
10 | 10 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 if (name == ':index') { | 168 if (name == ':index') { |
169 world.gen.corejs.useIndex = true; | 169 world.gen.corejs.useIndex = true; |
170 } else if (name == ':setindex') { | 170 } else if (name == ':setindex') { |
171 world.gen.corejs.useSetIndex = true; | 171 world.gen.corejs.useSetIndex = true; |
172 } | 172 } |
173 return new Value(returnType, '${target.code}.$jsname($argsString)', | 173 return new Value(returnType, '${target.code}.$jsname($argsString)', |
174 target.span); | 174 target.span); |
175 } else { | 175 } else { |
176 if (argsString.length > 0) argsString = ', $argsString'; | 176 if (argsString.length > 0) argsString = ', $argsString'; |
177 world.gen.corejs.useOperator(name); | 177 world.gen.corejs.useOperator(name); |
178 return new Value(returnType, '\$$jsname(${target.code}$argsString)', | 178 return new Value(returnType, '$jsname\$(${target.code}$argsString)', |
179 target.span); | 179 target.span); |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 Value invokeOnVar(CallingContext context, Node node, Value target, | 183 Value invokeOnVar(CallingContext context, Node node, Value target, |
184 Arguments args) { | 184 Arguments args) { |
185 context.counters.dynamicMethodCalls++; | 185 context.counters.dynamicMethodCalls++; |
186 | 186 |
187 var member = getVarMember(context, node, args); | 187 var member = getVarMember(context, node, args); |
188 return member.invoke(context, node, target, args); | 188 return member.invoke(context, node, target, args); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 returnType = world.varType; | 290 returnType = world.varType; |
291 } | 291 } |
292 } | 292 } |
293 } | 293 } |
294 if (returnType == null) { | 294 if (returnType == null) { |
295 // TODO(jimhug): Warning here for no match anywhere in the world? | 295 // TODO(jimhug): Warning here for no match anywhere in the world? |
296 returnType = world.varType; | 296 returnType = world.varType; |
297 } | 297 } |
298 } | 298 } |
299 } | 299 } |
OLD | NEW |