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

Side by Side Diff: pkg/compiler/lib/src/js_backend/codegen/codegen.dart

Issue 881073004: Fix merge error: Call visitExpression instead of visit. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library code_generator; 5 library code_generator;
6 6
7 import 'glue.dart'; 7 import 'glue.dart';
8 8
9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir; 9 import '../../tree_ir/tree_ir_nodes.dart' as tree_ir;
10 import '../../js/js.dart' as js; 10 import '../../js/js.dart' as js;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 js.Expression visitConcatenateStrings(tree_ir.ConcatenateStrings node) { 137 js.Expression visitConcatenateStrings(tree_ir.ConcatenateStrings node) {
138 js.Expression addStrings(js.Expression left, js.Expression right) { 138 js.Expression addStrings(js.Expression left, js.Expression right) {
139 return new js.Binary('+', left, right); 139 return new js.Binary('+', left, right);
140 } 140 }
141 141
142 js.Expression toString(tree_ir.Expression input) { 142 js.Expression toString(tree_ir.Expression input) {
143 bool useDirectly = input is tree_ir.Constant && 143 bool useDirectly = input is tree_ir.Constant &&
144 (input.expression.value.isString || 144 (input.expression.value.isString ||
145 input.expression.value.isInt || 145 input.expression.value.isInt ||
146 input.expression.value.isBool); 146 input.expression.value.isBool);
147 js.Expression value = visit(input); 147 js.Expression value = visitExpression(input);
148 if (useDirectly) { 148 if (useDirectly) {
149 return value; 149 return value;
150 } else { 150 } else {
151 Element convertToString = glue.getStringConversion(); 151 Element convertToString = glue.getStringConversion();
152 registry.registerStaticUse(convertToString); 152 registry.registerStaticUse(convertToString);
153 js.Expression access = glue.staticFunctionAccess(convertToString); 153 js.Expression access = glue.staticFunctionAccess(convertToString);
154 return (new js.Call(access, <js.Expression>[value])); 154 return (new js.Call(access, <js.Expression>[value]));
155 } 155 }
156 } 156 }
157 157
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 void visitSetField(tree_ir.SetField node) { 535 void visitSetField(tree_ir.SetField node) {
536 js.PropertyAccess field = 536 js.PropertyAccess field =
537 new js.PropertyAccess.field( 537 new js.PropertyAccess.field(
538 visitExpression(node.object), 538 visitExpression(node.object),
539 glue.instanceFieldPropertyName(node.field)); 539 glue.instanceFieldPropertyName(node.field));
540 js.Assignment asn = new js.Assignment(field, visitExpression(node.value)); 540 js.Assignment asn = new js.Assignment(field, visitExpression(node.value));
541 accumulator.add(new js.ExpressionStatement(asn)); 541 accumulator.add(new js.ExpressionStatement(asn));
542 visitStatement(node.next); 542 visitStatement(node.next);
543 } 543 }
544 } 544 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698