Skip to content

Commit aa5445b

Browse files
committed
Update list equality to take delimiters into account
Bracketed lists introduced list delimiters. A list's delimiter needs be taken into account when determining equality. See sass/sass#2121 Fixes #2280 Spec sass/sass-spec#896
1 parent 46f5244 commit aa5445b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/ast.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -2225,6 +2225,7 @@ namespace Sass {
22252225
if (List_Ptr_Const r = dynamic_cast<List_Ptr_Const>(&rhs)) {
22262226
if (length() != r->length()) return false;
22272227
if (separator() != r->separator()) return false;
2228+
if (is_bracketed() != r->is_bracketed()) return false;
22282229
for (size_t i = 0, L = length(); i < L; ++i) {
22292230
Expression_Obj rv = r->at(i);
22302231
Expression_Obj lv = this->at(i);

src/ast.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ namespace Sass {
10841084
{
10851085
if (hash_ == 0) {
10861086
hash_ = std::hash<std::string>()(sep_string());
1087+
if (is_bracketed()) hash_combine(hash_, std::hash<std::string>()("bracket"));
10871088
for (size_t i = 0, L = length(); i < L; ++i)
10881089
hash_combine(hash_, (elements()[i])->hash());
10891090
}

0 commit comments

Comments
 (0)