]> git.kaiwu.me - njs.git/log
njs.git
2 years agoSimplified working with global value.
Dmitry Volyntsev [Wed, 28 Feb 2024 07:24:55 +0000 (23:24 -0800)]
Simplified working with global value.

2 years agoShell: added QuickJS engine support.
Dmitry Volyntsev [Fri, 23 Feb 2024 04:25:43 +0000 (20:25 -0800)]
Shell: added QuickJS engine support.

2 years agoFixed atob() with non-padded base64 strings.
Dmitry Volyntsev [Fri, 23 Feb 2024 01:38:58 +0000 (17:38 -0800)]
Fixed atob() with non-padded base64 strings.

This fixes #695 issue on Github.

2 years agoMoving hash code out of the njs core.
Dmitry Volyntsev [Thu, 15 Feb 2024 05:34:02 +0000 (21:34 -0800)]
Moving hash code out of the njs core.

2 years agoMoved njs_time() out of the core as it is not a part of the spec.
Dmitry Volyntsev [Thu, 15 Feb 2024 05:33:56 +0000 (21:33 -0800)]
Moved njs_time() out of the core as it is not a part of the spec.

2 years agoTest262: fix import_global_ref_var.t.js.
Dmitry Volyntsev [Thu, 8 Feb 2024 01:57:02 +0000 (17:57 -0800)]
Test262: fix import_global_ref_var.t.js.

2 years agoTest262: simplified import_chain.t.js.
Dmitry Volyntsev [Thu, 8 Feb 2024 01:57:01 +0000 (17:57 -0800)]
Test262: simplified import_chain.t.js.

Avoid using "crypto" module, which unnessesary complicates the test.

2 years agoRemoved njs_file.c not needed after 8aad26845b18 (0.8.3).
Dmitry Volyntsev [Thu, 8 Feb 2024 01:57:01 +0000 (17:57 -0800)]
Removed njs_file.c not needed after 8aad26845b18 (0.8.3).

2 years agoVersion bump.
Dmitry Volyntsev [Thu, 8 Feb 2024 01:56:59 +0000 (17:56 -0800)]
Version bump.

2 years agoAdded tag 0.8.3 for changeset 3aba7ee62080
Dmitry Volyntsev [Wed, 7 Feb 2024 16:34:17 +0000 (08:34 -0800)]
Added tag 0.8.3 for changeset 3aba7ee62080

2 years agoVersion 0.8.3. 0.8.3
Dmitry Volyntsev [Wed, 7 Feb 2024 16:34:00 +0000 (08:34 -0800)]
Version 0.8.3.

2 years agoReverted changes introduced in 7eaaa7d57636 (not released) back.
Dmitry Volyntsev [Wed, 7 Feb 2024 03:32:08 +0000 (19:32 -0800)]
Reverted changes introduced in 7eaaa7d57636 (not released) back.

Relative importing is again supported.

2 years agoHTTP: fixed stub_status statistic when js_periodic is enabled.
Dmitry Volyntsev [Thu, 1 Feb 2024 01:06:58 +0000 (17:06 -0800)]
HTTP: fixed stub_status statistic when js_periodic is enabled.

Previously, when js_periodic is enabled the Reading statistic
was growing each time the js_periodic handler was called.

The issue was introduced in f1bd0b1db065 (0.8.1).

This fixes #692 issue on Github.

2 years agoStyle.
Dmitry Volyntsev [Tue, 30 Jan 2024 01:16:08 +0000 (17:16 -0800)]
Style.

2 years ago2024 year.
Dmitry Volyntsev [Tue, 30 Jan 2024 01:16:07 +0000 (17:16 -0800)]
2024 year.

2 years agoTest262: handling the mkdir issue with a host file system.
Dmitry Volyntsev [Tue, 30 Jan 2024 01:16:01 +0000 (17:16 -0800)]
Test262: handling the mkdir issue with a host file system.

2 years agoFixed parsing of hex, oct and binary literals with no digits.
Vadim Zhestikov [Mon, 29 Jan 2024 16:57:49 +0000 (08:57 -0800)]
Fixed parsing of hex, oct and binary literals with no digits.

2 years agoFixed parsing of for-statement.
Vadim Zhestikov [Mon, 29 Jan 2024 16:57:48 +0000 (08:57 -0800)]
Fixed parsing of for-statement.

2 years agoFixed fuzzer build after 9b3dac56fd8a.
Dmitry Volyntsev [Thu, 25 Jan 2024 22:48:05 +0000 (14:48 -0800)]
Fixed fuzzer build after 9b3dac56fd8a.

2 years agoMoving out HostLoadImportedModule from njs core.
Dmitry Volyntsev [Wed, 24 Jan 2024 00:34:10 +0000 (16:34 -0800)]
Moving out HostLoadImportedModule from njs core.

HostLoadImportedModule should be implemented by host
environment according to ECMAScript specs.

The following method was removed: njs_vm_add_path().

2 years agoChange: imported modules are not resolved relative to current dir.
Dmitry Volyntsev [Wed, 24 Jan 2024 00:33:52 +0000 (16:33 -0800)]
Change: imported modules are not resolved relative to current dir.

Previously, when a module was imported with a relative path
it was looked for first in the directory of the importing context
(global, or a module).

For example when:
    main.js:
        import libs/lib1.js;

    libs/lib1.js:
        import lib2.js;

lib2.js was looked for first in libs/.

Now, it is only looked for in directories speficied with js_path
and a directory of nginx configuration file.

2 years agoShell: fixed unhandled rejected promises handling.
Dmitry Volyntsev [Wed, 24 Jan 2024 00:33:29 +0000 (16:33 -0800)]
Shell: fixed unhandled rejected promises handling.

The issue was introduced in dffdf7c50dfc (not released yet).

2 years agoMoving out HostPromiseRejectionTracker from njs core.
Dmitry Volyntsev [Fri, 19 Jan 2024 02:03:35 +0000 (18:03 -0800)]
Moving out HostPromiseRejectionTracker from njs core.

HostPromiseRejectionTracker should be implemented by host
environment according to ECMAScript specs.

The following method was removed: njs_vm_unhandled_rejection().
The following method was introduced: njs_vm_set_rejection_tracker().

2 years agoFixed tracking of unhandled rejected promises.
Dmitry Volyntsev [Fri, 19 Jan 2024 02:03:24 +0000 (18:03 -0800)]
Fixed tracking of unhandled rejected promises.

Checking for unhandled promise rejections while looping for pending jobs
produces false-positive reports when an rejected promised is handled
by one of the pending jobs later.

The fix is to check for unhandled promise rejections only at top level
calls like ngx_js_name_invoke() and ngx_js_name_call() and only after
all pending jobs are processed.

The issue was introduced in bc80bcb3102c (not released yet).

2 years agoHTTP: avoiding arithmetic ops with NULL pointer in r.args getter.
Dmitry Volyntsev [Thu, 11 Jan 2024 23:13:47 +0000 (15:13 -0800)]
HTTP: avoiding arithmetic ops with NULL pointer in r.args getter.

Found by UndefinedBehaviorSanitizer.

2 years agoQueryString: avoiding arithmetic ops with NULL in parse().
Dmitry Volyntsev [Thu, 11 Jan 2024 23:13:43 +0000 (15:13 -0800)]
QueryString: avoiding arithmetic ops with NULL in parse().

Found by UndefinedBehaviorSanitizer.

2 years agoRemoved unused field from njs_vmcode_t.
Vadim Zhestikov [Thu, 11 Jan 2024 00:26:35 +0000 (16:26 -0800)]
Removed unused field from njs_vmcode_t.

2 years agoFixed potential buffer overread in String.prototype.match().
Dmitry Volyntsev [Wed, 10 Jan 2024 01:56:19 +0000 (17:56 -0800)]
Fixed potential buffer overread in String.prototype.match().

2 years agoAvoiding arithmetic ops with NULL in %TypedArray%.prototype.sort().
Dmitry Volyntsev [Tue, 9 Jan 2024 17:14:42 +0000 (09:14 -0800)]
Avoiding arithmetic ops with NULL in %TypedArray%.prototype.sort().

Found by UndefinedBehaviorSanitizer.

2 years agoAvoiding casting Infinity to integer in String.fromCodePoint().
Dmitry Volyntsev [Tue, 9 Jan 2024 06:21:14 +0000 (22:21 -0800)]
Avoiding casting Infinity to integer in String.fromCodePoint().

Found by UndefinedBehaviorSanitizer.

2 years agoAvoiding arithmetic operations with NULL pointer in TextDecoder().
Dmitry Volyntsev [Tue, 9 Jan 2024 06:20:19 +0000 (22:20 -0800)]
Avoiding arithmetic operations with NULL pointer in TextDecoder().

Found by UndefinedBehaviorSanitizer.

2 years agoAvoiding casting NaN value to int64_t in njs.dump().
Dmitry Volyntsev [Tue, 9 Jan 2024 06:20:10 +0000 (22:20 -0800)]
Avoiding casting NaN value to int64_t in njs.dump().

Found by UndefinedBehaviorSanitizer.

2 years agoAvoiding pointer wraparound for padded integer specifier.
Dmitry Volyntsev [Tue, 9 Jan 2024 06:19:59 +0000 (22:19 -0800)]
Avoiding pointer wraparound for padded integer specifier.

Previously, when integer was larger than the padded width in a integer
specifier, the "end" pointer was evaluated to a value before "buf"
pointer.

Found by UndefinedBehaviorSanitizer.

2 years agoIgnoring UndefinedBehaviorSanitizer warnings where appropriate.
Dmitry Volyntsev [Sun, 30 Jul 2023 09:21:51 +0000 (10:21 +0100)]
Ignoring UndefinedBehaviorSanitizer warnings where appropriate.

Prodded by David Carlier and Ben Kallus.

2 years agoFixed RegExp.prototype.exec() when second argument is absent.
Dmitry Volyntsev [Tue, 9 Jan 2024 00:40:42 +0000 (16:40 -0800)]
Fixed RegExp.prototype.exec() when second argument is absent.

Previously, when the second argument is undefined, NaN is casted to
unsigned which is undefined behavior.

Found by UndefinedBehaviorSanitizer.

2 years agoImproved array enumeration with length 0.
Dmitry Volyntsev [Tue, 9 Jan 2024 00:40:42 +0000 (16:40 -0800)]
Improved array enumeration with length 0.

The fix eliminates an arithmetic operation with NULL pointer.

Found by UndefinedBehaviorSanitizer.

2 years agoFixed initialization of external prototypes with object entry.
Dmitry Volyntsev [Tue, 9 Jan 2024 00:40:42 +0000 (16:40 -0800)]
Fixed initialization of external prototypes with object entry.

When external was NULL (for example, when .u.object.properties is not
declared), an arithmetic operation was performed with NULL pointer which
is undefined behavior.

Found by UndefinedBehaviorSanitizer.

2 years agoQueryString: fixed underflow in parse().
Dmitry Volyntsev [Tue, 9 Jan 2024 00:40:42 +0000 (16:40 -0800)]
QueryString: fixed underflow in parse().

Previously, njs_query_string_append() might be provided with invalid
val_size value when value in a key-value pair was absent.

Found by UndefinedBehaviorSanitizer.

2 years agoFixed external values initialization in unit tests.
Dmitry Volyntsev [Tue, 9 Jan 2024 00:40:42 +0000 (16:40 -0800)]
Fixed external values initialization in unit tests.

Since 0.8.0 modules can create their own constructors and prototypes.
A modules has two method: preinit() and init(). A module should
add its constructors and prototypes in preinit() and create its own
values in init(). Creating a value in preinit() results in an error.
The patch fixes the issue by creating an external value in init()
instead of preinit().

Found by UndefinedBehaviorSanitizer.

2 years agoUnifying hash function prototypes.
Dmitry Volyntsev [Tue, 9 Jan 2024 00:40:42 +0000 (16:40 -0800)]
Unifying hash function prototypes.

This fixes UndefinedBehaviorSanitizer warning "call to function through
pointer to incorrect function type".

Found by UndefinedBehaviorSanitizer.

2 years agoFixed Date constructor for overflows and with NaN values.
Dmitry Volyntsev [Tue, 9 Jan 2024 00:40:27 +0000 (16:40 -0800)]
Fixed Date constructor for overflows and with NaN values.

Found by UndefinedBehaviorSanitizer.

2 years agoModules: fixed clear() method of a shared dictionary without timeout.
Vadim Zhestikov [Tue, 19 Dec 2023 20:37:05 +0000 (12:37 -0800)]
Modules: fixed clear() method of a shared dictionary without timeout.

This fixes #690 issue on Github.

2 years agoMoving out logger from njs core.
Dmitry Volyntsev [Fri, 15 Dec 2023 06:32:02 +0000 (22:32 -0800)]
Moving out logger from njs core.

Logger is not part of the JS runtime according to ECMAScript and should
be implemented by host environment.

2 years agoIntroduced njs_vm_set_module_loader().
Dmitry Volyntsev [Thu, 14 Dec 2023 02:38:47 +0000 (18:38 -0800)]
Introduced njs_vm_set_module_loader().

2 years agoRemoved not required argument for JSON functions.
Vadim Zhestikov [Tue, 12 Dec 2023 03:10:38 +0000 (19:10 -0800)]
Removed not required argument for JSON functions.

2 years agoRemoved not used arg from njs_get_own_ordered_keys().
Vadim Zhestikov [Tue, 12 Dec 2023 03:10:36 +0000 (19:10 -0800)]
Removed not used arg from njs_get_own_ordered_keys().

2 years agoRefactored asynchronous events.
Dmitry Volyntsev [Tue, 5 Dec 2023 16:54:18 +0000 (08:54 -0800)]
Refactored asynchronous events.

To align njs with other JS engines, async events are removed from njs
core. The following functions were removed: njs_vm_add_event(),
njs_vm_del_event(), njs_vm_waiting(). Instead the host is expected
to manage async events by itself.

In addition, the posted events are renamed to jobs, to better align with
the ECMA specs. The following methods are removed: njs_vm_run().
Instead, the host is expected to call njs_vm_execute_pending_job() in a
loop to execute pending jobs. The following functions were added:
njs_vm_enqueue_job().

2 years agoRemoved remnants of GC code.
Vadim Zhestikov [Thu, 30 Nov 2023 04:46:36 +0000 (20:46 -0800)]
Removed remnants of GC code.

The code never worked and comments are in a broken state.

2 years agoFixed memory over-read in njs_utf8_prev() and njs_utf8_next().
Vadim Zhestikov [Thu, 30 Nov 2023 04:46:32 +0000 (20:46 -0800)]
Fixed memory over-read in njs_utf8_prev() and njs_utf8_next().

Previously, njs_utf8_next() might over-read up to 1 byte
beyond the string memory. Whereas njs_utf8_prev() might
over-read unlimited number of bytes before the string.

2 years agoModules: simplified setTimeout() timer callback.
Dmitry Volyntsev [Thu, 30 Nov 2023 02:43:45 +0000 (18:43 -0800)]
Modules: simplified setTimeout() timer callback.

2 years agoTests: detection when "xml" module is disabled.
Dmitry Volyntsev [Thu, 30 Nov 2023 02:43:37 +0000 (18:43 -0800)]
Tests: detection when "xml" module is disabled.

2 years agoXML: fixed building with libxml2 2.12 and later.
Dmitry Volyntsev [Tue, 28 Nov 2023 02:43:36 +0000 (18:43 -0800)]
XML: fixed building with libxml2 2.12 and later.

This fixes #684 issue on Github.

2 years agoRemove njs_timer.c forgotten in the previous commit.
Dmitry Volyntsev [Tue, 28 Nov 2023 02:43:04 +0000 (18:43 -0800)]
Remove njs_timer.c forgotten in the previous commit.

2 years agoMoving out setTimeout() and clearTimeout() from njs core.
Dmitry Volyntsev [Tue, 21 Nov 2023 17:00:52 +0000 (09:00 -0800)]
Moving out setTimeout() and clearTimeout() from njs core.

This functions are not part of the ECMAScript and should be
implemented by host environment.

2 years agoRenaming ngx_js_retval() to ngx_js_exception().
Dmitry Volyntsev [Tue, 21 Nov 2023 16:57:09 +0000 (08:57 -0800)]
Renaming ngx_js_retval() to ngx_js_exception().

After previous commit ngx_js_retval() is only used for getting the
exception value and should be renamed to better reflect the purpose.

2 years agoModules: fixed js_set with Buffer values.
Dmitry Volyntsev [Tue, 21 Nov 2023 16:57:03 +0000 (08:57 -0800)]
Modules: fixed js_set with Buffer values.

Previously, a Buffer value which contains invalid UTF-8 when returned as a
value for js_set handler was mangled because the bytes value was converted to a
string value.

The fix is to use bytes value of Buffer, TypedArray and ArrayBuffer as is,
and not convert it to a string first.

2 years agoFixed memory overlapping.
Vadim Zhestikov [Tue, 21 Nov 2023 14:49:30 +0000 (06:49 -0800)]
Fixed memory overlapping.

2 years agoTests: added console test for stream module.
Dmitry Volyntsev [Wed, 15 Nov 2023 23:08:18 +0000 (15:08 -0800)]
Tests: added console test for stream module.

2 years agoFetch: fixed Headers.set().
Dmitry Volyntsev [Wed, 15 Nov 2023 23:07:20 +0000 (15:07 -0800)]
Fetch: fixed Headers.set().

This closes #680 issue on Github.

2 years agoShell: refactored njs_process_file().
Dmitry Volyntsev [Fri, 10 Nov 2023 01:09:16 +0000 (17:09 -0800)]
Shell: refactored njs_process_file().

The reading part is separated into njs_read_file().

2 years agoShell: moving njs_vm_opt_t initialisation to njs_create_vm().
Dmitry Volyntsev [Thu, 9 Nov 2023 19:49:25 +0000 (11:49 -0800)]
Shell: moving njs_vm_opt_t initialisation to njs_create_vm().

2 years agoShell: unified normal mode and LLVMFuzzerTestOneInput().
Dmitry Volyntsev [Thu, 9 Nov 2023 19:11:19 +0000 (11:11 -0800)]
Shell: unified normal mode and LLVMFuzzerTestOneInput().

Now both main() and LLVMFuzzerTestOneInput() use njs_main()
as a main routine.

2 years agoFixed include directories order.
Dmitry Volyntsev [Tue, 7 Nov 2023 23:35:35 +0000 (15:35 -0800)]
Fixed include directories order.

Previously, when the previous version of njs.h is installed, an outdated
version of njs.h might be included causing build failures.

The fix is to ensure that the local include directories are included
first.

2 years agoRemoved leftover njs directory include directory path.
Dmitry Volyntsev [Tue, 7 Nov 2023 23:35:25 +0000 (15:35 -0800)]
Removed leftover njs directory include directory path.

2 years agoVersion bump.
Dmitry Volyntsev [Tue, 7 Nov 2023 23:35:18 +0000 (15:35 -0800)]
Version bump.

2 years agoAdded tag 0.8.2 for changeset 45f81882c780
Dmitry Volyntsev [Tue, 24 Oct 2023 04:42:43 +0000 (21:42 -0700)]
Added tag 0.8.2 for changeset 45f81882c780

2 years agoVersion 0.8.2. 0.8.2
Dmitry Volyntsev [Tue, 24 Oct 2023 04:42:29 +0000 (21:42 -0700)]
Version 0.8.2.

2 years agoParser: fixed return statement parsing with invalid expression.
Vadim Zhestikov [Tue, 24 Oct 2023 04:19:03 +0000 (21:19 -0700)]
Parser: fixed return statement parsing with invalid expression.

2 years agoModules: fixed delete() method of a shared dictionary.
Dmitry Volyntsev [Fri, 20 Oct 2023 15:44:52 +0000 (08:44 -0700)]
Modules: fixed delete() method of a shared dictionary.

This fixes #679 issue on Github.

2 years agoXML: fixed compilation with certain GCC versions.
Dmitry Volyntsev [Thu, 19 Oct 2023 01:36:00 +0000 (18:36 -0700)]
XML: fixed compilation with certain GCC versions.

external/njs_xml_module.c:541:16: error: 'name.length' may be used
uninitialized [-Werror=maybe-uninitialized]
  541 |             if (name.length != njs_strlen(node->name).

2 years agoFixed RegExp.prototype.exec() with global regexp and unicode input.
Dmitry Volyntsev [Wed, 18 Oct 2023 00:51:39 +0000 (17:51 -0700)]
Fixed RegExp.prototype.exec() with global regexp and unicode input.

Previously, when exactly 32 characters unicode string was provided and
the "lastIndex" value of "this" regexp was equal to 32 too, the
njs_string_utf8_offset() was called with invalid index argument (longer
than a size of the string).  As a result njs_string_utf8_offset()
returned garbage values.

This was manifested in the following ways:
1) InternalError: pcre2_match() failed: bad offset value

2) Very slow replace calls with global regexps, for
   example in expressions like: str.replace(/<re>/g).

This fixes #677 on Github.

2 years agoModules: fixed items() method of a shared dictionary.
Dmitry Volyntsev [Tue, 17 Oct 2023 01:09:37 +0000 (18:09 -0700)]
Modules: fixed items() method of a shared dictionary.

Previously, under a memory pressure the method might return
prematurely while still holding the mutex for the shared memory.

This fixes #676 issue on Github.

2 years agoFixed Array.prototype.sort() with --debug=YES and --debug-memory=YES.
Dmitry Volyntsev [Fri, 6 Oct 2023 23:52:23 +0000 (16:52 -0700)]
Fixed Array.prototype.sort() with --debug=YES and --debug-memory=YES.

Previously, --debug-memory=YES activated a different allocation
mechanism that was not able to properly handle the 0 size allocation.
Specifically, njs_mp_free() failed to find a block to free when the size
of the block is 0.

The fix is to alloc at least 1 byte in the --debug-memory=YES mode.

2 years agoFixed RegExp.prototype.replace().
Dmitry Volyntsev [Fri, 6 Oct 2023 23:51:53 +0000 (16:51 -0700)]
Fixed RegExp.prototype.replace().

The issue was introduced in cf85d0f8640a.

2 years agoFixed RegExp.prototype.split().
Dmitry Volyntsev [Fri, 6 Oct 2023 23:49:59 +0000 (16:49 -0700)]
Fixed RegExp.prototype.split().

The issue was introduced in c0aad58cfadb.

2 years agoXML: fixed exception handling.
Dmitry Volyntsev [Wed, 4 Oct 2023 22:00:02 +0000 (15:00 -0700)]
XML: fixed exception handling.

This closes #675 issue on Github.

2 years agoImproved memory footprint of RegExp.prototype.split().
Dmitry Volyntsev [Wed, 4 Oct 2023 20:35:38 +0000 (13:35 -0700)]
Improved memory footprint of RegExp.prototype.split().

2 years agoImproved memory footprint of RegExp.prototype.replace().
Dmitry Volyntsev [Wed, 4 Oct 2023 01:09:06 +0000 (18:09 -0700)]
Improved memory footprint of RegExp.prototype.replace().

2 years agoImproved memory footprint of RegExp.prototype.test().
Dmitry Volyntsev [Tue, 3 Oct 2023 07:39:04 +0000 (00:39 -0700)]
Improved memory footprint of RegExp.prototype.test().

2 years agoFS: introduced fs.existsSync().
Dmitry Volyntsev [Sat, 30 Sep 2023 04:41:34 +0000 (21:41 -0700)]
FS: introduced fs.existsSync().

2 years agoRegExp: improved memory footprint when match fails.
Dmitry Volyntsev [Fri, 29 Sep 2023 02:09:56 +0000 (19:09 -0700)]
RegExp: improved memory footprint when match fails.

2 years agoStream: adjusted periodic timeout in tests.
Dmitry Volyntsev [Fri, 29 Sep 2023 01:11:15 +0000 (18:11 -0700)]
Stream: adjusted periodic timeout in tests.

2 years agoFetch: fixed HEAD response handling with large Content-Length.
Dmitry Volyntsev [Thu, 28 Sep 2023 18:00:56 +0000 (11:00 -0700)]
Fetch: fixed HEAD response handling with large Content-Length.

This closes #658 issue on Github.

2 years agoModules: introduced console object.
Dmitry Volyntsev [Fri, 22 Sep 2023 20:00:06 +0000 (13:00 -0700)]
Modules: introduced console object.

The following methods were added: dump(), error(), info(),
log(), time(), timeEnd(), warn().

2 years agoIntroduced API to work with external value pointers.
Dmitry Volyntsev [Fri, 22 Sep 2023 20:00:05 +0000 (13:00 -0700)]
Introduced API to work with external value pointers.

This allows to allocate the necessary context for external
code on demand.

2 years agoModules: added debug log for vm cloning and destroying.
Dmitry Volyntsev [Fri, 22 Sep 2023 20:00:04 +0000 (13:00 -0700)]
Modules: added debug log for vm cloning and destroying.

2 years agoShell: simplified console.time()/timeEnd() pair.
Dmitry Volyntsev [Thu, 21 Sep 2023 19:40:53 +0000 (12:40 -0700)]
Shell: simplified console.time()/timeEnd() pair.

Using a queue instead of a hash here because we assume that the
number of profile timers will be low.

2 years agoShell: introduced error, info and warn methods for console object.
Dmitry Volyntsev [Thu, 21 Sep 2023 04:48:41 +0000 (21:48 -0700)]
Shell: introduced error, info and warn methods for console object.

2 years agoShell: improved shell_test.
Dmitry Volyntsev [Thu, 21 Sep 2023 02:19:58 +0000 (19:19 -0700)]
Shell: improved shell_test.

Setting more appropriate env variables for libedit since we moved to
libedit as a default readline library in 0.8.0.

2 years agoVersion bump.
Dmitry Volyntsev [Thu, 21 Sep 2023 23:11:20 +0000 (16:11 -0700)]
Version bump.

2 years agoAdded tag 0.8.1 for changeset a52b49f9afcf
Dmitry Volyntsev [Tue, 12 Sep 2023 18:57:00 +0000 (11:57 -0700)]
Added tag 0.8.1 for changeset a52b49f9afcf

2 years agoVersion 0.8.1. 0.8.1
Dmitry Volyntsev [Tue, 12 Sep 2023 18:54:22 +0000 (11:54 -0700)]
Version 0.8.1.

2 years agoTypes: added TS description for items() introduced in f5428bc87159.
Dmitry Volyntsev [Tue, 12 Sep 2023 18:36:15 +0000 (11:36 -0700)]
Types: added TS description for items() introduced in f5428bc87159.

2 years agoHTTP: avoid calling body filter when input chain is NULL.
Dmitry Volyntsev [Tue, 12 Sep 2023 03:34:48 +0000 (20:34 -0700)]
HTTP: avoid calling body filter when input chain is NULL.

This solves the problem of erroneous exception thrown in
r.internalRedirect() after 05c7f0b31856 (0.8.0).

2 years agoModules: improved debug log.
Dmitry Volyntsev [Sat, 9 Sep 2023 00:13:19 +0000 (17:13 -0700)]
Modules: improved debug log.

1) Ensuring that consistent prefixes are used:
"http js" in HTTP module and "stream js" in Stream module.
2) Added debug for every event/callback handler entrance.
3) Added debug with a method name for every JS call.

2 years agoFetch: renamed prefix http to fetch to avoid overlap with HTTP module.
Dmitry Volyntsev [Sat, 9 Sep 2023 00:52:07 +0000 (17:52 -0700)]
Fetch: renamed prefix http to fetch to avoid overlap with HTTP module.

2 years agoAdded flat hash overflow check.
Vadim Zhestikov [Fri, 8 Sep 2023 23:05:24 +0000 (16:05 -0700)]
Added flat hash overflow check.

2 years agoModules: implemented items() method of a shared dictionary.
Dmitry Volyntsev [Thu, 7 Sep 2023 23:12:40 +0000 (16:12 -0700)]
Modules: implemented items() method of a shared dictionary.

2 years agoTests: fixed incr() tests for a shared dictionary.
Dmitry Volyntsev [Thu, 7 Sep 2023 23:12:31 +0000 (16:12 -0700)]
Tests: fixed incr() tests for a shared dictionary.

Previously, the incr() method called SharedDict.incr() with a NaN value
as a second argument because parseInt(undefined) returns NaN.

The test itself failed to capture the issue because it matches the whole
HTTP response and the pattern itself was too short, so it matched
accidentally.

2 years agoShell: fixed file error message on CLI without interactive mode.
Dmitry Volyntsev [Thu, 7 Sep 2023 01:02:50 +0000 (18:02 -0700)]
Shell: fixed file error message on CLI without interactive mode.

This closes #669 issue on Github.