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

Side by Side Diff: lib/compiler/implementation/resolver.dart

Issue 11086045: Revert "Allow closures inside lazy initializers." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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 | « lib/compiler/implementation/closure.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 abstract class TreeElements { 5 abstract class TreeElements {
6 Element operator[](Node node); 6 Element operator[](Node node);
7 Selector getSelector(Send send); 7 Selector getSelector(Send send);
8 DartType getType(TypeAnnotation annotation); 8 DartType getType(TypeAnnotation annotation);
9 bool isParameterChecked(Element element); 9 bool isParameterChecked(Element element);
10 } 10 }
(...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after
1365 } 1365 }
1366 1366
1367 visitFunctionExpression(FunctionExpression node) { 1367 visitFunctionExpression(FunctionExpression node) {
1368 visit(node.returnType); 1368 visit(node.returnType);
1369 SourceString name; 1369 SourceString name;
1370 if (node.name === null) { 1370 if (node.name === null) {
1371 name = const SourceString(""); 1371 name = const SourceString("");
1372 } else { 1372 } else {
1373 name = node.name.asIdentifier().source; 1373 name = node.name.asIdentifier().source;
1374 } 1374 }
1375 if (scope.element.kind == ElementKind.VARIABLE_LIST) {
1376 compiler.internalError("Bad enclosing element", node: node);
1377 }
1378 FunctionElement enclosing = new FunctionElement.node( 1375 FunctionElement enclosing = new FunctionElement.node(
1379 name, node, ElementKind.FUNCTION, Modifiers.EMPTY, 1376 name, node, ElementKind.FUNCTION, Modifiers.EMPTY,
1380 scope.element); 1377 scope.element);
1381 setupFunction(node, enclosing); 1378 setupFunction(node, enclosing);
1382 defineElement(node, enclosing, doAddToScope: node.name !== null); 1379 defineElement(node, enclosing, doAddToScope: node.name !== null);
1383 1380
1384 // Run the body in a fresh statement scope. 1381 // Run the body in a fresh statement scope.
1385 StatementScope oldScope = statementScope; 1382 StatementScope oldScope = statementScope;
1386 statementScope = new StatementScope(); 1383 statementScope = new StatementScope();
1387 visit(node.body); 1384 visit(node.body);
(...skipping 1754 matching lines...) Expand 10 before | Expand all | Expand 10 after
3142 return result; 3139 return result;
3143 } 3140 }
3144 Element lookup(SourceString name) => localLookup(name); 3141 Element lookup(SourceString name) => localLookup(name);
3145 Element lexicalLookup(SourceString name) => localLookup(name); 3142 Element lexicalLookup(SourceString name) => localLookup(name);
3146 3143
3147 Element add(Element newElement) { 3144 Element add(Element newElement) {
3148 throw "Cannot add an element in a patch library scope"; 3145 throw "Cannot add an element in a patch library scope";
3149 } 3146 }
3150 String toString() => 'PatchLibraryScope($origin,$patch)'; 3147 String toString() => 'PatchLibraryScope($origin,$patch)';
3151 } 3148 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/closure.dart ('k') | lib/compiler/implementation/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698