| 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 class LocalPlaceholder { | 5 class LocalPlaceholder { |
| 6 final String identifier; | 6 final String identifier; |
| 7 final Set<Node> nodes; | 7 final Set<Node> nodes; |
| 8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); | 8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); |
| 9 int hashCode() => identifier.hashCode(); | 9 int hashCode() => identifier.hashCode(); |
| 10 String toString() => | 10 String toString() => |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 static bool isPlainTypeName(TypeAnnotation typeAnnotation) { | 415 static bool isPlainTypeName(TypeAnnotation typeAnnotation) { |
| 416 if (typeAnnotation.typeName is !Identifier) return false; | 416 if (typeAnnotation.typeName is !Identifier) return false; |
| 417 if (typeAnnotation.typeArguments === null) return true; | 417 if (typeAnnotation.typeArguments === null) return true; |
| 418 if (typeAnnotation.typeArguments.length === 0) return true; | 418 if (typeAnnotation.typeArguments.length === 0) return true; |
| 419 return false; | 419 return false; |
| 420 } | 420 } |
| 421 | 421 |
| 422 static bool isDynamicType(TypeAnnotation typeAnnotation) { | 422 static bool isDynamicType(TypeAnnotation typeAnnotation) { |
| 423 if (!isPlainTypeName(typeAnnotation)) return false; | 423 if (!isPlainTypeName(typeAnnotation)) return false; |
| 424 String name = typeAnnotation.typeName.asIdentifier().source.slowToString(); | 424 String name = typeAnnotation.typeName.asIdentifier().source.slowToString(); |
| 425 return name == 'Dynamic'; | 425 // TODO(aprelev@gmail.com): Removed deprecated Dynamic keyword support. |
| 426 return name == 'Dynamic' || name == 'dynamic'; |
| 426 } | 427 } |
| 427 | 428 |
| 428 visitTypeAnnotation(TypeAnnotation node) { | 429 visitTypeAnnotation(TypeAnnotation node) { |
| 429 // Poor man generic variables resolution. | 430 // Poor man generic variables resolution. |
| 430 // TODO(antonm): get rid of it once resolver can deal with it. | 431 // TODO(antonm): get rid of it once resolver can deal with it. |
| 431 TypeDeclarationElement typeDeclarationElement; | 432 TypeDeclarationElement typeDeclarationElement; |
| 432 if (currentElement is TypeDeclarationElement) { | 433 if (currentElement is TypeDeclarationElement) { |
| 433 typeDeclarationElement = currentElement; | 434 typeDeclarationElement = currentElement; |
| 434 } else { | 435 } else { |
| 435 typeDeclarationElement = currentElement.getEnclosingClass(); | 436 typeDeclarationElement = currentElement.getEnclosingClass(); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 | 632 |
| 632 visitBlock(Block node) { | 633 visitBlock(Block node) { |
| 633 for (Node statement in node.statements.nodes) { | 634 for (Node statement in node.statements.nodes) { |
| 634 if (statement is VariableDefinitions) { | 635 if (statement is VariableDefinitions) { |
| 635 makeVarDeclarationTypePlaceholder(statement); | 636 makeVarDeclarationTypePlaceholder(statement); |
| 636 } | 637 } |
| 637 } | 638 } |
| 638 node.visitChildren(this); | 639 node.visitChildren(this); |
| 639 } | 640 } |
| 640 } | 641 } |
| OLD | NEW |