| 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 Element get currentElement; | 8 Element get currentElement; |
| 9 Set<Node> get superUses; | 9 Set<Node> get superUses; |
| 10 | 10 |
| (...skipping 2574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2585 | 2585 |
| 2586 if (node.isConst() && isSymbolConstructor) { | 2586 if (node.isConst() && isSymbolConstructor) { |
| 2587 Node argumentNode = node.send.arguments.head; | 2587 Node argumentNode = node.send.arguments.head; |
| 2588 Constant name = compiler.metadataHandler.compileNodeWithDefinitions( | 2588 Constant name = compiler.metadataHandler.compileNodeWithDefinitions( |
| 2589 argumentNode, mapping, isConst: true); | 2589 argumentNode, mapping, isConst: true); |
| 2590 if (!name.isString()) { | 2590 if (!name.isString()) { |
| 2591 DartType type = name.computeType(compiler); | 2591 DartType type = name.computeType(compiler); |
| 2592 compiler.reportErrorCode(argumentNode, MessageKind.STRING_EXPECTED, | 2592 compiler.reportErrorCode(argumentNode, MessageKind.STRING_EXPECTED, |
| 2593 {'type': type}); | 2593 {'type': type}); |
| 2594 } else { | 2594 } else { |
| 2595 validateSymbol(argumentNode, name.toDartString().slowToString()); | 2595 StringConstant stringConstant = name; |
| 2596 validateSymbol(argumentNode, |
| 2597 stringConstant.toDartString().slowToString()); |
| 2596 } | 2598 } |
| 2597 } | 2599 } |
| 2598 | 2600 |
| 2599 return null; | 2601 return null; |
| 2600 } | 2602 } |
| 2601 | 2603 |
| 2602 void validateSymbol(Node node, String name) { | 2604 void validateSymbol(Node node, String name) { |
| 2603 if (name.isEmpty) return; | 2605 if (name.isEmpty) return; |
| 2604 if (name.startsWith('_')) { | 2606 if (name.startsWith('_')) { |
| 2605 compiler.reportErrorCode(node, MessageKind.PRIVATE_IDENTIFIER, | 2607 compiler.reportErrorCode(node, MessageKind.PRIVATE_IDENTIFIER, |
| (...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3955 return e; | 3957 return e; |
| 3956 } | 3958 } |
| 3957 | 3959 |
| 3958 /// Assumed to be called by [resolveRedirectingFactory]. | 3960 /// Assumed to be called by [resolveRedirectingFactory]. |
| 3959 Element visitReturn(Return node) { | 3961 Element visitReturn(Return node) { |
| 3960 Node expression = node.expression; | 3962 Node expression = node.expression; |
| 3961 return finishConstructorReference(visit(expression), | 3963 return finishConstructorReference(visit(expression), |
| 3962 expression, expression); | 3964 expression, expression); |
| 3963 } | 3965 } |
| 3964 } | 3966 } |
| OLD | NEW |