-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
JS: adding to uninitialized seq/string inside object variant is no-op #14117
Comments
Codegen for var Tmp1;
var Tmp2;
var a_622008 = [{kind: true, sons: null}];
var Tmp1 = a_622008[0];
if (ConstSet1[Tmp1.kind]===undefined) { raiseFieldError(makeNimstrLit("\'sons\' is not accessible using discriminant \'kind\' of type \'A\'")); }
if ((Tmp2 = Tmp1.sons, Tmp2) != null) { Tmp2.push(1); } else { Tmp2 = [1]; }; Codegen if you remove var a_622007 = [{sons: null}];
if (a_622007[0].sons != null) { a_622007[0].sons.push(1); } else { a_622007[0].sons = [1]; }; |
This was referenced Apr 26, 2020
Merged
Araq
pushed a commit
that referenced
this issue
Apr 29, 2020
* many bugfixes for js fixes #12672, fixes #14153, closes #14123, closes #11331, fixes #11783, fixes #13966, fixes #14087, fixes #14117, closes #12256. mostly fixes the fact that it was allowed to assign to newly created temp variables. additionally attempts to get rid of null initialized seqs/strings (though they might pop up here and there); this simplifies a lot of things and makes code size smaller. even if null seqs/strings pop up here and there it's still better than all those bugs existing. * formatting fixes * CI fixes * more CI fixes
EchoPouet
pushed a commit
to EchoPouet/Nim
that referenced
this issue
Jun 13, 2020
* many bugfixes for js fixes nim-lang#12672, fixes nim-lang#14153, closes nim-lang#14123, closes nim-lang#11331, fixes nim-lang#11783, fixes nim-lang#13966, fixes nim-lang#14087, fixes nim-lang#14117, closes nim-lang#12256. mostly fixes the fact that it was allowed to assign to newly created temp variables. additionally attempts to get rid of null initialized seqs/strings (though they might pop up here and there); this simplifies a lot of things and makes code size smaller. even if null seqs/strings pop up here and there it's still better than all those bugs existing. * formatting fixes * CI fixes * more CI fixes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example
Current Output
Expected Output
Additional Information
parsesql
for JS (with StringStream & more stdlib modules support for JS/NimScript #14095) and probably way more standard library modules that I haven't tested yet.The text was updated successfully, but these errors were encountered: