For now using Val.New(..) instead of Val.NewNoReset() since the latter introduces some ownership related bug
Publish PHP Package / docker (push) Successful in 8s Details

This commit is contained in:
Pavel Shevaev 2025-01-04 12:48:51 +03:00
parent 66e9451e4a
commit ce24672649
2 changed files with 5 additions and 5 deletions

View File

@ -283,7 +283,7 @@ function add_twig_support(\Twig\Environment $twig)
$twig->addFunction(new \Twig\TwigFunction('has_token',
function($o, $token)
{
return $o->hasToken($token);
return method_exists($o, 'hasToken') && $o->hasToken($token);
}
));
$twig->addFunction(new \Twig\TwigFunction('token',

View File

@ -321,7 +321,7 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack
{%- for idx, type_item in ret_types -%}
{% set ridx = ret_types|length - idx - 1 ~%}
{
var dv{{ridx}} = bhl.Val.NewNoReset(frm.vm);
var dv{{ridx}} = bhl.Val.New(frm.vm);
{{ _self.native2val(ret_types[ridx], 'v'~ridx, 'dv'~ridx) }};
stack.Push(dv{{ridx}});
}
@ -565,7 +565,7 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack
{%- else -%}
{%- if type is instanceof('\\mtgMetaFunc') -%}
{{value}}.SetObj({{native}}, Types.Any)
{{value}}.SetObj({{native}}, Types.Any/*TODO: use real type?*/)
{%- endif -%}
{%- if type is instanceof('\\mtgArrType') -%}
@ -640,7 +640,7 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack
},
(_vm, itype, n) => {
#if !BHL_FRONT
var v = Val.NewNoReset(_vm);
var v = Val.New(_vm);
{{ _self.native2val(token(o, 'bhl_native_arr_proxy'), 'n', 'v')}};
return v;
#else
@ -890,7 +890,7 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack
{%- endif ~%}
{
var dv = bhl.Val.NewNoReset(frm.vm);
var dv = bhl.Val.New(frm.vm);
{{ _self.native2val(f.returntype, return_var, 'dv') }};
stack.Push(dv);
}