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

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

Issue 747923003: Fix the new dart2dart backend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 : this.parent = parent, 70 : this.parent = parent,
71 usedVariableNames = parent.usedVariableNames; 71 usedVariableNames = parent.usedVariableNames;
72 72
73 FunctionExpression emit(tree.FunctionDefinition definition) { 73 FunctionExpression emit(tree.FunctionDefinition definition) {
74 functionElement = definition.element; 74 functionElement = definition.element;
75 75
76 Parameters parameters = emitRootParameters(definition); 76 Parameters parameters = emitRootParameters(definition);
77 77
78 // Declare parameters. 78 // Declare parameters.
79 for (tree.Variable param in definition.parameters) { 79 for (tree.Variable param in definition.parameters) {
80 getVariableName(param); 80 variableNames[param] = param.element.name;
81 usedVariableNames.add(param.element.name);
81 declaredVariables.add(param); 82 declaredVariables.add(param);
82 } 83 }
83 84
84 Statement body; 85 Statement body;
85 if (definition.isAbstract) { 86 if (definition.isAbstract) {
86 body = new EmptyStatement(); 87 body = new EmptyStatement();
87 } else { 88 } else {
88 firstStatement = definition.body; 89 firstStatement = definition.body;
89 visitStatement(definition.body); 90 visitStatement(definition.body);
90 removeTrailingReturn(); 91 removeTrailingReturn();
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 : super(name, ElementKind.VARIABLE, enclosingElement, variables, null); 910 : super(name, ElementKind.VARIABLE, enclosingElement, variables, null);
910 911
911 ExecutableElement get executableContext => enclosingElement; 912 ExecutableElement get executableContext => enclosingElement;
912 913
913 ExecutableElement get memberContext => executableContext.memberContext; 914 ExecutableElement get memberContext => executableContext.memberContext;
914 915
915 bool get isLocal => true; 916 bool get isLocal => true;
916 917
917 LibraryElement get implementationLibrary => enclosingElement.library; 918 LibraryElement get implementationLibrary => enclosingElement.library;
918 } 919 }
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