diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2024-05-15 00:07:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-14 18:07:47 +0200 |
commit | 0fcd838fd938a26ff9d032de71d5c78a1028e955 (patch) | |
tree | fdbb44f819be556be6594bbcd2874bd0e2e4e281 /compiler | |
parent | 04f3df4c87e8ba9efc26fa4faed8e3b6cbaa6e93 (diff) | |
download | Nim-0fcd838fd938a26ff9d032de71d5c78a1028e955.tar.gz |
fixes openarray views default values in JS (#23607)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/jsgen.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index f7e4e9e72..0cc052b38 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -1241,7 +1241,7 @@ proc needsNoCopy(p: PProc; y: PNode): bool = return y.kind in nodeKindsNeedNoCopy or ((mapType(y.typ) != etyBaseIndex) and (skipTypes(y.typ, abstractInst).kind in - {tyRef, tyPtr, tyLent, tyVar, tyCstring, tyProc, tyOwned} + IntegralTypes)) + {tyRef, tyPtr, tyLent, tyVar, tyCstring, tyProc, tyOwned, tyOpenArray} + IntegralTypes)) proc genAsgnAux(p: PProc, x, y: PNode, noCopyNeeded: bool) = var a, b: TCompRes = default(TCompRes) @@ -1966,7 +1966,7 @@ proc createVar(p: PProc, typ: PType, indirect: bool): Rope = result = putToSeq("null", indirect) of tySequence, tyString: result = putToSeq("[]", indirect) - of tyCstring, tyProc: + of tyCstring, tyProc, tyOpenArray: result = putToSeq("null", indirect) of tyStatic: if t.n != nil: |