summary refs log tree commit diff stats
path: root/compiler/jsgen.nim
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Remove ENDB (#12095)Clyybber2019-08-311-5/+1
|
* Fix to int to biggest int (#12066)Arne Döring2019-08-271-8/+0
| | | | | * fix to(Biggest)Int * kill toFloat magics as well
* fixes #10053 (#11951)Timothee Cour2019-08-151-1/+2
|
* int128 on firstOrd, lastOrd and lengthOrd (#11701)Arne Döring2019-08-071-4/+4
| | | | * fixes #11847
* [refactoring] remove unused imports in the compiler and in some stdlib modulesAraq2019-07-181-4/+4
|
* JS codegen: supports toOpenArray [bugfix]Araq2019-07-121-3/+9
|
* there is only one style -- my styleAraq2019-07-101-5/+5
|
* styleCheck: make the compiler and large parts of the stdlib compatible with ↵Araq2019-07-101-13/+13
| | | | --styleCheck:error
* [refactoring] remove zeroExtend and friends from the compiler builtins. (#11531)Arne Döring2019-06-241-18/+0
| | | | | * remove zeroExtend and friends from the compiler builtins. * fix jssys
* Correct global destructor injections for js backend (#11240)Clyybber2019-05-151-0/+3
|
* rename tyExpr/tyStmt to tyUntyped/tyTyped (#11227)Arne Döring2019-05-111-1/+1
|
* Replace countup(x, y) with x .. yClyybber2019-05-071-3/+3
|
* Replace countup(x, y-1) with x ..< yClyybber2019-05-071-17/+17
|
* fixes #11133, error on runtime use of compile-time procs in JS target (#11134)jrfondren2019-04-291-0/+3
|
* added system.unown to make 'owned' sane to use in practice; later on we ↵Araq2019-04-291-1/+1
| | | | might change the type inference rules to make it more convenient
* fewer ropes (#11037)Arne Döring2019-04-191-108/+203
|
* Compiler plugin for implementing incremental computation in user space (#10819)cooldome2019-04-111-1/+3
| | | | | | | | | | This plugin provides essential building block for implementing incremental computations in your programs. The idea behind incremental computations is that if you do the same calculation multiple times but with slightly different inputs you don't have to recompute everything from scratch. Also you don't want to adopt special algorithms either, you would like to write your code in standard from scratch manner and get incrementality for free when it is possible. The plugin computes the digest of the proc bodies, recursively hashing all called procs as well . Such digest with the digest of the argument values gives a good "name" for the result. Terminology loosely follows paper "Incremental Computation with Names" link below. It works well if you have no side effects in your computations. If you have global state in your computations then you will need problem specific workarounds to represent global state in set of "names" . SideEffect tracking in Nim also useful in this topic. Classical examples: Dashboard with ticking data. New data arrives non stop and you would like to update the dashboard recomputing only changed outputs. Excel spreadsheet where user changes one cell and you would like to recompute all cells that are affected by the change, but do not want to recompute every cell in the spreadsheet.
* more destructor based changes (#10885)Andreas Rumpf2019-03-231-1/+1
| | | | | | | | | | | * mark user defined destructors with sfOverriden to simplify the logic * refactoring in preparation to merge liftings and generic instantiations for destructors * ast: introduce nkHiddenTryStmt for destructor generation in order to be able to optimize better the code later on * renamed 'patterns' switch to 'trmacros' as it was totally misleading before * destructors: introduce tfCheckedForDestructor flag in preparation of strict =destroy checking * test for invalid/too late destructor introductions * liftdestructors: make code robust for nimsuggest * --newruntime works for hello world again * newruntime: code generation for closures
* implement system.default for the JS targetAndreas Rumpf2019-03-051-11/+16
|