mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 08:54:53 +00:00
Sets need copying in JS (#11392)
* Sets need copying in JS * Fixes #11353 * Add test for #11353
This commit is contained in:
@@ -975,7 +975,7 @@ proc countJsParams(typ: PType): int =
|
||||
|
||||
const
|
||||
nodeKindsNeedNoCopy = {nkCharLit..nkInt64Lit, nkStrLit..nkTripleStrLit,
|
||||
nkFloatLit..nkFloat64Lit, nkCurly, nkPar, nkStringToCString,
|
||||
nkFloatLit..nkFloat64Lit, nkPar, nkStringToCString,
|
||||
nkObjConstr, nkTupleConstr, nkBracket,
|
||||
nkCStringToString, nkCall, nkPrefix, nkPostfix, nkInfix,
|
||||
nkCommand, nkHiddenCallConv, nkCallStrLit}
|
||||
|
||||
14
tests/js/t11353.nim
Normal file
14
tests/js/t11353.nim
Normal file
@@ -0,0 +1,14 @@
|
||||
discard """
|
||||
output: '''
|
||||
{}
|
||||
{}
|
||||
'''
|
||||
"""
|
||||
|
||||
proc foo() =
|
||||
var bar: set[int16] = {}
|
||||
echo bar
|
||||
bar.incl(1)
|
||||
|
||||
foo()
|
||||
foo()
|
||||
Reference in New Issue
Block a user