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

Commit

Permalink
Disallow parent selector in selector_fns arguments
Browse files Browse the repository at this point in the history
Fixes #2779

sass-spec: sass/sass-spec#1320
  • Loading branch information
glebm authored and xzyfer committed Dec 9, 2018
1 parent c4ccba9 commit e94b5f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fn_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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();
Expand Down

0 comments on commit e94b5f9

Please sign in to comment.