Skip to content

Commit 312240c

Browse files
authored
Merge pull request #2262 from mgreter/bugfix/issue-2261
Fixes equality compare evaluation issue
2 parents feff4f5 + a8f0975 commit 312240c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/eval.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,9 @@ namespace Sass {
606606

607607
if ((s1 && s1->has_interpolants()) || (s2 && s2->has_interpolants()) || force_delay)
608608
{
609-
// If possible upgrade LHS to a number
610609
if (op_type == Sass_OP::DIV || op_type == Sass_OP::MUL || op_type == Sass_OP::MOD || op_type == Sass_OP::ADD || op_type == Sass_OP::SUB ||
611610
op_type == Sass_OP::EQ) {
611+
// If possible upgrade LHS to a number (for number to string compare)
612612
if (String_Constant_Ptr str = SASS_MEMORY_CAST(String_Constant, lhs)) {
613613
std::string value(str->value());
614614
const char* start = value.c_str();
@@ -617,10 +617,11 @@ namespace Sass {
617617
lhs = l->perform(this);
618618
}
619619
}
620+
// If possible upgrade RHS to a number (for string to number compare)
620621
if (String_Constant_Ptr str = SASS_MEMORY_CAST(String_Constant, rhs)) {
621622
std::string value(str->value());
622623
const char* start = value.c_str();
623-
if (Prelexer::sequence < Prelexer::number >(start) != 0) {
624+
if (Prelexer::sequence < Prelexer::dimension, Prelexer::number >(start) != 0) {
624625
Textual_Obj r = SASS_MEMORY_NEW(Textual, b->pstate(), Textual::DIMENSION, str->value());
625626
rhs = r->perform(this);
626627
}

0 commit comments

Comments
 (0)