| 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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 static bool isPlainTypeName(TypeAnnotation typeAnnotation) { | 408 static bool isPlainTypeName(TypeAnnotation typeAnnotation) { |
| 409 if (typeAnnotation.typeName is !Identifier) return false; | 409 if (typeAnnotation.typeName is !Identifier) return false; |
| 410 if (typeAnnotation.typeArguments === null) return true; | 410 if (typeAnnotation.typeArguments === null) return true; |
| 411 if (typeAnnotation.typeArguments.length === 0) return true; | 411 if (typeAnnotation.typeArguments.length === 0) return true; |
| 412 return false; | 412 return false; |
| 413 } | 413 } |
| 414 | 414 |
| 415 static bool isDynamicType(TypeAnnotation typeAnnotation) { | 415 static bool isDynamicType(TypeAnnotation typeAnnotation) { |
| 416 if (!isPlainTypeName(typeAnnotation)) return false; | 416 if (!isPlainTypeName(typeAnnotation)) return false; |
| 417 String name = typeAnnotation.typeName.asIdentifier().source.slowToString(); | 417 String name = typeAnnotation.typeName.asIdentifier().source.slowToString(); |
| 418 return name == 'Dynamic'; | 418 // TODO(aprelev@gmail.com): Removed deprecated Dynamic keyword support. |
| 419 return name == 'Dynamic' || name == 'dynamic'; |
| 419 } | 420 } |
| 420 | 421 |
| 421 visitTypeAnnotation(TypeAnnotation node) { | 422 visitTypeAnnotation(TypeAnnotation node) { |
| 422 // Poor man generic variables resolution. | 423 // Poor man generic variables resolution. |
| 423 // TODO(antonm): get rid of it once resolver can deal with it. | 424 // TODO(antonm): get rid of it once resolver can deal with it. |
| 424 TypeDeclarationElement typeDeclarationElement; | 425 TypeDeclarationElement typeDeclarationElement; |
| 425 if (currentElement is TypeDeclarationElement) { | 426 if (currentElement is TypeDeclarationElement) { |
| 426 typeDeclarationElement = currentElement; | 427 typeDeclarationElement = currentElement; |
| 427 } else { | 428 } else { |
| 428 typeDeclarationElement = currentElement.getEnclosingClass(); | 429 typeDeclarationElement = currentElement.getEnclosingClass(); |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 | 604 |
| 604 visitBlock(Block node) { | 605 visitBlock(Block node) { |
| 605 for (Node statement in node.statements.nodes) { | 606 for (Node statement in node.statements.nodes) { |
| 606 if (statement is VariableDefinitions) { | 607 if (statement is VariableDefinitions) { |
| 607 makeVarDeclarationTypePlaceholder(statement); | 608 makeVarDeclarationTypePlaceholder(statement); |
| 608 } | 609 } |
| 609 } | 610 } |
| 610 node.visitChildren(this); | 611 node.visitChildren(this); |
| 611 } | 612 } |
| 612 } | 613 } |
| OLD | NEW |