You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was puzzled by the fact that my js stacktraces were missing depending on some obscure conditions.
It turns out it's caused by 2 bugs:
bug 1: nim js: appending a uninitialized string appends a null char '\0'
this is related to #11783 but seems different, as the bug in #11783 was only present when both appended and appendee were uninitialized, which isn't the case here.
Example
procfun(): string=# result = "" # this removes the bugdiscardvar ret ="foo1"
ret.addfun()
# ret.add string.default # ditto with this# ret.add "" # ditto with this
ret.add"foo2"echo (ret, )
# using charCodeAt: reveals a 0log(ret,)
doAssertfalse, ret
("foo1\x00foo2",) should be ("foo1foo2",), and backtrace shouldn't truncate:
("foo1foo2",)
foo1foo2
/Users/timothee/git_clone/nim/timn/tests/nim/all/t0552.js:465
throw new Error(cbuf_294801);
^
Error: Error: unhandled exception: /Users/timothee/git_clone/nim/timn/tests/nim/all/t0552.nim(17, 10) `false` foo1foo2 [AssertionError]
Traceback (most recent call last)
assertions.nim:27 assertions.failedAssertImpl
assertions.nim:20 assertions.raiseAssert
fatal.nim:39 sysFatal.sysFatal
at unhandledException (/Users/timothee/git_clone/nim/timn/tests/nim/all/t0552.js:465:11)
at raiseException (/Users/timothee/git_clone/nim/timn/tests/nim/all/t0552.js:266:3)
at sys_fatal_288262 (/Users/timothee/git_clone/nim/timn/tests/nim/all/t0552.js:674:3)
...
bug 2:
the fact that the backtrace is truncated (missing all the stackframes) is actually a node bug, which i just filed here: nodejs/node#28761 ; it's just been confirmed
EDIT: that node bug itself just got fixed
Additional Information
Your Nim version (output of nim -v).
latest devel f50e450
The text was updated successfully, but these errors were encountered:
I was puzzled by the fact that my js stacktraces were missing depending on some obscure conditions.
It turns out it's caused by 2 bugs:
bug 1: nim js: appending a uninitialized string appends a null char '\0'
this is related to #11783 but seems different, as the bug in #11783 was only present when both appended and appendee were uninitialized, which isn't the case here.
Example
Current Output
nim js -r main.nim
Expected Output
("foo1\x00foo2",) should be ("foo1foo2",), and backtrace shouldn't truncate:
bug 2:
the fact that the backtrace is truncated (missing all the stackframes) is actually a node bug, which i just filed here: nodejs/node#28761 ; it's just been confirmed
EDIT: that node bug itself just got fixed
Additional Information
nim -v
).latest devel f50e450
The text was updated successfully, but these errors were encountered: