[resolved] JsBigInt as primitive type, not ref type (for js BigInt PR 16409) #513
Replies: 5 comments 5 replies
-
|
If you remove the I dont know, I am neutral to this, but would be nice to not block the PR way too long, is +90% done. How other JS modules do it then?. |
Beta Was this translation helpful? Give feedback.
-
|
I think I have a perfect solution: nim-lang#16606 |
Beta Was this translation helpful? Give feedback.
-
|
this has been incorporated; (is there a way to close conversations, like we close PRs/issues ?) deleting is obviously bad, so is freezing; I miss following features: closing/re-opening, and adding labels EDIT: i guess that's community/community#3097 and community/community#19 |
Beta Was this translation helpful? Give feedback.
-
|
I see a |
Beta Was this translation helpful? Give feedback.
-
|
Some "Categories" have the option to mark as "Resolved", |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
refs nim-lang#16409 (comment)
instead of
type JsBigInt* = ref object of JsRootwhich gives incorrect ref semantics to jsBigInt, I propose this:it seems like a strict improvement over
type JsBigInt* = ref object of JsRootbut there's 1 more problem to address: the last assert fails (note: it would still fail withtype JsBigInt* = ref object of JsRoot)this may require a codegen fix, which could be backported if we want 1.0.x and 1.2.x to be able to use jsBigInt
alternatives
type JsBigInt* = ref object of JsRootwould fail here:echo z, giving:result_704643094 = nimCopy(null, cstrToNimstr(this_704643093.toString()), NTI33554437);and the
nimCopyis inefficienttype JsBigInt* = object of JsRootwould fail here:for i in z1 .. z2:would be skipped, anddoAssert a == big"4"would failtype JsBigInt* = distinct intwould also work (might be simpler in fact)links
D20210105T181036
Beta Was this translation helpful? Give feedback.
All reactions