From e94b5f91ec372a84be1f9c0da32cb6e0af0b99fe Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sun, 2 Dec 2018 15:22:36 +0000 Subject: [PATCH] Disallow parent selector in selector_fns arguments Fixes #2779 sass-spec: https://github.com/sass/sass-spec/pull/1320 --- src/fn_utils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fn_utils.cpp b/src/fn_utils.cpp index 45100b221..6d979ce79 100644 --- a/src/fn_utils.cpp +++ b/src/fn_utils.cpp @@ -127,7 +127,7 @@ namespace Sass { str->quote_mark(0); } std::string exp_src = exp->to_string(ctx.c_options); - return Parser::parse_selector(exp_src.c_str(), ctx, traces, exp->pstate(), pstate.src); + return Parser::parse_selector(exp_src.c_str(), ctx, traces, exp->pstate(), pstate.src, /*allow_parent=*/false); } Compound_Selector_Obj get_arg_sel(const std::string& argname, Env& env, Signature sig, ParserState pstate, Backtraces traces, Context& ctx) { @@ -141,7 +141,7 @@ namespace Sass { str->quote_mark(0); } std::string exp_src = exp->to_string(ctx.c_options); - Selector_List_Obj sel_list = Parser::parse_selector(exp_src.c_str(), ctx, traces, exp->pstate(), pstate.src); + Selector_List_Obj sel_list = Parser::parse_selector(exp_src.c_str(), ctx, traces, exp->pstate(), pstate.src, /*allow_parent=*/false); if (sel_list->length() == 0) return {}; Complex_Selector_Obj first = sel_list->first(); if (!first->tail()) return first->head();