| 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 package com.google.dart.compiler.resolver; | 5 package com.google.dart.compiler.resolver; |
| 6 import com.google.common.annotations.VisibleForTesting; | 6 import com.google.common.annotations.VisibleForTesting; |
| 7 import com.google.dart.compiler.DartCompilationError; | 7 import com.google.dart.compiler.DartCompilationError; |
| 8 import com.google.dart.compiler.DartCompilerContext; | 8 import com.google.dart.compiler.DartCompilerContext; |
| 9 import com.google.dart.compiler.ErrorCode; | 9 import com.google.dart.compiler.ErrorCode; |
| 10 import com.google.dart.compiler.ErrorSeverity; | 10 import com.google.dart.compiler.ErrorSeverity; |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 @Override | 378 @Override |
| 379 public Element visitNode(DartNode node) { | 379 public Element visitNode(DartNode node) { |
| 380 throw internalError(node, "Unexpected node: %s", node); | 380 throw internalError(node, "Unexpected node: %s", node); |
| 381 } | 381 } |
| 382 | 382 |
| 383 @Override | 383 @Override |
| 384 public Element visitPropertyAccess(DartPropertyAccess node) { | 384 public Element visitPropertyAccess(DartPropertyAccess node) { |
| 385 Element element = node.getQualifier().accept(this); | 385 Element element = node.getQualifier().accept(this); |
| 386 if (element != null) { | 386 if (element != null) { |
| 387 switch (element.getKind()) { | 387 switch (element.getKind()) { |
| 388 case LIBRARY : | 388 case LIBRARY_PREFIX : |
| 389 Scope elementScope = ((LibraryElement) element).getScope(); | 389 Scope elementScope = ((LibraryPrefixElement) element).getScope(); |
| 390 return elementScope.findElement(scope.getLibrary(), node.getProperty
Name()); | 390 return elementScope.findElement(scope.getLibrary(), node.getProperty
Name()); |
| 391 case CLASS : | 391 case CLASS : |
| 392 return Elements.findElement((ClassElement) element, node.getProperty
Name()); | 392 return Elements.findElement((ClassElement) element, node.getProperty
Name()); |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 return null; | 395 return null; |
| 396 } | 396 } |
| 397 | 397 |
| 398 @Override | 398 @Override |
| 399 public Element visitIdentifier(DartIdentifier node) { | 399 public Element visitIdentifier(DartIdentifier node) { |
| 400 String name = node.getName(); | 400 String name = node.getName(); |
| 401 return scope.findElement(scope.getLibrary(), name); | 401 return scope.findElement(scope.getLibrary(), name); |
| 402 } | 402 } |
| 403 | 403 |
| 404 @Override | 404 @Override |
| 405 public Element visitSyntheticErrorIdentifier(DartSyntheticErrorIdentifier no
de) { | 405 public Element visitSyntheticErrorIdentifier(DartSyntheticErrorIdentifier no
de) { |
| 406 return Elements.dynamicElement(); | 406 return Elements.dynamicElement(); |
| 407 } | 407 } |
| 408 } | 408 } |
| 409 } | 409 } |
| OLD | NEW |