Commit graph

72 commits

Author SHA1 Message Date
Araq
a1beeb313f fixes #13032 2020-01-04 19:33:49 +01:00
Juan Carlos
b5bb581642 Improve Math.Trunc code emit on JS, had weird whitespaces and indents (#12549) 2019-10-30 14:12:17 +01:00
Andreas Rumpf
ba577c7e1b
better tojsstr (#11954)
* JS: rewrote toJSStr
* JS: don't raise exceptions in primitives
2019-08-16 12:18:51 +02:00
Timothee Cour
511298242d fixes #10053 (#11951) 2019-08-15 15:55:48 +02:00
Arne Döring
e90d91f0e4 [refactoring] remove zeroExtend and friends from the compiler builtins. (#11531)
* remove zeroExtend and friends from the compiler builtins.
* fix jssys
2019-06-24 09:19:02 +02:00
Timothee Cour
942495611b revive #10228 (fix #9880) (#10610)
* Make index out of bounds more useful by including the 'bounds'.
* fixes #9880 index out of bounds (remaining cases); revives #10228
* change err msg to: `index 3 not in 0 .. 1`
2019-02-13 23:30:14 +01:00
rec
ba7d33b4e4 Guard against null exception (#10162) 2019-01-04 15:05:03 +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
recloser
2b03bed2db Fix printing and comparing uninitialized strings 2018-10-21 21:18:10 +02:00
LemonBoy
9ba80d2044 JS strings have no trailing zero anymore (#8936) 2018-09-11 11:45:02 +02:00
Andreas Rumpf
696c0c48c7 fixes merge conflict 2018-08-19 15:14:03 +02:00
Andreas Rumpf
7f49364fd0 make more tests green 2018-08-13 12:29:03 +02:00
Andreas Rumpf
32afdc09c6 WIP: strings/seqs based on destructors 2018-07-17 13:19:42 +02:00
Andreas Rumpf
74bf316619 more progress on destructor based strings 2018-07-13 21:15:47 +02:00
Araq
08637bc272 JS hotfix for the Internet Explorer up to version 11 2018-05-25 23:19:54 +02:00
treeform
35b0cc67e8 Remove PHP backend. (#7606)
* remove php

* fix

* keep nimphpext

* remove targetJS enum
2018-04-18 20:40:11 +02:00
treeform
b98cd3bf34 Fix cmpStrings in js mode (#7604) 2018-04-15 17:34:03 +02:00
Andreas Rumpf
fe18769fe1 fixes #6753 2017-11-22 12:58:03 +01:00
Yuriy Glukhov
d13535471b Fixed handling of surrogate pairs (#6332) 2017-09-05 16:42:41 +02:00
Araq
f127a7f7aa fixes #6096 2017-07-17 16:43:10 +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
3993718335 JS codegen: make 'echo' use console.log unless you define -d:nimOldEcho 2017-06-28 16:18:19 +02:00
Andreas Rumpf
56a5c249c9 JS codegen: produce better code for constant sets 2017-05-01 09:30:56 +02:00
Andreas Rumpf
1268ca79e5 fixes #5599 (#5610) 2017-03-26 09:30:59 +02:00
Yuriy Glukhov
99bbda28ee Store stack trace in exception 2016-09-04 22:57:10 +03:00
Yuriy Glukhov
f12f27c185 Fixed getCurrentException and getCurrentExceptionMsg. Closes #4635 2016-08-29 13:10:06 +03:00
Yuriy Glukhov
c1dd65c01a Reset framePtr on unhabdled exception. Dont reset on getStackTrace. 2016-08-27 18:10:13 +03:00
Yuriy Glukhov
90b0a771e4 Uncaught exceptions in JS now always propagate with better stack trace. 2016-08-27 16:52:08 +03:00
Andreas Rumpf
0834cd63d9 prepare Nim codebase for upcoming parser changes 2016-07-15 12:56:03 +02: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
Andreas Rumpf
746132d696 PHP codegen improvements 2016-05-13 00:47:18 +02:00
Hans Raaf
d3bae50c3c PHP codegen array constructor hack.
Because of PHP can't have refs for literal function parameters I
needed to come up with a hack such that the following code compiles with
PHP target.

```nim
type Foo = tuple[a: string, b: int]

var foo: array [0..2, Foo]

foo[0] = ("Test", 1)
foo[1] = ("Me", 2)

for x in foo:
  echo x.a
  echo x.b
```
2016-05-11 22:51:27 +02:00
Andreas Rumpf
b48e178969 JS target improvements 2016-04-29 17:56:06 +02:00
Hans Raaf
8c1dd215ac Fix for PHP mnewString() 2016-03-06 01:03:00 +01:00
Andreas Rumpf
92cf673f37 PHP codegen: use nimAt for PHP 5.3 compatibility 2016-03-04 21:59:58 +01:00
Andreas Rumpf
8ec7c0af20 php-codegen fixes 2016-02-06 19:58:28 +01:00
Andreas Rumpf
9b44ca17c2 PHP codegen can generate PHP classes 2016-02-06 15:39:56 +01:00
Andreas Rumpf
35567a1eb9 first version of an PHP codegen 2016-02-06 15:39:56 +01:00
Yuriy Glukhov
c3d09aeeac Fixed unicode strings in JS 2016-01-22 11:24:00 +02:00
Yuriy Glukhov
5f092520d1 Revert "Fixed unicode handling in JS. Fixes #3714." 2016-01-21 22:26:50 +02:00
Andreas Rumpf
1dac302975 Merge pull request #3754 from yglukhov/js-unsigned
Unsigned arith corrected for JS
2016-01-21 16:28:03 +01:00
Yuriy Glukhov
c0d0e5efd9 Unsigned arith corrected for JS 2016-01-21 17:00:42 +02:00
Yuriy Glukhov
8fab2f81e3 Fixed unicode handling in JS. Fixes #3714. 2016-01-18 13:30:21 +02:00
Yuriy Glukhov
62422b93c6 Fixed copying of nil seq in JS 2015-12-16 15:25:58 +02:00
Yuriy Glukhov
0abfbf8f0d Removed Node, NodeType and Document definitions from jssys. 2015-11-25 16:37:36 +02:00
Yuriy Glukhov
2166b7bc46 Fixed ret by var in js 2015-10-15 16:04:53 +03:00
Yuriy Glukhov
02214d8d1b Fixed JS copying. 2015-08-31 21:44:07 +03:00
Yuriy Glukhov
a5be556a4c Untyped pointers godegen changed. addr expression fixed. 2015-08-21 13:29:25 +03:00
yglukhov
50d2d54fb0 Fixed fix of #2917 2015-06-17 23:26:38 +03:00
yglukhov
5824b1c839 Fixes #2917 2015-06-17 21:16:18 +03:00