Improving setting up of array-like native values for cases when they are null
Publish PHP Package / docker (push) Successful in 7s
Details
Publish PHP Package / docker (push) Successful in 7s
Details
This commit is contained in:
parent
5e870a3973
commit
a8ebe821be
|
@ -407,11 +407,22 @@ Script_{{o.name|norm_name}}.Method_{{m.name}}.ReturnValue(frm, stack
|
|||
{%- endif -%}
|
||||
|
||||
{%- if type is instanceof('\\mtgArrType') -%}
|
||||
var _arr_type = (ArrayTypeSymbol){{value}}.type;
|
||||
int _native_before_count = 0;
|
||||
|
||||
{%- if type == 'any[]'-%}
|
||||
{{native}} = ValList.New(frm.vm);
|
||||
{%~ else ~%}
|
||||
try
|
||||
{
|
||||
_native_before_count = {{native}}.Count;
|
||||
}
|
||||
catch(NullReferenceException)
|
||||
{
|
||||
{{native}} = new();
|
||||
}
|
||||
{%~ endif -%}
|
||||
var _arr_type = (ArrayTypeSymbol){{value}}.type;
|
||||
int _native_before_count = {{native}}.Count;
|
||||
|
||||
for(int i=0;i<_arr_type.ArrCount({{value}});++i)
|
||||
{
|
||||
var _arr_item = _arr_type.ArrGetAt({{value}}, i);
|
||||
|
|
Loading…
Reference in New Issue