Skip to content

Commit 80a6d01

Browse files
committed
Merge pull request #1571 from saper/is-superselector
Error messages for selector functions
2 parents 8ececd5 + 36869bb commit 80a6d01

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/functions.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ namespace Sass {
188188
Expression* exp = ARG(argname, Expression);
189189
if (exp->concrete_type() == Expression::NULL_VAL) {
190190
std::stringstream msg;
191-
msg << argname << ": null is not a valid selector: it must be a string,\n";
192-
msg << "a list of strings, or a list of lists of strings for `" << function_name(sig) << "'";
191+
msg << argname << ": null is not a string for `" << function_name(sig) << "'";
193192
error(msg.str(), pstate);
194193
}
195194
std::string exp_src = exp->perform(&to_string) + "{";
@@ -1881,12 +1880,8 @@ namespace Sass {
18811880
BUILT_IN(is_superselector)
18821881
{
18831882
To_String to_string(&ctx, false);
1884-
Expression* ex_sup = ARG("$super", Expression);
1885-
Expression* ex_sub = ARG("$sub", Expression);
1886-
std::string sup_src = ex_sup->perform(&to_string) + "{";
1887-
std::string sub_src = ex_sub->perform(&to_string) + "{";
1888-
Selector_List* sel_sup = Parser::parse_selector(sup_src.c_str(), ctx);
1889-
Selector_List* sel_sub = Parser::parse_selector(sub_src.c_str(), ctx);
1883+
Selector_List* sel_sup = ARGSEL("$super", Selector_List, p_contextualize);
1884+
Selector_List* sel_sub = ARGSEL("$sub", Selector_List, p_contextualize);
18901885
bool result = sel_sup->is_superselector_of(sel_sub);
18911886
return SASS_MEMORY_NEW(ctx.mem, Boolean, pstate, result);
18921887
}

0 commit comments

Comments
 (0)