summary refs log tree commit diff stats
path: root/compiler/jsgen.nim
Commit message (Collapse)AuthorAgeFilesLines
* fixes #18469 (#18544)Andreas Rumpf2021-07-201-10/+0
| | | | | * fixes #18469 * Update compiler/injectdestructors.nim
* make -d:nimFpRoundtrips work consistently in vm vs rt, fix #18400, etc (#18531)Timothee Cour2021-07-201-6/+1
| | | | | | * compiler/vmhooks: add getVar to allow vmops with var params * addFloat vmops with var param * cgen now renders float32 literals in c backend using roundtrip float to string
* ORC: support for custom =trace procs (#18459)Andreas Rumpf2021-07-091-1/+1
| | | | | | | | | | | * ORC: support custom =trace procs (WIP) * Update tests/arc/tcustomtrace.nim Co-authored-by: Clyybber <darkmine956@gmail.com> * =trace is now documented and seems to work * make test green Co-authored-by: Clyybber <darkmine956@gmail.com>
* fixes #18319 (#18375)Andreas Rumpf2021-06-281-2/+12
|
* followup #18362: make `UnusedImport` work robustly (#18366)Timothee Cour2021-06-271-2/+0
| | | | * warnDuplicateModuleImport => hintDuplicateModuleImport * improve DuplicateModuleImport msg, add test
* jsgen improve spacing (#18048)Juan Carlos2021-05-201-30/+30
| | | | * Fix inconsistent spacings in generated JS of jsgen
* js generates spurious >>> on shr (#17767)Sivchari2021-04-211-2/+1
| | | | | * js generates spurious >>> on shr * Add shr arithmetic test * fix variables from const to let during testing
* CIs: attempt to use csources_v1 (#16282)Andreas Rumpf2021-04-211-1/+1
| | | | | | | | * CIs: attempt to use csources_v1 * also updated the BSDs * also updated azure pipelines * std modules should not itself use the 'std/' import dir... * compiler has to be careful with std/ for v1 booting
* cString => cSourceString; tyCString => tyCstring so that error msgs show ↵Timothee Cour2021-04-171-10/+10
| | | | cstring, not cString (#17744)
* iterable[T] (#17196)Timothee Cour2021-04-111-1/+1
| | | | | | | | * fix failing test toSeq in manual which now works * changelog * reject proc fn(a: iterable) * add iterable to spec * remove MCS/UFCS limitation that now works
* fixes #11225; generic sandwich problems; [backport:1.2] (#17255)Andreas Rumpf2021-03-091-1/+2
| | | | | * fixes #11225; generic sandwich problems; [backport:1.2] * progress * delegating these symbols must be done via 'bind'
* fix #17264 [backport:1.4] (#17266)flywind2021-03-051-2/+2
| | | | | * fix #17264 * fix vm * fix js and add tests
* new-style concepts implementation, WIP (#15251)Andreas Rumpf2021-02-241-1/+1
| | | | | | | | | | | | | * fixes #15210 [backport:1.2] * make tests green * make ordinal work * makes Swapable test compile * make Indexable example work * concepts: 'self' is now 'Self' * concepts: make Dictionary example compile * document the new concept implementation * concepts: make typeDesc work properly * concepts: allow documentation comments (d'oh)
* fix #17076 (#17081)flywind2021-02-181-1/+5
|
* JS: fix div uint64 no truncation (#16899)flywind2021-02-151-1/+4
|
* 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
|