Remove Func::AsScriptFunc() methods

Not used frequently enough, so possibly better to minimize leakage of
details from non-detail API.
This commit is contained in:
Jon Siwek 2020-12-13 14:03:39 -08:00
parent 4824da0325
commit 70ff4ef678
4 changed files with 8 additions and 12 deletions

View file

@ -738,10 +738,10 @@ void end_func(StmtPtr body)
ingredients->id->SetConst();
}
auto func = ingredients->id->GetVal()->AsFunc()->AsScriptFunc();
auto func = cast_intrusive<ScriptFunc>(ingredients->id->GetVal()->AsFuncPtr());
func->SetScope(ingredients->scope);
analyze_func({NewRef{}, func});
analyze_func(std::move(func));
// Note: ideally, something would take ownership of this memory until the
// end of script execution, but that's essentially the same as the