Index: frog/member.dart |
=================================================================== |
--- frog/member.dart (revision 4594) |
+++ frog/member.dart (working copy) |
@@ -89,7 +89,11 @@ |
Member(String name, Type declaringType) |
: this.declaringType = declaringType, |
- super(name, declaringType); |
+ super(name, declaringType) { |
+ if (_jsname != null && declaringType.isTop) { |
+ _jsname = JsNames.getValid(_jsname); |
+ } |
+ } |
abstract bool get isStatic(); |
abstract Type get returnType(); |
@@ -1148,7 +1152,7 @@ |
} else if (args.length == 1 && args.values[0].type.isNum) { |
if (name == ':truncdiv' || name == ':mod') { |
world.gen.corejs.useOperator(name); |
- code = '\$$jsname(${target.code}, ${argsCode[0]})'; |
+ code = '$jsname\$(${target.code}, ${argsCode[0]})'; |
} else { |
var op = TokenKind.rawOperatorFromMethod(name); |
code = '${target.code} $op ${argsCode[0]}'; |
@@ -1197,7 +1201,7 @@ |
world.gen.corejs.useOperator(name); |
// TODO(jimhug): Should be able to use faster path sometimes here! |
return new Value(inferredResult, |
- '\$$jsname(${target.code}, ${argsCode[0]})', node.span); |
+ '$jsname\$(${target.code}, ${argsCode[0]})', node.span); |
} |
if (isCallMethod) { |
@@ -1214,7 +1218,7 @@ |
} else { |
world.gen.corejs.useOperator(name); |
var argsString = argsCode.length == 0 ? '' : ', ${argsCode[0]}'; |
- return new Value(returnType, '\$$jsname(${target.code}${argsString})', |
+ return new Value(returnType, '$jsname\$(${target.code}${argsString})', |
node.span); |
} |