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

Side by Side Diff: lib/src/codegen/js_codegen.dart

Issue 1039243002: fix temp used in postfix ops (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « lib/runtime/dart/core.js ('k') | test/codegen/expect/server_mode/html_input.html » ('j') | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dev_compiler.src.codegen.js_codegen; 5 library dev_compiler.src.codegen.js_codegen;
6 6
7 import 'dart:collection' show HashSet, HashMap; 7 import 'dart:collection' show HashSet, HashMap;
8 import 'dart:io' show Directory, File; 8 import 'dart:io' show Directory, File;
9 9
10 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; 10 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator;
(...skipping 1502 matching lines...) Expand 10 before | Expand all | Expand 10 after
1513 1513
1514 // Increment and write 1514 // Increment and write
1515 var one = AstBuilder.integerLiteral(1); 1515 var one = AstBuilder.integerLiteral(1);
1516 one.staticType = rules.provider.intType; 1516 one.staticType = rules.provider.intType;
1517 var increment = AstBuilder.binaryExpression(tmp, op.lexeme[0], one); 1517 var increment = AstBuilder.binaryExpression(tmp, op.lexeme[0], one);
1518 increment.staticType = type; 1518 increment.staticType = type;
1519 var write = _emitAssignment(expr, increment); 1519 var write = _emitAssignment(expr, increment);
1520 1520
1521 var bindThis = _maybeBindThis(expr); 1521 var bindThis = _maybeBindThis(expr);
1522 return js.call("((#) => (#, #))$bindThis(#)", [ 1522 return js.call("((#) => (#, #))$bindThis(#)", [
1523 tmp.name, 1523 _visit(tmp),
1524 write, 1524 write,
1525 _visit(tmp), 1525 _visit(tmp),
1526 _visit(expr) 1526 _visit(expr)
1527 ]); 1527 ]);
1528 } 1528 }
1529 1529
1530 @override 1530 @override
1531 JS.Expression visitPostfixExpression(PostfixExpression node) { 1531 JS.Expression visitPostfixExpression(PostfixExpression node) {
1532 var op = node.operator; 1532 var op = node.operator;
1533 var expr = node.operand; 1533 var expr = node.operand;
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
2329 2329
2330 // TODO(jmesserly): in many cases marking the end will be unncessary. 2330 // TODO(jmesserly): in many cases marking the end will be unncessary.
2331 printer.mark(_location(node.end)); 2331 printer.mark(_location(node.end));
2332 } 2332 }
2333 2333
2334 String _getIdentifier(AstNode node) { 2334 String _getIdentifier(AstNode node) {
2335 if (node is SimpleIdentifier) return node.name; 2335 if (node is SimpleIdentifier) return node.name;
2336 return null; 2336 return null;
2337 } 2337 }
2338 } 2338 }
OLDNEW
« no previous file with comments | « lib/runtime/dart/core.js ('k') | test/codegen/expect/server_mode/html_input.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698