Skip to content

fix: Update "call" parameter to $function #2948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/fn_miscs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,21 @@ namespace Sass {
return SASS_MEMORY_NEW(Boolean, pstate, features->find(s) != features->end());
}

Signature call_sig = "call($name, $args...)";
Signature call_sig = "call($function, $args...)";
BUILT_IN(call)
{
std::string name;
Function* ff = Cast<Function>(env["$name"]);
String_Constant* ss = Cast<String_Constant>(env["$name"]);
std::string function;
Function* ff = Cast<Function>(env["$function"]);
String_Constant* ss = Cast<String_Constant>(env["$function"]);

if (ss) {
name = Util::normalize_underscores(unquote(ss->value()));
function = Util::normalize_underscores(unquote(ss->value()));
std::cerr << "DEPRECATION WARNING: ";
std::cerr << "Passing a string to call() is deprecated and will be illegal" << std::endl;
std::cerr << "in Sass 4.0. Use call(get-function(" + quote(name) + ")) instead." << std::endl;
std::cerr << "in Sass 4.0. Use call(get-function(" + quote(function) + ")) instead." << std::endl;
std::cerr << std::endl;
} else if (ff) {
name = ff->name();
function = ff->name();
}

List_Obj arglist = SASS_MEMORY_COPY(ARG("$args", List));
Expand Down Expand Up @@ -135,7 +135,7 @@ namespace Sass {
args->append(SASS_MEMORY_NEW(Argument, pstate, expr));
}
}
Function_Call_Obj func = SASS_MEMORY_NEW(Function_Call, pstate, name, args);
Function_Call_Obj func = SASS_MEMORY_NEW(Function_Call, pstate, function, args);

Expand expand(ctx, &d_env, &selector_stack, &original_stack);
func->via_call(true); // calc invoke is allowed
Expand Down