Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sequtils insert produces wrong result in a case of sequence of objects in JS #5933

Closed
pnuzhdin opened this issue Jun 2, 2017 · 1 comment

Comments

@pnuzhdin
Copy link

pnuzhdin commented Jun 2, 2017

import sequtils

type
  Test = object
    a: cstring
    b: int

var test = @[Test(a: "1", b: 1), Test(a: "2", b: 2)]

test.insert(@[Test(a: "3", b: 3)], 0)

echo test

So nim c -r test.nim outputs @[(a: 3, b: 3), (a: 1, b: 1), (a: 2, b: 2)] as expected.
But nim js test.nim outputs @[(a: 3, b: 3), (a: 3, b: 3), (a: 2, b: 2)].

Btw,

import sequtils

var test = @[1, 2]

test.insert(@[3], 0)

echo test

Produces the same result in both cases.

@pnuzhdin
Copy link
Author

pnuzhdin commented Jun 3, 2017

Can be related to #4139.

@Araq Araq added the Javascript label Jun 3, 2017
@Araq Araq closed this as completed in 42c9bb3 Jun 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants