Explorar o código

pastojs: fixed clone array of tobject, pas2js issue 39238

mattias %!s(int64=2) %!d(string=hai) anos
pai
achega
3e181d7640
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      packages/pastojs/src/fppas2js.pp

+ 2 - 1
packages/pastojs/src/fppas2js.pp

@@ -16977,7 +16977,8 @@ begin
       MaxIndex:=length(El.Ranges)-1;
 
       UseSlice:=(ElTypeLo is TPasUnresolvedSymbolRef)
-             or (ElTypeLo is TPasRangeType);
+             or (ElTypeLo is TPasRangeType)
+             or ((ElTypeLo is TPasClassType) and (TPasClassType(ElTypeLo).ObjKind in [okClass]));
       ForLoop:=nil;
       if UseSlice then
         // static array of a base type -> inner loop is replaced with slice(0)