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

Side by Side Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 2925263002: A step towards handling `new Object()` in compile_from_dill_test (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 elements.modelx; 5 library elements.modelx;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart' show Identifiers; 8 import '../common/names.dart' show Identifiers;
9 import '../common/resolution.dart' show Resolution, ParsingContext; 9 import '../common/resolution.dart' show Resolution, ParsingContext;
10 import '../compiler.dart' show Compiler; 10 import '../compiler.dart' show Compiler;
(...skipping 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 constructorResolvedAst.element.implementation; 2476 constructorResolvedAst.element.implementation;
2477 assert(constructor.isGenerativeConstructor); 2477 assert(constructor.isGenerativeConstructor);
2478 if (constructorResolvedAst.kind != ResolvedAstKind.PARSED) return null; 2478 if (constructorResolvedAst.kind != ResolvedAstKind.PARSED) return null;
2479 2479
2480 FunctionExpression node = constructorResolvedAst.node; 2480 FunctionExpression node = constructorResolvedAst.node;
2481 // If we know the body doesn't have any code, we don't generate it. 2481 // If we know the body doesn't have any code, we don't generate it.
2482 if (!node.hasBody) return null; 2482 if (!node.hasBody) return null;
2483 if (node.hasEmptyBody) return null; 2483 if (node.hasEmptyBody) return null;
2484 ClassElement classElement = constructor.enclosingClass; 2484 ClassElement classElement = constructor.enclosingClass;
2485 ConstructorBodyElement bodyElement; 2485 ConstructorBodyElement bodyElement;
2486 classElement.forEachBackendMember((Element backendMember) { 2486 classElement.forEachBackendMember((ConstructorBodyElement body) {
2487 if (backendMember.isGenerativeConstructorBody) { 2487 if (body.constructor == constructor) {
2488 ConstructorBodyElement body = backendMember; 2488 // TODO(kasperl): Find a way of stopping the iteration
2489 if (body.constructor == constructor) { 2489 // through the backend members.
2490 // TODO(kasperl): Find a way of stopping the iteration 2490 bodyElement = body;
2491 // through the backend members.
2492 bodyElement = backendMember;
2493 }
2494 } 2491 }
2495 }); 2492 });
2496 if (bodyElement == null) { 2493 if (bodyElement == null) {
2497 bodyElement = 2494 bodyElement =
2498 new ConstructorBodyElementX(constructorResolvedAst, constructor); 2495 new ConstructorBodyElementX(constructorResolvedAst, constructor);
2499 classElement.addBackendMember(bodyElement); 2496 classElement.addBackendMember(bodyElement);
2500 2497
2501 if (constructor.isPatch) { 2498 if (constructor.isPatch) {
2502 // Create origin body element for patched constructors. 2499 // Create origin body element for patched constructors.
2503 ConstructorBodyElementX patch = bodyElement; 2500 ConstructorBodyElementX patch = bodyElement;
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
3517 body = node.asFunctionExpression().body; 3514 body = node.asFunctionExpression().body;
3518 } 3515 }
3519 return new ParsedResolvedAst( 3516 return new ParsedResolvedAst(
3520 declaration, 3517 declaration,
3521 node, 3518 node,
3522 body, 3519 body,
3523 definingElement.treeElements, 3520 definingElement.treeElements,
3524 definingElement.compilationUnit.script.resourceUri); 3521 definingElement.compilationUnit.script.resourceUri);
3525 } 3522 }
3526 } 3523 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698