Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Unified Diff: lib/compiler/implementation/scanner/listener.dart

Issue 9976004: Allow all different string-literals in map literals. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add description. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/compiler/implementation/scanner/listener.dart
diff --git a/lib/compiler/implementation/scanner/listener.dart b/lib/compiler/implementation/scanner/listener.dart
index 6b3184ee090686e2230521416db0a7fcacad3ffc..343bc5156a52e39edaf6b7f0e9caf4d6d76fb668 100644
--- a/lib/compiler/implementation/scanner/listener.dart
+++ b/lib/compiler/implementation/scanner/listener.dart
@@ -1213,8 +1213,8 @@ class NodeListener extends ElementListener {
void endLiteralMapEntry(Token colon, Token endToken) {
Expression value = popNode();
Expression key = popNode();
- if (key.asLiteralString() === null) {
- recoverableError('expected a constant string', node: key);
+ if (key.asStringNode() === null) {
+ recoverableError('expected a string', node: key);
}
pushNode(new LiteralMapEntry(key, colon, value));
}
« no previous file with comments | « lib/compiler/implementation/compile_time_constants.dart ('k') | lib/compiler/implementation/tree/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698