Skip to content

Commit

Permalink
fix: Update "call" parameter to $function
Browse files Browse the repository at this point in the history
See sass/sass-spec#1442
Closes 2941
  • Loading branch information
nschonni committed Jul 18, 2019
1 parent ac338df commit d5d30da
Showing 1 changed file with 8 additions and 8 deletions.
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

0 comments on commit d5d30da

Please sign in to comment.