Commit Graph

117 Commits

Author SHA1 Message Date
narimiran
100d6a1960 close #11166 by adding a test
(cherry picked from commit 3ccda773d6)
2019-08-12 10:52:05 +02:00
Araq
6f214131a2 JS codegen: supports toOpenArray [bugfix]
(cherry picked from commit eaf4b42ff9)
2019-07-15 08:03:53 +02:00
Andreas Rumpf
1c64934f46 implement system.default for the JS target 2019-03-05 19:58:54 +01:00
Araq
257965e105 fixes 10697 [backport] 2019-02-19 11:56:14 +01:00
Araq
b081eb4d6d fixes #10651 2019-02-14 15:55:38 +01:00
rec
f5cc2e2de5 Fixes 10202 (#10283)
* Add a test case for #10202
* Fix asgn for object tyVars; fixes #10202
* Check the variant kind before accessing the sym field
2019-01-12 19:49:31 +01:00
rec
ba7d33b4e4 Guard against null exception (#10162) 2019-01-04 15:05:03 +01:00
Alexander Ivanov
aadbdd6b06 Support undefined in isNil (#9960) 2018-12-30 02:48:37 +01:00
Yuriy Glukhov
39a8ab469a Fixed insert for nil seq in js (#10068) 2018-12-21 22:45:20 +01:00
rec
ca18dc2505 Make copies for params which are captured in closures. Fixes #7048 (#10050)
* Copy params which are captured in closures. Fixes #7048
* Forgot to emit a newline; minor adjustments to the test
2018-12-20 08:24:57 +01:00
recloser
19f5835d5c Fixes #10005 2018-12-15 22:57:18 +01:00
Arne Döring
a5ecbf823f lots of small changes 2018-12-11 21:23:22 +01:00
Arne Döring
465e742182 fix js category 2018-12-11 21:23:19 +01:00
rec
e3e5ae287f Fix fat pointers, object copying, magic double evals on JS (#9411) [backport]
* Add a test for issue #9389

* Fixes #9389.

* Make object contructors copy objects properly by checking whether the expressions passed to them don't need to be copied.
* Make mArrToSeq implementation actually check if a copy needs to be made.

* Avoid unnecessary copy in mChr impl

* Assume set constructor elements need no copy

* Add a test for issue #9410

* Add a test

* fix passing fat pointers (#9410)

* Enhance tests

* More tests and fixes

* Add more (failing) tests [ci skip]

* Added equality operator for fat pointers, more tests and fixes

* Fix printing uninitialized strings

* Fix mInc, mDec double eval, add more tests

* Tests

* Refactored, fixed multiple evals, revamped the tests, added missing ops

* Fix ups

* Fix #9643 and #9644

* add pointer normalization
2018-12-04 12:04:27 +01:00
Alexander Ivanov
88d707cb88 Support only some types as JsAssoc types (#8627) 2018-11-23 15:05:15 +01:00
recloser
2b03bed2db Fix printing and comparing uninitialized strings 2018-10-21 21:18:10 +02:00
LemonBoy
ee14ace5d3 Field checks for everybody (#8957)
* Field checks for JS backend

* Clean nkCall nodes with no arguments

Generating a nkEmpty in place of no arguments makes no sense form the
AST point of view and also trips up the VM codegen.

* Field checks for VM backend

* Test case for #6612

This patchset fixes #6612

* Add test case for LHS double evaluation

* Prevent LHS double-eval for JS backend

* Prevent double evaluation in VM backend
2018-10-09 19:54:12 +02:00
LemonBoy
a3fb0a769c Try/Catch support for native JS exceptions (#8955)
* Try/Catch support for native JS exceptions

* Better tests
2018-10-09 19:51:29 +02:00
LemonBoy
b195204549 Fix add(string, cstring) when the lhs is null (#8951) 2018-09-12 10:10:00 +02:00
LemonBoy
87955eaf30 Fix concat behaviour for uninitialized strings (#8950) 2018-09-11 23:35:21 +02:00
LemonBoy
3f16711254 Fix insert/delete for JS (#8915)
Fixes #8914
2018-09-08 10:38:18 +02:00
LemonBoy
91b37311d9 Fix AST generation for case statements (#8908)
Fixes #7534
2018-09-07 21:07:06 +02:00
LemonBoy
84eab97fed Sync line generation between C and JS backends (#8888)
Fixes #7224
2018-09-07 01:56:36 +02:00
LemonBoy
af1e84f54d Automatic deref for everything but pointers in asm/emit (#8891)
Fixes #7249
2018-09-07 01:54:59 +02:00
LemonBoy
1a60ffcf1d Correctly mangle this in the JS backend (#8853)
As shown in pragmagic/karax#67 using `this` as parameter name made the
codegen output wrong code (and the user didn't notice the errors in the
browser console).
2018-09-03 17:51:30 +02:00
Araq
e0fd1cdb5f fix items for cstring for the JS target; makes tests green again 2018-09-03 11:13:59 +02:00
Oscar Nihlgård
1d93991929 Cleanup ttimes (#8714)
* Refactor fromWinTime

* Cleanup ttimes
2018-08-22 17:20:41 +02:00
Oscar Nihlgård
33ed8f7e73 times.Timezone changes (#8527)
* Use floorDiv in times.nim

* New implementation of times.Timezone

* Tweak doc comments

* Fix typo
2018-08-17 11:12:58 +02:00
Andreas Rumpf
9f31096870 make JS tests green 2018-08-13 12:51:31 +02:00
Oscar Nihlgård
3b310e91cd New implementations of times.parse & times.format (#8094) 2018-07-09 20:04:25 +02:00
genotrance
c115090f6e Testament should run tests with no action (#8232)
* Testament should run tests with no action

* Fix strutils tests for JS
2018-07-08 20:38:46 -04:00
treeform
b98cd3bf34 Fix cmpStrings in js mode (#7604) 2018-04-15 17:34:03 +02:00
Andreas Rumpf
6ae9341d48 make JS tests green again 2018-04-14 00:54:15 +02:00
Andreas Rumpf
d7cc9016f3 fixes #4470 2018-04-13 23:41:31 +02:00
Oscar Nihlgård
f6df2d9956 Sub second time resolution (#6978)
* Add deprecation warnings to recently deprecated procs

* Fix bad usage of the times module

* Introduce sub second resolution

* Fix usage of C's time()

* Switch to nanosecond resolution

* Make Time & Duration opaque again and fix some errors

* Change back to TimeInterval for shorthands

* Fix JS test

* Fix build error for windows

* Undeprecate epochTime

* Documentation and minor changes

* Lots of bugfixes and doc comments

* Attempt to make travis & appveyor green

* Fix edge cases for dealing with the local timezone

* Workaround JS backend overflow/underflow bug

* Use better workaround for not knowing the size of time_t

* Use all available timezones for tests

* Fix indentation

* Add procs for accessing the fractional part of a duration

* Order time units from smallest to largest since it makes more sense

* Include months and years in `TimeUnit`

* Review fix
2018-04-13 07:36:30 +02:00
Alexander Ivanov
b6c69dd45e Use addPragma 2018-03-05 10:28:17 +02:00
Alexander Ivanov
3bffbf5a4d Stop replacing all pragmas of a function with asyncjs 2018-03-03 16:53:28 +02:00
Alexander Ivanov
9c7374abcd Fix return (#7225) 2018-02-27 15:23:19 +01:00
Yuriy Glukhov
0b9c1da1c0 Fixes #6741 (#7131) 2018-01-25 04:26:40 +01:00
Yuriy Glukhov
c93655e8b4 Unify async macro and futures for js and native targets 2018-01-05 16:40:51 +02:00
Alexander Ivanov
7b495e23d4 Fix the forward test 2017-12-20 14:09:02 +02:00
Alexander Ivanov
7f6afa9e9b Make asyncjs Future[void] play nicely with last line discardable calls 2017-12-19 13:57:37 +02:00
Alexander Ivanov
a9ba02e8c9 added asyncjs standard library module (#6841) 2017-12-19 00:34:54 +01:00
GULPF
a879973081 Better times module (#6552)
* First work on better timezones

* Update tests to new api.
Removed tests for checking that `isDst` was included when formatting, since `isDst` no longer affects utc offset (the entire utc offset is stored directly in `utcOffset` instead).

* Deprecate getLocaltime & getGmTime
* Add `now()` as a shorthand for GetTIme().inZone(Local)
* Add FedericoCeratto's timezone tests (#6548)
* Run more tests in all timezones

* Make month enum start at 1 instead of 0
* Deprecate getDayOfWeekJulian
* Fix issues with gc safety
* Rename TimeInfo => DateTime
* Fixes #6465
* Improve isLeapYear
* FIx handling negative adjTime

* Cleanup:
- deprecated toSeconds and fromSeconds, added fromUnix and toUnix instead (that returns int64 instead of float)
- added missing doc comments
- removed some unnecessary JS specific implementations

* Fix misstake in JS `-` for Time

* Update usage of TimeEffect
* Removed unecessary use of `difftime`
* JS fix for local tz
* Fix subtraction of months
* Fix `days` field in `toTimeInterval`
* Style and docs
* Fix getDayOfYear for real this time...
* Fix handling of adding/subtracting time across dst transitions
* Fix some bad usage of the times module in the stdlib
* Revert to use proper time resoultion for seeding in random.nim
* Move deprecated procs to bottom of file
* Always use `epochTime` in `randomize`
* Remove TimeInterval normalization
* Fixes #6905

* Fix getDayOfWeek for year < 1
* Export toEpochDay/fromEpochDay and change year/month/monthday order
* Add asserts for checking that the monthday is valid
* Fix some remaining ambiguous references to `Time`
* Fix ambiguous reference to Time
2017-12-18 23:11:28 +01:00
Fabian Keller
6df6ec27ec Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
Alexander Ivanov
1699d7c2a4 Implement codegenDecl for js (#6851) 2017-12-01 15:42:10 +01:00
Andreas Rumpf
fe18769fe1 fixes #6753 2017-11-22 12:58:03 +01:00
Araq
fba5f5acd6 added a version of macros.expectLen that takes min/max values 2017-11-21 01:42:53 +01:00
skilchen
e4b0818629 fixes #6532 array bounds check for non zero based arrays on the js backend (#6550) 2017-11-06 09:14:28 +01:00
Andreas Rumpf
e8eb496e6f make tests green again 2017-09-30 22:34:54 +02:00