| 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 bool isVar; | 8 final bool isVar; |
| 9 String jsname; | 9 String jsname; |
| 10 | 10 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // The member we're adding is a method that needs argument | 261 // The member we're adding is a method that needs argument |
| 262 // conversion, so we have to make it go through the var call | 262 // conversion, so we have to make it go through the var call |
| 263 // path to get the correct type checks inserted. | 263 // path to get the correct type checks inserted. |
| 264 needsVarCall = true; | 264 needsVarCall = true; |
| 265 } else if (member.jsname != members[0].jsname) { | 265 } else if (member.jsname != members[0].jsname) { |
| 266 // If the jsnames differ we need the var call since one of the stubs | 266 // If the jsnames differ we need the var call since one of the stubs |
| 267 // will change the name. Native methods can have different jsnames, | 267 // will change the name. Native methods can have different jsnames, |
| 268 // e.g. | 268 // e.g. |
| 269 // foo() native 'bar'; | 269 // foo() native 'bar'; |
| 270 needsVarCall = true; | 270 needsVarCall = true; |
| 271 } else if (member.library == world.dom) { | 271 } else if (member.library.isDomOrHtml) { |
| 272 // TODO(jimhug): Egregious hack for isolates + DOM - see | 272 // TODO(jimhug): Egregious hack for isolates + DOM - see |
| 273 // Value._maybeWrapFunction for more details. | 273 // Value._maybeWrapFunction for more details. |
| 274 for (var p in member.parameters) { | 274 for (var p in member.parameters) { |
| 275 if (p.type.getCallMethod() != null) { | 275 if (p.type.getCallMethod() != null) { |
| 276 needsVarCall = true; | 276 needsVarCall = true; |
| 277 } | 277 } |
| 278 } | 278 } |
| 279 } | 279 } |
| 280 | 280 |
| 281 // TODO(jimhug): Should create a less specific version of args. | 281 // TODO(jimhug): Should create a less specific version of args. |
| 282 if (member.canInvoke(context, args)) { | 282 if (member.canInvoke(context, args)) { |
| 283 if (member.isMethod) { | 283 if (member.isMethod) { |
| 284 returnType = MemberSet.unionTypes(returnType, member.returnType); | 284 returnType = MemberSet.unionTypes(returnType, member.returnType); |
| 285 member.declaringType.genMethod(member); | 285 member.declaringType.genMethod(member); |
| 286 } else { | 286 } else { |
| 287 needsVarCall = true; | 287 needsVarCall = true; |
| 288 returnType = world.varType; | 288 returnType = world.varType; |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 if (returnType == null) { | 292 if (returnType == null) { |
| 293 // TODO(jimhug): Warning here for no match anywhere in the world? | 293 // TODO(jimhug): Warning here for no match anywhere in the world? |
| 294 returnType = world.varType; | 294 returnType = world.varType; |
| 295 } | 295 } |
| 296 } | 296 } |
| 297 } | 297 } |
| OLD | NEW |