| 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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 static bool isPlainTypeName(TypeAnnotation typeAnnotation) { | 441 static bool isPlainTypeName(TypeAnnotation typeAnnotation) { |
| 442 if (typeAnnotation.typeName is !Identifier) return false; | 442 if (typeAnnotation.typeName is !Identifier) return false; |
| 443 if (typeAnnotation.typeArguments == null) return true; | 443 if (typeAnnotation.typeArguments == null) return true; |
| 444 if (typeAnnotation.typeArguments.isEmpty) return true; | 444 if (typeAnnotation.typeArguments.isEmpty) return true; |
| 445 return false; | 445 return false; |
| 446 } | 446 } |
| 447 | 447 |
| 448 static bool isDynamicType(TypeAnnotation typeAnnotation) { | 448 static bool isDynamicType(TypeAnnotation typeAnnotation) { |
| 449 if (!isPlainTypeName(typeAnnotation)) return false; | 449 if (!isPlainTypeName(typeAnnotation)) return false; |
| 450 String name = typeAnnotation.typeName.asIdentifier().source.slowToString(); | 450 String name = typeAnnotation.typeName.asIdentifier().source.slowToString(); |
| 451 // TODO(aprelev@gmail.com): Removed deprecated Dynamic keyword support. | 451 return name == 'dynamic'; |
| 452 return name == 'Dynamic' || name == 'dynamic'; | |
| 453 } | 452 } |
| 454 | 453 |
| 455 visitTypeAnnotation(TypeAnnotation node) { | 454 visitTypeAnnotation(TypeAnnotation node) { |
| 456 // Poor man generic variables resolution. | 455 // Poor man generic variables resolution. |
| 457 // TODO(antonm): get rid of it once resolver can deal with it. | 456 // TODO(antonm): get rid of it once resolver can deal with it. |
| 458 TypeDeclarationElement typeDeclarationElement; | 457 TypeDeclarationElement typeDeclarationElement; |
| 459 if (currentElement is TypeDeclarationElement) { | 458 if (currentElement is TypeDeclarationElement) { |
| 460 typeDeclarationElement = currentElement; | 459 typeDeclarationElement = currentElement; |
| 461 } else { | 460 } else { |
| 462 typeDeclarationElement = currentElement.getEnclosingClass(); | 461 typeDeclarationElement = currentElement.getEnclosingClass(); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 | 622 |
| 624 visitBlock(Block node) { | 623 visitBlock(Block node) { |
| 625 for (Node statement in node.statements.nodes) { | 624 for (Node statement in node.statements.nodes) { |
| 626 if (statement is VariableDefinitions) { | 625 if (statement is VariableDefinitions) { |
| 627 makeVarDeclarationTypePlaceholder(statement); | 626 makeVarDeclarationTypePlaceholder(statement); |
| 628 } | 627 } |
| 629 } | 628 } |
| 630 node.visitChildren(this); | 629 node.visitChildren(this); |
| 631 } | 630 } |
| 632 } | 631 } |
| OLD | NEW |