Tor Andersson
e3f04e7f96
Check for empty string in js_isarrayindex.
2020-02-19 10:24:33 +01:00
Tor Andersson
11c894d0c1
Tweak default recursion limit.
2020-01-23 12:06:06 +01:00
Tor Andersson
6f93cab7ff
Fix enumerability of Error and Function properties.
...
The Error.message, Error.stackTrace, Function.prototype properties were
defined with the wrong attributes.
x
2020-01-23 12:06:06 +01:00
Tor Andersson
e082e6e61c
Check for leading zero in js_isarrayindex that caused false positives.
...
We're supposed to check whether a string turned into an integer and back
is itself, while also returning the value of the integer. We were
unintentionally allowing integers with leading zero through.
2020-01-20 12:39:58 +01:00
Tor Andersson
fe71080c59
Bug 698496: Handle leap years correctly in the Date constructor.
...
InLeapYear expects the parameter to be a timestamp and not a year.
Use DaysInYear instead.
Thanks to Robert Rosendahl for spotting this.
2020-01-10 11:22:09 +01:00
Tor Andersson
8ee595bee7
Bug 701355: Fix separate compilation issues that have crept in.
...
We normally build as one compilation unit with "one.c" but we should
still be able to build each source file as a separate compilation unit
if desired.
2020-01-10 11:09:22 +01:00
Tor Andersson
d248b0ce18
Bug 701886: Always create new scope for eval().
...
Distinguish eval code from script code.
2020-01-02 14:37:05 +01:00
Tor Andersson
d0225981aa
Update COPYING copyright year.
2020-01-02 14:37:05 +01:00
Tor Andersson
c695b53a75
Issue 117: Skip first line if it starts with a shebang when loading files.
...
A file that starts with #! is going to be a syntax error anyway, so we
won't be changing the behavior of any other valid source files with this
fix.
2020-01-02 14:30:43 +01:00
Tor Andersson
457f87b17b
Issue 128: Support property list as replacer argument in JSON.stringify.
...
Also adds helper functions js_isstringobject and js_isnumberobject.
2020-01-02 14:22:00 +01:00
isRyven
d9f555652a
Fix date setMonth and setUTCMonth processed wrong optional argument
2020-01-02 12:42:09 +01:00
isRyven
ddd1e5ebe6
Issue 126: accept String and Number objects as space parameter
2020-01-02 12:42:09 +01:00
Tor Andersson
e690d31ee3
Issue 122: Allow floating point return values from Array.sort callback.
2020-01-02 12:42:09 +01:00
Tor Andersson
b4484ab18a
Issue 118: Add REG_ to limit defines, and use REG_MAXSUB in header.
2020-01-02 12:42:09 +01:00
gardhr
8c868344b2
Issue 114: Allow compile time limits to be configured.
2019-11-28 11:39:55 +01:00
Tor Andersson
6b522a0b1f
Issue 115: Fix compilation of small floating point numbers.
...
The check for whether a number is an integer or not failed on number
too small because we were using an addition in the test.
2019-11-28 11:31:09 +01:00
Tor Andersson
6e62eb0923
Issue 113: Add a js_delglobal function.
2019-11-19 12:56:22 +01:00
Tor Andersson
3d3f473c39
Bug 701887: Create arguments if eval is present.
...
We can't know at compile time that the 'arguments' object will not be used
from the eval statement, so err on the side of caution and always create
the arguments object if eval can be called.
2019-11-19 12:53:28 +01:00
Tor Andersson
69b312d13b
Fix coverity issue: memory corruption due to overlapping copy.
2019-09-06 12:15:31 +02:00
Tor Andersson
16049bbbdc
Issue 107: Depend only on the exact files needed for install targets.
2019-07-03 20:25:19 +02:00
Tor Andersson
14dc9355bd
Issue 102: Fix ASAN build when using GCC.
...
GCC's address sanitizer sets the __SANITIZE_ADDRESS__ macro instead.
1.0.6
2019-06-12 17:23:46 +02:00
Tor Andersson
e2b59201d5
Issue 105: Fix NULL dereferencing in regexp compiler.
...
"x(?:)" parses to Cat(Char(x), Empty), but the compiler couldn't handle
an empty right hand side of the Cat node.
2019-06-11 15:48:39 +02:00
Tor Andersson
eeea83a807
Issue 102: Workaround for address-sanitizer default realloc behavior.
2019-06-11 15:48:39 +02:00
Tor Andersson
bd79071a6f
Add make uninstall target.
2019-05-27 11:19:26 +02:00
Tor Andersson
b9e14e53a0
Revert "Pacify valgrind: it doesn't know realloc(p, 0) is equivalent to free(p)."
...
This reverts commit 86feee5b7b .
2019-04-05 18:36:26 +02:00
Tor Andersson
00d4606c3b
Bug 700937: Limit recursion in regexp matcher.
...
Also handle negative return code as an error in the JS bindings.
2019-04-04 12:41:04 +02:00
Tor Andersson
1e5479084b
Bug 700947: Add missing ENDTRY opcode in try/catch/finally byte code.
...
In one of the code branches in handling exceptions in the catch block
we forgot to call the ENDTRY opcode to pop the inner hidden try.
This leads to an unbalanced exception stack which can cause a crash
due to us jumping to a stack frame that has already been exited.
2019-04-04 12:41:02 +02:00
Tor Andersson
da632ca08f
Bug 700938: Fix stack overflow in numtostr as used by Number#toFixed().
...
32 is not enough to fit sprintf("%.20f", 1e20).
We need at least 43 bytes to fit that format.
Bump the static buffer size.
2019-04-02 10:55:22 +02:00
Tor Andersson
0c03f9c057
Add missing break statement.
2019-03-29 19:40:44 +01:00
Tor Andersson
52c22be9c4
Fix MSVC compile errors.
2019-03-25 21:00:59 +01:00
Tor Andersson
bb65f18fcc
Set 'lightweight' and 'arguments' during compile pass.
...
Avoid doing a separate analysis pass by using the same bytecode for both
lightweight and non-lightweight functions.
2019-03-22 14:00:20 +01:00
Tor Andersson
f5de9d4d2e
Remove line opcode in favor of storing the line for each instruction.
2019-03-22 14:00:20 +01:00
Tor Andersson
20d0fa04df
Simplify opcodes: numbers and integer constants.
2019-03-22 14:00:20 +01:00
Tor Andersson
603977ae5b
Add repr() function to shell, and use it in the REPL.
2019-03-22 14:00:20 +01:00
Tor Andersson
ffe0ca7d7f
Issue 95: Improve error message when trying to call a non-callable.
2019-03-18 14:11:34 +01:00
Tor Andersson
5de1f97c52
Set appropriate internal class property of arguments object.
2019-03-18 14:11:34 +01:00
Tor Andersson
8b52b57782
Allow js_newobjectx to take null as prototype.
2019-03-18 14:11:34 +01:00
Tor Andersson
ed1c279896
Fix indentation.
2019-03-18 14:00:02 +01:00
Tor Andersson
9f0153a025
Fix typo in ctypeof.
2019-03-18 14:00:02 +01:00
Albert I
269904fca0
Fix Makefile install derps
...
* Introduced by commit cd97fb4
Signed-off-by: Albert I <krascgq@outlook.co.id >
2019-03-08 22:54:35 +01:00
Tor Andersson
2c24e194d4
Issue #92 : Remove unimplemented function.
2019-03-08 14:09:10 +01:00
Tor Andersson
8e57b47c5d
Only emit line ops for actual exit handler statements.
2019-03-08 12:55:21 +01:00
Tor Andersson
ce02a9d729
Handle empty scripts.
2019-03-08 10:57:32 +01:00
Tor Andersson
cb1d50bca4
Improve line number tracking in compiler.
2019-03-07 18:35:51 +01:00
Tor Andersson
914ae72a24
Improve line number tracking in parser.
...
Associate statements with their initial keyword, and expressions
with their operator token.
2019-03-07 16:08:06 +01:00
Tor Andersson
6a592abfc4
Use emitarg instead of emitraw to emit opcode arguments.
2019-03-07 16:08:06 +01:00
Tor Andersson
cd97fb4b5c
Fix makefile install paths.
...
Install the current configuration, don't hardwire it to build/release.
2019-03-07 16:07:38 +01:00
Tor Andersson
e471b4dd6c
Issue #83 : Don't include $DESTDIR in pkg-config paths.
2019-02-25 12:48:20 +01:00
Tor Andersson
d3feec4365
Issue #85 : Use explicit seed in Math.random().
2019-02-25 12:15:56 +01:00
Tor Andersson
43c844510b
Issue #84 : Separate Makefile targets.
...
Don't automatically build static library when building the shell
or the shared library.
2019-02-25 11:57:40 +01:00