| 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 resolution; | 5 part of resolution; |
| 6 | 6 |
| 7 abstract class TreeElements { | 7 abstract class TreeElements { |
| 8 AnalyzableElement get analyzedElement; | 8 AnalyzableElement get analyzedElement; |
| 9 Iterable<Node> get superUses; | 9 Iterable<Node> get superUses; |
| 10 | 10 |
| (...skipping 3268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3279 } | 3279 } |
| 3280 | 3280 |
| 3281 if (isSymbolConstructor) { | 3281 if (isSymbolConstructor) { |
| 3282 if (node.isConst) { | 3282 if (node.isConst) { |
| 3283 Node argumentNode = node.send.arguments.head; | 3283 Node argumentNode = node.send.arguments.head; |
| 3284 ConstantExpression constant = | 3284 ConstantExpression constant = |
| 3285 compiler.resolver.constantCompiler.compileNode( | 3285 compiler.resolver.constantCompiler.compileNode( |
| 3286 argumentNode, registry.mapping); | 3286 argumentNode, registry.mapping); |
| 3287 ConstantValue name = constant.value; | 3287 ConstantValue name = constant.value; |
| 3288 if (!name.isString) { | 3288 if (!name.isString) { |
| 3289 DartType type = name.computeType(compiler); | 3289 DartType type = name.getType(compiler.coreTypes); |
| 3290 compiler.reportError(argumentNode, MessageKind.STRING_EXPECTED, | 3290 compiler.reportError(argumentNode, MessageKind.STRING_EXPECTED, |
| 3291 {'type': type}); | 3291 {'type': type}); |
| 3292 } else { | 3292 } else { |
| 3293 StringConstantValue stringConstant = name; | 3293 StringConstantValue stringConstant = name; |
| 3294 String nameString = stringConstant.toDartString().slowToString(); | 3294 String nameString = stringConstant.toDartString().slowToString(); |
| 3295 if (validateSymbol(argumentNode, nameString)) { | 3295 if (validateSymbol(argumentNode, nameString)) { |
| 3296 registry.registerConstSymbol(nameString); | 3296 registry.registerConstSymbol(nameString); |
| 3297 } | 3297 } |
| 3298 } | 3298 } |
| 3299 } else { | 3299 } else { |
| (...skipping 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4982 } | 4982 } |
| 4983 | 4983 |
| 4984 /// The result for the resolution of the `assert` method. | 4984 /// The result for the resolution of the `assert` method. |
| 4985 class AssertResult implements ResolutionResult { | 4985 class AssertResult implements ResolutionResult { |
| 4986 const AssertResult(); | 4986 const AssertResult(); |
| 4987 | 4987 |
| 4988 Element get element => null; | 4988 Element get element => null; |
| 4989 | 4989 |
| 4990 String toString() => 'AssertResult()'; | 4990 String toString() => 'AssertResult()'; |
| 4991 } | 4991 } |
| OLD | NEW |