From d9eb88c8363537701713027149957b3b7c08b57e Mon Sep 17 00:00:00 2001 From: xzyfer Date: Mon, 26 Sep 2016 00:00:48 +1000 Subject: [PATCH] Don't apply unary operations on colors Spec sass/sass-spec#930 Fixes #2140 --- src/eval.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/eval.cpp b/src/eval.cpp index 7df3953425..89927b8f4b 100644 --- a/src/eval.cpp +++ b/src/eval.cpp @@ -759,7 +759,13 @@ namespace Sass { if (operand->concrete_type() == Expression::NULL_VAL && dynamic_cast(u->operand())) { u->operand(SASS_MEMORY_NEW(ctx.mem, String_Quoted, u->pstate(), "")); } - else u->operand(operand); + // Never apply unary opertions on colors @see #2140 + else if (operand->concrete_type() == Expression::COLOR) { + operand = u->operand(); + } + else { + u->operand(operand); + } String_Constant* result = SASS_MEMORY_NEW(ctx.mem, String_Quoted, u->pstate(), u->inspect());