| 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 interface TreeElements { | 5 interface TreeElements { |
| 6 Element operator[](Node node); | 6 Element operator[](Node node); |
| 7 Selector getSelector(Send send); | 7 Selector getSelector(Send send); |
| 8 Type getType(TypeAnnotation annotation); | 8 Type getType(TypeAnnotation annotation); |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2331 Node diagnosticNode, | 2331 Node diagnosticNode, |
| 2332 SourceString constructorName) { | 2332 SourceString constructorName) { |
| 2333 cls.ensureResolved(compiler); | 2333 cls.ensureResolved(compiler); |
| 2334 Element result = cls.lookupConstructor(cls.name, constructorName); | 2334 Element result = cls.lookupConstructor(cls.name, constructorName); |
| 2335 if (result === null) { | 2335 if (result === null) { |
| 2336 String fullConstructorName = cls.name.slowToString(); | 2336 String fullConstructorName = cls.name.slowToString(); |
| 2337 if (constructorName !== const SourceString('')) { | 2337 if (constructorName !== const SourceString('')) { |
| 2338 fullConstructorName = '$fullConstructorName' | 2338 fullConstructorName = '$fullConstructorName' |
| 2339 '.${constructorName.slowToString()}'; | 2339 '.${constructorName.slowToString()}'; |
| 2340 } | 2340 } |
| 2341 ResolutionWarning message = | 2341 ResolutionWarning warning = |
| 2342 new ResolutionWarning(MessageKind.CANNOT_FIND_CONSTRUCTOR, | 2342 new ResolutionWarning(MessageKind.CANNOT_FIND_CONSTRUCTOR, |
| 2343 [fullConstructorName]); | 2343 [fullConstructorName]); |
| 2344 compiler.reportWarning(diagnosticNode, message); | 2344 compiler.reportWarning(diagnosticNode, warning); |
| 2345 return new ErroneousFunctionElement(message, cls); | 2345 return new ErroneousFunctionElement(warning.message, cls); |
| 2346 } | 2346 } |
| 2347 return result; | 2347 return result; |
| 2348 } | 2348 } |
| 2349 | 2349 |
| 2350 visitNewExpression(NewExpression node) { | 2350 visitNewExpression(NewExpression node) { |
| 2351 Node selector = node.send.selector; | 2351 Node selector = node.send.selector; |
| 2352 Element e = visit(selector); | 2352 Element e = visit(selector); |
| 2353 if (!Element.isInvalid(e) && e.kind === ElementKind.CLASS) { | 2353 if (!Element.isInvalid(e) && e.kind === ElementKind.CLASS) { |
| 2354 ClassElement cls = e; | 2354 ClassElement cls = e; |
| 2355 cls.ensureResolved(compiler); | 2355 cls.ensureResolved(compiler); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2526 TopScope(LibraryElement library) : super(null, library); | 2526 TopScope(LibraryElement library) : super(null, library); |
| 2527 Element lookup(SourceString name) { | 2527 Element lookup(SourceString name) { |
| 2528 return library.find(name); | 2528 return library.find(name); |
| 2529 } | 2529 } |
| 2530 | 2530 |
| 2531 Element add(Element newElement) { | 2531 Element add(Element newElement) { |
| 2532 throw "Cannot add an element in the top scope"; | 2532 throw "Cannot add an element in the top scope"; |
| 2533 } | 2533 } |
| 2534 String toString() => '$element'; | 2534 String toString() => '$element'; |
| 2535 } | 2535 } |
| OLD | NEW |