Commit Graph

55 Commits

Author SHA1 Message Date
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
Silvio
2946c7a4b9 Implementing repr for JS (#5578) 2017-03-31 22:00:48 +02:00
Konstantin Molchanov
0c121b38ec Tests: JS: Times: Fix text so that it works in timezones other then UTC+4.
`parse` returns TimeInfo with the local timezone, which may not be the same as the one in the original string. To compare the moments encoded in the original string and returned by `parse`, we normalize them to UTC.
2017-03-29 16:42:48 +04:00
Konstantin Molchanov
35cdb42e02 Tests: Times: JS: Add test for timestamp persistence. 2017-03-27 22:08:43 +04:00
Konstantin Molchanov
cc9d282348 Tests: Times: JS: Local timezone assignment during Time to TimeInfo conversion. 2017-03-27 22:01:37 +04:00
Konstantin Molchanov
41e83f7a34 Tests: Times: JS: Fix test. 2017-03-27 21:28:31 +04:00
Konstantin Molchanov
1a5e880f5a Tests: Times: JS: Add test for yearday attribute. 2017-03-27 21:14:02 +04:00
Silvio
51cd3bd86f Fixes #5062 (#5527); JS: holes in enums 2017-03-15 10:33:37 +01:00
Michael Jendrusch
d75760f5d3 made nodecl implicit for vars in the js backend. (#5297) 2017-01-29 17:34:08 +01:00
Michael Jendrusch
536015ee7b Implement RFC #4873 improvements to JavaScript FFI (#5213) 2017-01-26 00:07:30 +01:00
shsnow23
c7e54eba91 fix genderef of jsgen (#5274) 2017-01-24 16:59:34 +01:00
Michael Jendrusch
953b8cbcc2 fixes #5234 (#5240) 2017-01-20 05:16:42 +01:00
Yuriy Glukhov
05dec08cea Fixes #5244 (#5245) 2017-01-18 20:13:08 +01:00
Michael Jendrusch
454547da8e Removed mangling of object fields for the js target only. (#5226)
* removed mangling of object fields for the js target only.

* changed default mangling behaviour for the php target as well.

* Added test for unorthodox field names (reserved words and operators). Adjusted field accessors and object constructors / new to be ECMAScript first edition compatible, when using fieldnames which are reserved words.
2017-01-17 16:43:06 +01:00
Andrea Ferretti
4c52239394 Updated js console logging to avoid wrapping into array 2016-10-06 10:54:52 +02:00
Andrea Ferretti
693b2b0f5d Added js console object 2016-09-21 17:35:45 +02:00
Yuriy Glukhov
82b022ebc6 JS: Fixed ICE on ptr assignment 2016-09-20 17:01:53 +03:00
Felix Krause
eeb8024af4 Fixed another test to expect new unittest output 2016-08-24 23:37:43 +02:00
Andreas Rumpf
7a018007a4 fixes #4471 2016-07-12 00:50:25 +02:00
Andreas Rumpf
95bb19a579 moved random procs from math to its own module (breaking change) 2016-05-30 16:24:52 +02:00
Yuriy Glukhov
4d0d2d69f3 Fixes #4222 2016-05-26 08:49:56 +03:00
Dmitry Polienko
55c3b1444d Slightly better test case
Tests identity rather than exact output.
2016-05-20 16:03:08 +06:00
nigredo-tori
85c41a1398 Fix toJSStr for control characters
fixes #4190
Add leading zero to encoded character if it is less than 0x10
2016-05-20 12:35:34 +06:00
Yuriy Glukhov
2bf6f57930 Added js closures test. Fixes #3132. 2016-04-07 22:57:35 +03:00
Yuriy Glukhov
c3d09aeeac Fixed unicode strings in JS 2016-01-22 11:24:00 +02:00
Araq
7ee1847137 fixes #3584 2016-01-18 14:54:35 +01:00
Adam Strzelecki
e80465dacf tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:04:32 +02:00
Yuriy Glukhov
a66b968d3b Fixed passing byvar 2015-08-25 15:47:34 +03:00
Yuriy Glukhov
a5be556a4c Untyped pointers godegen changed. addr expression fixed. 2015-08-21 13:29:25 +03:00
Andreas Rumpf
2782cddb56 Merge pull request #2903 from yglukhov/js-bracket-addr
Fixed addr of bracket expression. Fixes #2148.
2015-06-13 20:31:47 +02:00
yglukhov
6436d1920c Fixed copying of aggregates in JS. 2015-06-11 23:32:08 +03:00
yglukhov
f47081b300 Fixed addr of bracket expression. Fixes #2148. 2015-06-11 18:32:22 +03:00
Andreas Rumpf
62376c0657 Merge pull request #2824 from yglukhov/js-ct-lambda-lifting
Perform lambda lifting for compile-time stuff when targeting JS.
2015-06-05 13:04:02 +02:00
yglukhov
e9a57e9706 Fixed codegen for DotDot magic 2015-06-04 12:00:27 +03:00
yglukhov
c5f7d553e9 Perform lambda lifting for compile-time stuff when targeting JS. Enable unittest test. 2015-05-29 10:48:14 +03:00
Araq
8d508162e8 added missing test 2015-05-28 12:51:18 +02:00
yglukhov
b4843bc7c1 Enabled taddr and testobjs tests 2015-05-27 11:36:45 +03:00
yglukhov
d3c4c7c52f Fixes #2798 2015-05-26 16:00:48 +03:00
Araq
54515241e3 fixes #2581 2015-04-22 12:04:10 +02:00
Araq
5146624f0d disabled JS test 2015-04-18 01:18:23 +02:00
Oleh Prypin
57250ad281 Test JS proc header codegen 2015-04-09 04:21:50 +03:00
Dominik Picheta
1e9ab3bb0a Fixes #2323. Fixes #2148. 2015-03-15 22:06:26 +00:00
Simon Hafner
11292a9e0b Fixes #1959, rounding floats in JS 2015-01-29 05:30:55 -06:00
Araq
c91cf3068f JS tests cleaned up 2014-12-17 01:43:36 +01:00
juxiliary
cd0f17202e Fixing extraneous semicolon in jsgen output
jsgen was producing javascript objects like this
```
{, name:"foo"}
```
causing syntax errors in javascript interpretors.
2014-12-06 21:57:20 +10:00
Araq
51dd4b7601 fixes #1489, fixes #1490 2014-11-28 18:15:06 +01:00
Dominik Picheta
2fb5d62927 Tester now appreciates the test target. Modified 'cmd' in specs. 2014-04-16 21:28:19 +01:00
Simon Hafner
ab31ad2704 don't mess with semfold, use vars instead 2013-09-26 15:10:54 -05:00