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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart

Issue 231863007: Support local variables in dart2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated review comments. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
index a4d1f1f97ce428181685198bd00b56e913ec9fdb..e5d3e36b76a50581a9bcf57e5a1dd156fd8b1a69 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/backend.dart
@@ -236,14 +236,18 @@ class DartBackend extends Backend {
ir.FunctionDefinition function = compiler.irBuilder.getIr(element);
tree.Builder builder = new tree.Builder(compiler);
tree.FunctionDefinition definition = builder.build(function);
- compiler.tracer.traceCompilation(element.name, null, compiler);
- compiler.tracer.traceGraph('Tree builder', definition);
- treeElements = new TreeElementMapping(element);
- tree.Unnamer unnamer = new tree.Unnamer();
- unnamer.unname(definition);
- compiler.tracer.traceGraph('Unnamer', definition);
- tree.Emitter emitter = new tree.Emitter();
- node = emitter.emit(element, treeElements, definition);
+ if (definition == null) {
+ node = element.parseNode(compiler);
+ } else {
+ compiler.tracer.traceCompilation(element.name, null, compiler);
+ compiler.tracer.traceGraph('Tree builder', definition);
+ treeElements = new TreeElementMapping(element);
+ tree.Unnamer unnamer = new tree.Unnamer();
+ unnamer.unname(definition);
+ compiler.tracer.traceGraph('Unnamer', definition);
+ tree.Emitter emitter = new tree.Emitter();
+ node = emitter.emit(element, treeElements, definition);
+ }
}
return new ElementAst(node, treeElements);
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_backend/dart_tree.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698