Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2996 from mgreter/bugfix/2980-fix-unary-expr-eval
Browse files Browse the repository at this point in the history
Fix evaluation of unary expressions in loops
  • Loading branch information
mgreter committed Oct 4, 2019
2 parents 408a883 + 3d806e6 commit 23cabbe
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/eval.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,12 +925,19 @@ namespace Sass {
else if (Color* color = Cast<Color>(operand)) {
// Use the color name if this was eval with one
if (color->disp().length() > 0) {
operand = SASS_MEMORY_NEW(String_Constant, operand->pstate(), color->disp());
u->operand(operand);
Unary_Expression_Obj cpy = SASS_MEMORY_COPY(u);
cpy->operand(SASS_MEMORY_NEW(String_Constant, operand->pstate(), color->disp()));
return SASS_MEMORY_NEW(String_Quoted,
cpy->pstate(),
cpy->inspect());
}
}
else {
u->operand(operand);
Unary_Expression_Obj cpy = SASS_MEMORY_COPY(u);
cpy->operand(operand);
return SASS_MEMORY_NEW(String_Quoted,
cpy->pstate(),
cpy->inspect());
}

return SASS_MEMORY_NEW(String_Quoted,
Expand Down

0 comments on commit 23cabbe

Please sign in to comment.