Commit Graph

102 Commits

Author SHA1 Message Date
narimiran
2d1dea9484 keep only the relevant part of tbasics test 2019-02-21 08:56:43 +01:00
Araq
32780acc61 fixes 10697 [backport]
(cherry picked from commit 257965e105)
2019-02-20 19:46:19 +01:00
recloser
fdce2e0188 Fix printing and comparing uninitialized strings
(cherry picked from commit 2b03bed2db)
2018-11-01 17:55:20 +01: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
Zahary Karadjov
7ad115f530 Restore the old behavior of parsing "quote do:"
close #5845
2017-08-19 08:57:43 +02:00
andri lim
c245cfc1fd fixes #5986 js backend failed to compile try ... except new syntax (#6116) 2017-07-17 08:07:47 +02:00
Andreas Rumpf
5932ad9ae8 fixes a JS codegen regression 2017-07-10 16:40:23 +02:00
Andreas Rumpf
674db58a24 fixes #5608 2017-07-09 12:03:50 +02:00
Araq
4de989d1c5 fixes #6035 2017-06-30 12:01:51 +02:00
Andreas Rumpf
d9d61fbeb4 fixes #5517 2017-06-30 00:43:19 +02:00
Andreas Rumpf
ad64b66df1 closes #5379 2017-06-29 20:41:48 +02:00
Andreas Rumpf
ac63a99892 fixes #5974 2017-06-29 20:25:42 +02:00
Andreas Rumpf
5d6c2f89de fixes #4703 2017-06-29 18:37:53 +02:00
Andreas Rumpf
a8a5d44e5d make JS tests green on OSX on my local machine; XXX needs further investigations 2017-06-26 08:49:52 +02:00
Andreas Rumpf
42c9bb3ace fixes #5933 2017-06-03 21:08:32 +02:00
zah
39aef12446 review and merge zahary's work (#5849)
* proper indentation for the generated JS code
* improved dead-code elimination for JavaScript
* test the JS dead-code elimination

A new test spec has been added - "maxcodesize". It specifies the
maximum size of the generated code in bytes.
2017-06-03 12:45:10 +02:00
Zahary Karadjov
03770daba4 allow StmtLists to pass through semExprWithType
This fix was necessary in order to fix the lambda lifting used in
the "jsffi" module, which relies on turning nkStmtList into nkLambda
in a catch-all dot operator.
2017-04-11 02:22:13 +03:00
Zahary Karadjov
a3f19c87fb lift parameter-less do block to lambdas 2017-04-10 23:58:05 +03:00
Zahary Karadjov
48a1a54d1c improve the usability of the jsffi module
* All JavaScript operators are usable with JsObject
* The dot operators will use native JavaScript strings
* Results returned from dot calls are consired discardable
2017-04-09 23:04:55 +03:00