c3715ce3 — Tor Andersson 3 months ago
Fix error in Array.prototype.toString().
6625d1ea — Robin Watts 3 months ago
Disable const warnings in Visual Studio.

Visual Studio is overzealous (i.e. wrong) in many of its const
7ef066a3 — Tor Andersson 5 months ago
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!
dbb86fcd — Tor Andersson 5 months ago
Call "join" property instead of hardcoding Ap_join in Ap_toString.
e38bff1f — Tor Andersson 5 months ago
... and leave a bit of margin.
833b6f16 — Tor Andersson 5 months ago
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.
292415b6 — Avi Halachmi (:avih) 5 months ago
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'.
d5f6b3b6 — Avi Halachmi (:avih) 5 months ago
test262: remove incorrect shift

It remained accidentally when the script changed from custom
arguments parsing to using getopts.
857ffd39 — Avi Halachmi (:avih) 3 years ago
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
e00c9ba7 — Tor Andersson 5 months ago
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.
6d140439 — Connor Nelson 5 months ago
Prevent negative table indexing in js_strtol
f93d2453 — Connor Nelson 6 months ago
Fix js_strtol
72e95a48 — Sebastian Rasmussen 6 months ago
Add user.make for persistent custom settings.
d1160c79 — Sebastian Rasmussen 6 months ago
Improve gitignore.
3d29cd2f — Tor Andersson 6 months ago
Issue #135: Expose type of value as an enum with js_type().

This matches the values used by the 'typeof' operator.
33ffe6ef — Tor Andersson 6 months ago
Inline doubles and interned string pointers in the byte code.

Avoid linearly searched per function string and number tables.
06a6f9fb — Tor Andersson 6 months ago
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.
4c7f6be4 — Tor Andersson 6 months ago
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.
1616c184 — Tor Andersson 6 months ago
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: