| Index: pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
|
| diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
|
| index 1b1e100af716ec511c691d98b5ce18a86a2281c5..eeff7d55f5d24553711b3a65b839e9d5d0baf115 100644
|
| --- a/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
|
| +++ b/pkg/compiler/lib/src/js_emitter/old_emitter/container_builder.dart
|
| @@ -12,16 +12,16 @@ class ContainerBuilder extends CodeEmitterHelper {
|
|
|
| void addMemberMethod(DartMethod method, ClassBuilder builder) {
|
| MethodElement member = method.element;
|
| - String name = method.name;
|
| + jsAst.Name name = method.name;
|
| FunctionSignature parameters = member.functionSignature;
|
| jsAst.Expression code = method.code;
|
| bool needsStubs = method.parameterStubs.isNotEmpty;
|
| bool canBeApplied = method.canBeApplied;
|
| bool canBeReflected = method.canBeReflected;
|
| bool canTearOff = method.needsTearOff;
|
| - String tearOffName = method.tearOffName;
|
| + jsAst.Name tearOffName = method.tearOffName;
|
| bool isClosure = method is InstanceMethod && method.isClosure;
|
| - String superAlias = method is InstanceMethod ? method.aliasName : null;
|
| + jsAst.Name superAlias = method is InstanceMethod ? method.aliasName : null;
|
| bool hasSuperAlias = superAlias != null;
|
| jsAst.Expression memberTypeExpression = method.functionType;
|
|
|
| @@ -77,7 +77,7 @@ class ContainerBuilder extends CodeEmitterHelper {
|
|
|
| // Create the optional aliasing entry if this method is called via super.
|
| if (hasSuperAlias) {
|
| - expressions.add(new jsAst.LiteralString('"${superAlias}"'));
|
| + expressions.add(js.quoteName(superAlias));
|
| }
|
|
|
| expressions.add(code);
|
| @@ -93,9 +93,11 @@ class ContainerBuilder extends CodeEmitterHelper {
|
| return;
|
| }
|
|
|
| - String callSelectorString = 'null';
|
| - if (method.callName != null) {
|
| - callSelectorString = '"${method.callName}"';
|
| + jsAst.Literal callSelectorString;
|
| + if (method.callName == null) {
|
| + callSelectorString = new jsAst.LiteralNull();
|
| + } else {
|
| + callSelectorString = js.quoteName(method.callName);
|
| }
|
|
|
| // On [requiredParameterCount], the lower bit is set if this method can be
|
| @@ -106,27 +108,27 @@ class ContainerBuilder extends CodeEmitterHelper {
|
| int optionalParameterCount = parameters.optionalParameterCount << 1;
|
| if (parameters.optionalParametersAreNamed) optionalParameterCount++;
|
|
|
| - // TODO(sra): Don't use LiteralString for non-strings.
|
| - List tearOffInfo = [new jsAst.LiteralString(callSelectorString)];
|
| + List tearOffInfo = [callSelectorString];
|
|
|
| for (ParameterStubMethod stub in method.parameterStubs) {
|
| - String invocationName = stub.name;
|
| + jsAst.Name invocationName = stub.name;
|
| emitter.interceptorEmitter
|
| .recordMangledNameOfMemberMethod(member, invocationName);
|
|
|
| expressions.add(stub.code);
|
| if (member.isInstanceMember) {
|
| - expressions.add(js.string(invocationName));
|
| + expressions.add(js.quoteName(invocationName));
|
| }
|
| - String callName = stub.callName;
|
| - String callSelectorString = (callName == null) ? 'null' : '"$callName"';
|
| - tearOffInfo.add(new jsAst.LiteralString(callSelectorString));
|
| + jsAst.Name callName = stub.callName;
|
| + jsAst.Literal callSelectorString =
|
| + (callName == null) ? new jsAst.LiteralNull() : js.quoteName(callName);
|
| + tearOffInfo.add(callSelectorString);
|
| }
|
|
|
| expressions
|
| ..addAll(tearOffInfo)
|
| ..add((tearOffName == null || member.isAccessor)
|
| - ? js("null") : js.string(tearOffName))
|
| + ? js("null") : js.quoteName(tearOffName))
|
| ..add(js.number(requiredParameterCount))
|
| ..add(js.number(optionalParameterCount))
|
| ..add(memberTypeExpression == null ? js("null") : memberTypeExpression)
|
|
|