Commit graph

16 commits

Author SHA1 Message Date
Charlie Gordon
f227746c6e
Add util.inspect emulation in REPL (#387)
- output values with controlable depth and detail
- add `.hidden` and `.depth` directives
- remove `eval_mode`
- add `use_strict` and `.strict` meta command
- add missing closures on global objects
- save and load command history to/from `~/.qjs_history`
- use USEPROFILE variable on Windows in addition to HOME
- use the same style names as util.inspect
2024-04-21 08:46:17 +02:00
Charlie Gordon
70a60f0aa1
Add REPL dark and light color themes (#383)
- detect terminal background from COLORFGBG environment variable
- add `.dark` and `.light` meta commands
- catch `loadScript` exceptions
2024-04-16 14:18:37 +02:00
Charlie Gordon
f62b90daa2
Improve REPL directive support (#348)
* Improve REPL directive support

- use . on column 0 as directive prefix
- use `directives` object properties for genericity
- accept non ambiguous directive abbreviations
- reject invalid directive with extra characters
- simplify `handle_directive` and `handle_cmd`
- document ".help" instead of "\h"
- document ".load"
2024-04-08 15:34:30 +02:00
Charlie Gordon
fd99929f5d
Improve completion in REPL (#343)
* Improve completion in REPL

- refine `get_context_object` to avoid throwing errors (eg: q.<TAB>)
- do not call `eval` in `get_context_object` to avoid throwing errors
  and reduce bloat caused by variable closures.
- support completion of directives
2024-04-06 21:37:19 +02:00
Saúl Ibarra Corretgé
72cebeaf2a Remove unused variables in REPL 2024-03-20 11:50:06 +01:00
Saúl Ibarra Corretgé
dd2427785f Check for RegExp objects before going the standard object path in REPL 2024-03-20 11:50:06 +01:00
Saúl Ibarra Corretgé
f2a91e86c7 Remove custom __getClass method 2024-03-10 16:55:10 +01:00
Charlie Gordon
8d0d9391f9
Unbreak repl string output (#300)
- fix incorrect argument in s = `JSON.stringify(s);`
- add closures for `RegExp` and `JSON`
2024-03-10 13:32:33 +01:00
Charlie Gordon
648a8f5be1
Improve Date.parse (#289)
* Improve `Date.parse()`

- rewrite `Date.parse()` with separate parsers
- return `NaN` for out of bounds field values as specified
- add `js_tzabbr` and `string_get_tzabbr` to handle timezone abbreviations
- improve `string_get_milliseconds` readability
- accept up to 9 decimals for millisecond fraction but truncate at 3
- accept many more alternative date/time formats
- add test cases in **tests/test_builtin.js**
- produce readable output for `Date` objects in repl 
- use `JSON.stringify` to output `Date` and `string` values in **repl.js**
- remove `String.prototype.__quote`
- add `minimum_length` macro to specify argument array sizes (C99 except MSVC)
- v8.js: parse all environment variables and output them, update **v8.txt**
2024-03-10 10:34:26 +01:00
Fedor Indutny
ff5e8dc3f5 Fix repl autocompletion for regexp with flags
Fix: #74
2023-11-24 20:57:03 +01:00
Saúl Ibarra Corretgé
5e4d45a9d4 Add -ng suffix to CLI output 2023-11-23 00:07:26 +01:00
Ben Noordhuis
e449cb08ef
Remove BigFloat (#31)
Part of https://github.com/quickjs-ng/quickjs/issues/17
2023-11-08 22:23:06 +01:00
Saúl Ibarra Corretgé
e2ae8746ca
Drop support for "use strip"
Ref: https://github.com/quickjs-ng/quickjs/issues/20
2023-11-07 00:29:11 +01:00
bellard
8900766099 2020-07-05 release 2020-09-06 19:07:30 +02:00
bellard
0e8fffd4de 2020-01-19 release 2020-09-06 18:57:11 +02:00
bellard
91459fb672 2020-01-05 release 2020-09-06 18:53:08 +02:00