diff --git a/src/eval.cpp b/src/eval.cpp index 75a9a207e8..f5f547736c 100644 --- a/src/eval.cpp +++ b/src/eval.cpp @@ -1329,7 +1329,7 @@ namespace Sass { return ee; } - Expression_Ptr Eval::operator()(Media_Query_Ptr q) + Media_Query_Ptr Eval::operator()(Media_Query_Ptr q) { String_Obj t = q->media_type(); t = static_cast(t.isNull() ? 0 : t->perform(this)); diff --git a/src/eval.hpp b/src/eval.hpp index 195f690d56..4fe0bcb1eb 100644 --- a/src/eval.hpp +++ b/src/eval.hpp @@ -59,7 +59,7 @@ namespace Sass { Expression_Ptr operator()(String_Quoted_Ptr); Expression_Ptr operator()(String_Constant_Ptr); // Expression_Ptr operator()(Selector_List_Ptr); - Expression_Ptr operator()(Media_Query_Ptr); + Media_Query_Ptr operator()(Media_Query_Ptr); Expression_Ptr operator()(Media_Query_Expression_Ptr); Expression_Ptr operator()(At_Root_Query_Ptr); Expression_Ptr operator()(Supports_Operator_Ptr); diff --git a/src/expand.cpp b/src/expand.cpp index 9af9a79edf..78f2ab0e17 100644 --- a/src/expand.cpp +++ b/src/expand.cpp @@ -176,18 +176,19 @@ namespace Sass { Statement_Ptr Expand::operator()(Media_Block_Ptr m) { - media_block_stack.push_back(m); - Expression_Obj mq = m->media_queries()->perform(&eval); + Media_Block_Ptr cpy = m->copy(); + Expression_Obj mq = eval(m->media_queries()); std::string str_mq(mq->to_string(ctx.c_options)); char* str = sass_copy_c_string(str_mq.c_str()); ctx.strings.push_back(str); Parser p(Parser::from_c_str(str, ctx, mq->pstate())); mq = p.parse_media_queries(); // re-assign now - List_Obj ls = Cast(mq->perform(&eval)); + cpy->media_queries(mq); + media_block_stack.push_back(cpy); Block_Obj blk = operator()(m->block()); Media_Block_Ptr mm = SASS_MEMORY_NEW(Media_Block, m->pstate(), - ls, + mq, blk); media_block_stack.pop_back(); mm->tabs(m->tabs());