Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Unified Diff: frog/member.dart

Issue 9465041: Better mangling in frog for fixing parts of issue 1837. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/leg/ssa/js_names.dart ('k') | frog/member_set.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « frog/leg/ssa/js_names.dart ('k') | frog/member_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698