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
Tor Andersson
9f40dfb032
Take DESTDIR into account when creating pkg-config file.
...
Also only create the file when installing.
2019-02-12 12:19:26 +01:00
Tor Andersson
5f556004a2
Fix bugs in Number.prototype.toFixed and toExponential.
...
toPrecision does not behave correctly: it doesn't pad the number with
trailing zeroes to reach the desired precision.
2019-02-08 15:25:35 +01:00
Tor Andersson
28643e6afb
Bug 697891: Parse all JSON string escapes.
2019-01-23 12:53:25 +01:00
Tor Andersson
bd9920c571
Handle null/undefined in OP_NEXTITER rather than creating empty iterator.
...
Only create an iterator for coercible types in OP_ITERATOR, and then
detect the lack of a real iterator in OP_NEXTITER.
Thus we don't need to allocate and push an empty iterator object for
these cases.
2019-01-07 13:28:22 +01:00
Tor Andersson
7be32a0f5f
Bug 700441: Handle null and undefined expressions in for-in statement.
2019-01-04 10:58:30 +01:00
Tor Andersson
7f50591861
Bug 700429: Limit size of input regular expression program.
...
The size of the parsed syntax list could overflow. Allowing it to be
bigger than the compiled program makes no sense, so use the same size
limit when parsing as when compiling.
2019-01-02 16:05:24 +01:00
Tor Andersson
93447649b5
Make data tables in utftype.c const.
2018-11-26 10:40:22 +01:00
Tor Andersson
fcf0e3ebd7
Tweak numeric overflow check in regexp count parser.
2018-11-26 10:40:22 +01:00
Tor Andersson
245a6f97e6
Fix 700090, 700094, 700095: Iterate through lists in AST analysis passes.
2018-11-05 16:00:13 +01:00
Tor Andersson
81d5b30acc
Initialize random seed for Math.random().
2018-10-26 14:57:56 +02:00
Sebastian Rasmussen
7448a82448
Fix gcc compiler warnings about switch fallthroughs.
1.0.5
2018-09-11 12:47:31 +02:00
Tor Andersson
d4655ae888
Show system error message in js_loadfile.
2018-09-04 11:27:34 +02:00
Avi Halachmi (:avih)
924649a69e
mujs shell: Add compile function.
...
The new compile function compiles a source code string as a script and
returns a callable object. The optional 'filename' argument is used to
format error messages and stack traces.
2018-09-04 11:27:34 +02:00
Tor Andersson
84858c335e
mujs shell: Make the load function behave like in the SpiderMonkey shell.
2018-09-04 11:27:34 +02:00
Tor Andersson
a2b62c028e
Avoid clashing with system getopt.
2018-09-04 11:26:56 +02:00
Tor Andersson
dcb3f03e90
Inherit strictness from invoking function in eval.
2018-09-03 16:10:02 +02:00
Tor Andersson
2c0c6c94ca
Use getopt command line argument processing.
...
Pass script arguments to script as global variable scriptArgs.
2018-09-03 15:30:30 +02:00
Tor Andersson
643d428894
Default mujs shell to non-strict mode.
...
Pass "-s" as the first argument to start the shell in strict mode.
2018-08-29 13:01:04 +02:00
Tor Andersson
3430d9a06d
Return null instead of throwing an error when readline hits EOF.
2018-08-27 12:59:00 +02:00
Sebastian Rasmussen
c86267d8b2
Fix issue 66: Stack overflow when compiling long regexp sequences.
...
The syntax tree for long chains of Cat nodes leaned leftwards, which
made the compile() step potentially run out of stack. If we build the
Cat tree leaning right, we can use an iterative loop instead of
recursion.
1.0.4
2018-07-30 15:35:39 +02:00
Tor Andersson
5c1300b015
Fix 699559: Off-by-one comparison in regexp parser.
2018-07-26 23:44:15 +02:00
Tor Andersson
b4297c0dec
Fix 699557: Pause garbage collector during Ap_sort.
...
The temporary array we use for sorting cannot be seen by the GC, and that
violates the constraint that all js_Value values must always be reachable
from the stack or global environment.
Temporarily turning off the GC will let us use the temporary array for
fast sorting using qsort(), without tripping over this violation.
2018-07-25 12:00:33 +02:00
Tor Andersson
40b73014d9
Fix 699549: Integer overflow in Array.prototype.sort().
...
Check size calculation for overflow before allocating memory buffer.
2018-07-23 11:30:22 +02:00
Konstantin Baladurin
dbc0931a5c
Fix Date.prototype.setHours
2018-07-19 12:21:43 +02:00
Tor Andersson
bd2470847c
Fix logic in Object.isFrozen to comply with spec.
2018-07-16 13:28:04 +02:00
Tor Andersson
49271d3cf2
Add js_iserror function.
2018-07-03 12:00:57 +02:00
Tor Andersson
222772f6bb
Remove -ffunction-sections and -fdata-sections compile flags.
...
They're only of minor benefit. Simpler build systems are better.
2018-06-15 15:22:54 +02:00
Tor Andersson
ceac1b57d9
Allow enabling or disabling readline support by setting HAVE_READLINE.
2018-06-15 15:05:38 +02:00