File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -393,16 +393,24 @@ namespace Sass {
393
393
Expression* Eval::operator ()(Map* m)
394
394
{
395
395
if (m->is_expanded ()) return m;
396
+
397
+ // make sure we're not starting with duplicate keys.
398
+ // the duplicate key state will have been set in the parser phase.
399
+ if (m->has_duplicate_key ()) {
400
+ To_String to_string (&ctx);
401
+ error (" Duplicate key \" " + m->get_duplicate_key ()->perform (&to_string) + " \" in map " + m->perform (&to_string) + " ." , m->pstate ());
402
+ }
403
+
396
404
Map* mm = new (ctx.mem ) Map (m->pstate (),
397
405
m->length ());
398
406
for (auto key : m->keys ()) {
399
- *mm << std::make_pair (key->perform (this ), m->at (key)->perform (this ));
407
+ *mm << std::make_pair (key->perform (this ), m->at (key)->perform (this ));;
400
408
}
401
409
402
- // check for duplicate keys
410
+ // check the evaluated keys aren't duplicates.
403
411
if (mm->has_duplicate_key ()) {
404
412
To_String to_string (&ctx);
405
- error (" Duplicate key \" " + mm->get_duplicate_key ()->perform (&to_string) + " \" in map " + m ->perform (&to_string) + " ." , m ->pstate ());
413
+ error (" Duplicate key \" " + mm->get_duplicate_key ()->perform (&to_string) + " \" in map " + mm ->perform (&to_string) + " ." , mm ->pstate ());
406
414
}
407
415
408
416
mm->is_expanded (true );
@@ -927,6 +935,7 @@ namespace Sass {
927
935
} else if (str->quote_mark ()) {
928
936
str->quote_mark (' *' );
929
937
}
938
+ str->is_delayed (true );
930
939
return str;
931
940
}
932
941
Original file line number Diff line number Diff line change @@ -1105,12 +1105,6 @@ namespace Sass {
1105
1105
(*map) << make_pair (key, value);
1106
1106
}
1107
1107
1108
- // Check was moved to eval step
1109
- // if (map->has_duplicate_key()) {
1110
- // To_String to_string(&ctx);
1111
- // error("Duplicate key \"" + map->get_duplicate_key()->perform(&to_string) + "\" in map " + map->perform(&to_string) + ".", pstate);
1112
- // }
1113
-
1114
1108
ParserState ps = map->pstate ();
1115
1109
ps.offset = pstate - ps + pstate.offset ;
1116
1110
map->pstate (ps);
You can’t perform that action at this time.
0 commit comments