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

Side by Side Diff: pkg/compiler/lib/src/dart_backend/backend_ast_emitter.dart

Issue 911573002: dart2dart: Fix bad type annotation in backend_ast_emitter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase 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 backend_ast_emitter; 5 library backend_ast_emitter;
6 6
7 import '../tree_ir/tree_ir_nodes.dart' as tree; 7 import '../tree_ir/tree_ir_nodes.dart' as tree;
8 import 'backend_ast_nodes.dart'; 8 import 'backend_ast_nodes.dart';
9 import '../constants/expressions.dart'; 9 import '../constants/expressions.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 bool isSameVariable(Receiver e1, Receiver e2) { 427 bool isSameVariable(Receiver e1, Receiver e2) {
428 return e1 is Identifier && 428 return e1 is Identifier &&
429 e2 is Identifier && 429 e2 is Identifier &&
430 e1.element is VariableElement && 430 e1.element is VariableElement &&
431 e1.element == e2.element; 431 e1.element == e2.element;
432 } 432 }
433 433
434 Expression makeAssignment(Expression target, Expression value) { 434 Expression makeAssignment(Expression target, Expression value) {
435 // Try to print as compound assignment or increment 435 // Try to print as compound assignment or increment
436 if (value is BinaryOperator && isCompoundableOperator(value.operator)) { 436 if (value is BinaryOperator && isCompoundableOperator(value.operator)) {
437 Expression leftOperand = value.left; 437 Receiver leftOperand = value.left;
438 Expression rightOperand = value.right; 438 Expression rightOperand = value.right;
439 bool valid = false; 439 bool valid = false;
440 if (isSameVariable(target, leftOperand)) { 440 if (isSameVariable(target, leftOperand)) {
441 valid = true; 441 valid = true;
442 } else if (target is FieldExpression && 442 } else if (target is FieldExpression &&
443 leftOperand is FieldExpression && 443 leftOperand is FieldExpression &&
444 isSameVariable(target.object, leftOperand.object) && 444 isSameVariable(target.object, leftOperand.object) &&
445 target.fieldName == leftOperand.fieldName) { 445 target.fieldName == leftOperand.fieldName) {
446 valid = true; 446 valid = true;
447 } else if (target is IndexExpression && 447 } else if (target is IndexExpression &&
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 : super(name, ElementKind.VARIABLE, enclosingElement, variables, null); 1258 : super(name, ElementKind.VARIABLE, enclosingElement, variables, null);
1259 1259
1260 ExecutableElement get executableContext => enclosingElement; 1260 ExecutableElement get executableContext => enclosingElement;
1261 1261
1262 ExecutableElement get memberContext => executableContext.memberContext; 1262 ExecutableElement get memberContext => executableContext.memberContext;
1263 1263
1264 bool get isLocal => true; 1264 bool get isLocal => true;
1265 1265
1266 LibraryElement get implementationLibrary => enclosingElement.library; 1266 LibraryElement get implementationLibrary => enclosingElement.library;
1267 } 1267 }
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