Fix error in Array.prototype.toString().
Disable const warnings in Visual Studio.
Visual Studio is overzealous (i.e. wrong) in many of its const
Fix use-after-free in regexp source property access.
The underlying string of the "source" property of a regular expression
object can be freed if the regexp is garbage collected.
This could lead to a use-after-free, because the accessor incorrectly
assumed that the regexp source was an interned (thus never freed) string.
Fix this by calling js_pushstring instead of the faster but unsafe
Many thanks to Connor Nelson for spotting this!
Call "join" property instead of hardcoding Ap_join in Ap_toString.
... and leave a bit of margin.
Issue #148: Check for overflow when reading floating point exponent.
GCC with -O2 optimizes away the if(exp<-maxExponent) branch completely,
so we don't end up with the expected '512' value for overflowing
exponents. Limit the exponent parsing to MAX_INT instead to prevent
signed overflow from tripping up over-eager optimizing compilers.
test262: improve quoting, handle spaces at files/arguments
- Don't coalesce IFS nor interpret backslash at the output of `find'.
- The argument of -m and -l can now be arbitrary.
- The TC39 test262 path and/or files can now be arbitrary.
Previously any of those broke on IFS chars at the value.
Now the only issue is (unlikely) newline at filenames - from `find'.
test262: remove incorrect shift
It remained accidentally when the script changed from custom
arguments parsing to using getopts.
tools: add test262 and harness
tools: add test262-harness.js to run a single test
Usage: mujs <this-file> -- [-f] [-l file1.js -l ...] suit-root test-file
-f: print full paths/stacktraces if possible
-l: load a js file after the harness and before the test (to override things)
tools: add test-262 launcher
It can run the entire suite or just a sub-folder or one file, and by
default it skips tests which are known to crash/hang.
test262-harness: @negative: match regex if exists
Some @negative tests add a regex which needs to match the error.
This wasn't tested, and now it is. This results in few more failures.
The actual string to compare is not documented, but it appears to be
err.message for plain Error(..) where the message is always compared
to "NotEarlyError" (equals/different), and err.name for anything else.
test262 launcher: minor improvements and custom mujs path
- Use getopts instead of custom arguments parsing
- Support -m path/to/mujs
- Change -s (skip bad tests) to -b, and add -B to run only bad tests
(useful when trying to update the known bad tests list).
- Combine stderr to stdout on a per-test basis (mujs function warnings)
- Exit with error if failures > 0
test262: remove 5 tests which no longer crash/hang
test262 and harness: support -s to print failed source
test262 and harness: convert spaces to tabs
Don't call realloc with size=0 to free data.
Newer versions of the C spec and POSIX have changed the behavior of
realloc called with size 0 to be implementation defined.
Prevent negative table indexing in js_strtol
Add user.make for persistent custom settings.
Issue #135: Expose type of value as an enum with js_type().
This matches the values used by the 'typeof' operator.
Inline doubles and interned string pointers in the byte code.
Avoid linearly searched per function string and number tables.
Issue #120: Optimize array construction bytecode.
Use a specialized array initializer that pushes values to the end
of the array instead of using a lot of setprop. This avoids the need
to create a lot of number constants for the array indices.
Issue #139: Parse integers with floats to support large numbers.
Add a js_strtol which parses integers with bases 2..36 using simple
double precision arithmetic with no overflow checks.
Some Makefile tweaks.
Change default optimization flag to -O2.
Use XCFLAGS and XCPPFLAGS to add to the definitions:
make XCPPFLAGS=-I/foo/bar XCFLAGS=-mfoo-bar
Set CFLAGS on the make command line if you want to override completely:
make CFLAGS="-O3 -m32"
If you want to override them with the system environment variables: