parent
91b37311d9
commit
3f16711254
2 changed files with 14 additions and 2 deletions
|
|
@ -1552,7 +1552,7 @@ proc delete*[T](x: var seq[T], i: Natural) {.noSideEffect.} =
|
||||||
defaultImpl()
|
defaultImpl()
|
||||||
else:
|
else:
|
||||||
when defined(js):
|
when defined(js):
|
||||||
{.emit: "`x`[`x`_Idx].splice(`i`, 1);".}
|
{.emit: "`x`.splice(`i`, 1);".}
|
||||||
else:
|
else:
|
||||||
defaultImpl()
|
defaultImpl()
|
||||||
|
|
||||||
|
|
@ -1574,7 +1574,7 @@ proc insert*[T](x: var seq[T], item: T, i = 0.Natural) {.noSideEffect.} =
|
||||||
else:
|
else:
|
||||||
when defined(js):
|
when defined(js):
|
||||||
var it : T
|
var it : T
|
||||||
{.emit: "`x`[`x`_Idx].splice(`i`, 0, `it`);".}
|
{.emit: "`x`.splice(`i`, 0, `it`);".}
|
||||||
else:
|
else:
|
||||||
defaultImpl()
|
defaultImpl()
|
||||||
x[i] = item
|
x[i] = item
|
||||||
|
|
|
||||||
12
tests/js/t8914.nim
Normal file
12
tests/js/t8914.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
discard """
|
||||||
|
output: '''
|
||||||
|
@[42]
|
||||||
|
@[24, 42]
|
||||||
|
'''
|
||||||
|
"""
|
||||||
|
|
||||||
|
var x = @[42,4242]
|
||||||
|
x.delete(1)
|
||||||
|
echo x
|
||||||
|
x.insert(24)
|
||||||
|
echo x
|
||||||
Loading…
Add table
Add a link
Reference in a new issue