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

Unified Diff: runtime/vm/parser.cc

Issue 10368004: Properly set the element type of literal lists. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 7305)
+++ runtime/vm/parser.cc (working copy)
@@ -7312,8 +7312,7 @@
// Parse the list elements. Note: there may be an optional extra
// comma after the last element.
- ArrayNode* list =
- new ArrayNode(token_index_, TypeArguments::ZoneHandle());
+ ArrayNode* list = new ArrayNode(token_index_, type_arguments);
if (!is_empty_literal) {
const bool saved_mode = SetAllowFunctionLiterals(true);
const String& dst_name = String::ZoneHandle(
@@ -7478,6 +7477,8 @@
// Parse the map entries. Note: there may be an optional extra
// comma after the last entry.
+ // The kv_pair array is temporary and of element type Dynamic. It is passed
+ // to the factory to initialize a properly typed map.
ArrayNode* kv_pairs =
new ArrayNode(token_index_, TypeArguments::ZoneHandle());
const String& dst_name = String::ZoneHandle(

Powered by Google App Engine
This is Rietveld 408576698