Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 part of dart_backend; | 5 part of dart_backend; |
| 6 | 6 |
| 7 class LocalPlaceholder { | 7 class LocalPlaceholder { |
| 8 final String identifier; | 8 final String identifier; |
| 9 final Set<Node> nodes; | 9 final Set<Node> nodes; |
| 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); | 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 358 | 358 |
| 359 visitNode(Node node) { node.visitChildren(this); } // We must go deeper. | 359 visitNode(Node node) { node.visitChildren(this); } // We must go deeper. |
| 360 | 360 |
| 361 visitNewExpression(NewExpression node) { | 361 visitNewExpression(NewExpression node) { |
| 362 Send send = node.send; | 362 Send send = node.send; |
| 363 InterfaceType type = treeElements.getType(node); | 363 InterfaceType type = treeElements.getType(node); |
| 364 assert(type != null); | 364 assert(type != null); |
| 365 Element constructor = treeElements[send]; | 365 Element constructor = treeElements[send]; |
| 366 assert(constructor != null); | 366 assert(constructor != null); |
| 367 assert(send.receiver == null); | 367 assert(send.receiver == null); |
| 368 if (constructor is !ErroneousElement) { | 368 if (!Elements.isErroneousElement(constructor) && |
|
ngeoffray
2012/11/27 09:37:35
Can that be !Elements.isUnresolved(constructor) ?
aam-me
2012/11/28 01:49:47
Yes, good idea!
| |
| 369 !Elements.isMalformedElement(constructor)) { | |
| 369 makeConstructorPlaceholder(node.send.selector, constructor, type); | 370 makeConstructorPlaceholder(node.send.selector, constructor, type); |
| 370 // TODO(smok): Should this be in visitNamedArgument? | 371 // TODO(smok): Should this be in visitNamedArgument? |
| 371 // Field names can be exposed as names of optional arguments, e.g. | 372 // Field names can be exposed as names of optional arguments, e.g. |
| 372 // class C { | 373 // class C { |
| 373 // final field; | 374 // final field; |
| 374 // C([this.field]); | 375 // C([this.field]); |
| 375 // } | 376 // } |
| 376 // Do not forget to rename them as well. | 377 // Do not forget to rename them as well. |
| 377 FunctionElement constructorFunction = constructor; | 378 FunctionElement constructorFunction = constructor; |
| 378 Link<Element> optionalParameters = | 379 Link<Element> optionalParameters = |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 615 | 616 |
| 616 visitBlock(Block node) { | 617 visitBlock(Block node) { |
| 617 for (Node statement in node.statements.nodes) { | 618 for (Node statement in node.statements.nodes) { |
| 618 if (statement is VariableDefinitions) { | 619 if (statement is VariableDefinitions) { |
| 619 makeVarDeclarationTypePlaceholder(statement); | 620 makeVarDeclarationTypePlaceholder(statement); |
| 620 } | 621 } |
| 621 } | 622 } |
| 622 node.visitChildren(this); | 623 node.visitChildren(this); |
| 623 } | 624 } |
| 624 } | 625 } |
| OLD | NEW |