Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart |
| index 89bb3e7f22b4d483a29bb9c73676dd43a5bbe164..81fc87409477d8fbab81754dc9bdb8b89e8126cb 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart |
| @@ -2488,6 +2488,16 @@ class ResolverVisitor extends MappingVisitor<Element> { |
| world.registerInstantiatedClass(compiler.nullClass, mapping); |
| } |
| + visitLiteralSymbol(LiteralSymbol node) { |
|
ngeoffray
2013/09/04 07:14:17
You should report that to the backend!!! :-) You c
Johnni Winther
2013/09/10 09:09:07
Done.
|
| + world.registerInstantiatedClass(compiler.symbolClass, mapping); |
| + world.registerStaticUse(compiler.symbolConstructor.declaration); |
| + world.registerConstSymbol(node.slowNameString, mapping); |
| + if (!validateSymbol(node, node.slowNameString, reportError: false)) { |
| + compiler.reportError(node, MessageKind.UNSUPPORTED_LITERAL_SYMBOL, |
| + {'value': node.slowNameString}); |
| + } |
| + } |
| + |
| visitStringJuxtaposition(StringJuxtaposition node) { |
| world.registerInstantiatedClass(compiler.stringClass, mapping); |
| node.visitChildren(this); |
| @@ -2679,16 +2689,20 @@ class ResolverVisitor extends MappingVisitor<Element> { |
| return null; |
| } |
| - bool validateSymbol(Node node, String name) { |
| + bool validateSymbol(Node node, String name, {bool reportError: true}) { |
| if (name.isEmpty) return true; |
| if (name.startsWith('_')) { |
| - compiler.reportError(node, MessageKind.PRIVATE_IDENTIFIER, |
| - {'value': name}); |
| + if (reportError) { |
| + compiler.reportError(node, MessageKind.PRIVATE_IDENTIFIER, |
| + {'value': name}); |
| + } |
| return false; |
| } |
| if (!symbolValidationPattern.hasMatch(name)) { |
| - compiler.reportError(node, MessageKind.INVALID_SYMBOL, |
| - {'value': name}); |
| + if (reportError) { |
| + compiler.reportError(node, MessageKind.INVALID_SYMBOL, |
| + {'value': name}); |
| + } |
| return false; |
| } |
| return true; |