summary refs log tree commit diff stats
path: root/compiler/jsgen.nim
Commit message (Collapse)AuthorAgeFilesLines
* array literals uses typed arrays; fix a jsgen bug (#16850)flywind2021-02-151-16/+39
| | | | | | | * array litterals uses typed arrays * Update compiler/jsgen.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* [backport:1.4] JS cstring null fixes (#16979)hlaaftana2021-02-111-3/+19
| | | | | * [backport:1.4] JS cstring null fixes * fix JS move string * make it look cleaner
* [JS] Ref #15952 make toOpenArray works better (#17001)flywind2021-02-101-10/+19
| | | | | * ref 15952 toOpenArray works in JS * fix
* fix #16822 (#16884)flywind2021-02-011-2/+2
| | | | | | | | | * see whether it breaks * fix #16884 * correct * fix #14574
* fix negative nan (#16628)flywind2021-01-111-1/+4
|
* IC: next steps (#16550)Andreas Rumpf2021-01-071-3/+3
| | | | | | | | | | | | | | | | | | * cleanups * ast.nim: cleanups * IC: no more sym.tab field, stored externally in the module graph * nimble compiles again * rodfiles: store bitwidth of integers and the endianness in the cookie because we serialize 'int' directly * rodfiles: added compilerproc and export sections * rodfiles: added all the missing sections * rodfiles: track the missing information * IC: architecture for lazy loading of proc bodies * make tests green again * completed the lazy loading of proc bodies * symbol lookup integration, part 1 * symbol lookup integration, part 2 * symbol lookup integration, part 3 * make tcompilerapi work again * rodfiles: fixed config change handling
* [backport 1.0] add backend support for js bigint (#16606)Timothee Cour2021-01-061-1/+4
| | | | | | | | | | | | | * add backend support for js bigint * cleanup * add tests * add -d:nimHasJsBigIntBackend * cleanup * more tests
* ref #16054 remove typed array (#16077)flywind2020-11-241-8/+0
|
* fix #12303 (#15964)flywind2020-11-141-2/+7
|
* Fix #8404 JS backend doesn't handle float->int type conversion (#15950) ↵Bung2020-11-131-3/+9
| | | | | | | | | | | [backport] * Fix #8404 JS backend doesn't handle float->int type conversion * handle conv to uint as cast, discard other cases * limit to int32, times use int64 * toInt including tyInt64 break times timezones lib, ignore for now * also affect to vm * move to tests/misc/t8404.nim
* fix #14157 (#15877)flywind2020-11-121-0/+4
| | | | | | | | | | | | | * fix #14157 * Update compiler/jsgen.nim * add changelog * Update compiler/jsgen.nim * Update tests/js/tmodify_cstring.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Fix 14127 js from int to int casting (#15918)Bung2020-11-111-2/+1
| | | | | | | | | * fix #14127 from int to int casting * add test for #14127 * use template for test, also test uint2int * move to tests/types/t14127_cast_number.nim targets:c cpp js
* follow #15818 and close #7109 (#15823)flywind2020-11-021-2/+5
| | | | | | | | | * follow #15818 and close #7109 * Update compiler/jsgen.nim Co-authored-by: Juan Carlos <juancarlospaco@gmail.com> Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
* fix #8821 (#15809)flywind2020-11-021-0/+5
|
* fix #15651 (#15800)flywind2020-10-311-0/+1
| | | | | * fix * minor
* [closes #11625 and closes #2488]add global and threadvar(with ↵flywind2020-10-301-1/+6
| | | | | | | | | | | | | | | `--threads:off` mode ) pragmas supports for JS backend (#15772) * add global pragma support for js backend * globalThis * add support for threadvar * more tests * Update compiler/jsgen.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fix #15638 (#15789)flywind2020-10-301-0/+1
|
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-8/+10
| | | | | | | | | | | | | | | | | * refactoring: idents don't need inheritance * refactoring: adding an IdGenerator (part 1) * refactoring: adding an IdGenerator (part 2) * refactoring: adding an IdGenerator (part 3) * refactoring: adding an IdGenerator (part 4) * refactoring: adding an IdGenerator (part 5) * refactoring: adding an IdGenerator (part 5) * IdGenerator must be a ref type; hello world works again * make bootstrapping work again * progress: add back the 'exactReplica' ideas * added back the missing exactReplica hacks * make tcompilerapi work again * make important packages green * attempt to fix the build for 32 bit machines (probably need a better solution here)
* avoid #8231, bitwise move to mul,div (#15070)Bung2020-08-251-2/+10
| | | | | | | | | * avoid #8231, bitwise move to mul,div * add test for #8231 * fix bitwise move when div result is float * bitwise move depends on typ.size
* fix #11354 jsgen not carefully handle genAddr with nkHiddenAddr,nkStm… ↵Bung2020-07-271-1/+10
| | | | | | | | | | | | | | | | | | | (#15078) * fix #11354 jsgen not carefully handle genAddr with nkHiddenAddr,nkStmtListExpr; genAsgn with lvalue tyVar and rvalue tyPtr * correct logic * add test for #11354 * handle nkHiddenAddr when n.len == 1 * Update compiler/jsgen.nim * Update compiler/jsgen.nim * Apply suggestions from code review Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fix #14534 (#15060) [backport]Bung2020-07-251-1/+1
|
* 'isolate' builtin; refs https://github.com/nim-lang/RFCs/issues/244 (#15011)Andreas Rumpf2020-07-201-1/+1
|
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-1/+1
| | | | | | | | | | | * I don't care about observable stores * enforce explicit initializations * cleaner code for the stdlib * stdlib: use explicit initializations * make tests green * algorithm.nim: set result explicitly * remove out parameters and bring the PR into a mergable state * updated the changelog
* remove tyOpt, mOpt (#14636)Timothee Cour2020-06-121-4/+5
| | | | | * remove tyOpt, mOpt * fixup
* fix #14576 addr of param (including for lent) now works with nim js (#14577)Timothee Cour2020-06-061-2/+9
| | | | | * fix #14576 addr(param) now works in nim js * workaround https://github.com/nim-lang/Nim/issues/14578
* Fix #14570 (#14571)Danil Yarantsev2020-06-061-1/+1
| | | | * Fix #14570
* fix #14350, cstrings in JS init as null (#14355)hlaaftana2020-05-151-3/+1
| | | | * fix #14350, cstrings in JS init as null
* fix js stacktraces, unify all file,line,col formatting into a single ↵Timothee Cour2020-05-051-2/+2
| | | | | function (#14230) * fix https://github.com/timotheecour/Nim/issues/135 ; unify all file,line,col formatting into a single function
* many bugfixes for js (#14158)hlaaftana2020-04-291-30/+90
| | | | | | | | | | | | | * 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
* Fix negative indexed arrays for JS, refs #13966 (#14152)hlaaftana2020-04-291-4/+4
| | | | | * Fix negative arrays for JS, refs #13966 * small extra fix: no need to .slice() cstring in JS
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-4/+4
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* `$(a: float)` now works consistently in nim js, avoiding printing floats as ↵Timothee Cour2020-04-271-6/+7
| | | | | | | | | ints (#14134) * fix https://github.com/timotheecour/Nim/issues/133; $(a: float) works in nim js like in other backends * fix tests * fix test for windows that prints 1.1e17 differently than other OS
* Make JS not mangle to snake_case (#14086)hlaaftana2020-04-241-5/+1
|
* Remove my wrongly written mangled-related code, not needed anymore (#13858)Alexander Ivanov2020-04-031-8/+1
|
* sourcemaps for the JS codegen (#7508)Alexander Ivanov2020-04-031-9/+33
|
* fix operators containing percent for VM usage (#13536)Arne Döring2020-03-111-65/+61
| | | | * fixes #13513 * merge tarithmetics in tarithm
* Remove dead magics (#13551)Arne Döring2020-03-031-12/+2
|
* Remove genToArray in jsgen, a PHP remnant (#13466)hlaaftana2020-02-221-20/+0
|
* fixes #9674 [backport] (#13143)Andreas Rumpf2020-01-141-1/+12
|
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-306/+302
| | | | | | | | | | | | | | | | | | * Cleanup compiler code base * Unify add calls * Unify len invocations * Unify range operators * Fix oversight * Remove {.procvar.} pragma * initCandidate -> newCandidate where reasonable * Unify safeLen calls
* Improve head comment on JS (#12548)Juan Carlos2019-11-221-15/+13
| | | | | | * Improve comment on JSGen, replace 12+ concatenations by 1 multiline string * Peer review feedbacks https://github.com/nim-lang/Nim/pull/12548#discussion_r340051147
* conversions to unsigned numbers are not checked anymore; implements /… ↵Andreas Rumpf2019-11-201-1/+4
| | | | | | | | (#12688) [backport] * conversions to unsigned numbers are not checked anymore; implements / fixes https://github.com/nim-lang/RFCs/issues/175 * change the spec yet again to be less consistent but to make more sense; updated the changelog
* ARC: solves phase ordering problems (#12654)Andreas Rumpf2019-11-141-3/+8
|
* JS improve indent (#12581)Juan Carlos2019-11-031-1/+1
| | | | * JSgen make indent be all spaces, instead of mixed spaces and tabs, for generated JS
* Fix jsgen bug with uninitialized seq (#12500) [backport]Oscar Nihlgård2019-10-241-1/+1
|
* Sets need copying in JS (#11392)hlaaftana2019-10-021-1/+1
| | | | | | * Sets need copying in JS * Fixes #11353 * Add test for #11353
* fixes #12240 [backport] (#12308)Andreas Rumpf2019-10-011-1/+9
|
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-28/+28
| | | | | * Remove sonsLen * Use Indexable
* fix min/max for float numbers (#12068)Arne Döring2019-09-021-6/+0
|
* Allow typeof(nil) as a return typeAlbert Safin2019-08-311-0/+2
|