]>
git.kaiwu.me - njs.git/log
Dmitry Volyntsev [Sat, 7 Jan 2023 04:39:01 +0000 (20:39 -0800)]
Added njs_vm_add_module().
The new API does not require for njs_mod_t structure to be disclosed.
Dmitry Volyntsev [Sat, 7 Jan 2023 00:50:46 +0000 (16:50 -0800)]
Fixed Object.values() and Object.entries() with external objects.
This closes #606 issue on Github.
Dmitry Volyntsev [Fri, 6 Jan 2023 06:05:03 +0000 (22:05 -0800)]
Fixed unitialized value usage warning.
Found by Coverity (CID
1518908 ).
Dmitry Volyntsev [Thu, 5 Jan 2023 04:39:21 +0000 (20:39 -0800)]
WebCrypto: improved njs_bn_bn2binpad() for OpenSSL < 1.1.0.
The patch makes njs_bn_bn2binpad() more similar to BN_bn2binpad().
Dmitry Volyntsev [Thu, 5 Jan 2023 02:07:30 +0000 (18:07 -0800)]
WebCrypto: extended support for symmetric keys.
The following functionality for HMAC and AES-* keys were added:
importKey() supporting 'jwk' format,
exportKey() supporting 'jwk' and 'raw' formats,
generateKey().
Dmitry Volyntsev [Thu, 5 Jan 2023 01:49:22 +0000 (17:49 -0800)]
WebCrypto: extended support for asymmetric keys.
The following functionality for RSA and EC keys were added:
importKey() supporting 'jwk' format,
also 'raw' format for EC public keys.
exportKey() supporting 'pksc8', 'spki', 'jwk' format,
also 'raw' format for EC public keys.
generateKey().
Dmitry Volyntsev [Sat, 31 Dec 2022 02:22:02 +0000 (18:22 -0800)]
WebCrypto: improved exception wording for invalid key formats.
Dmitry Volyntsev [Fri, 30 Dec 2022 04:46:21 +0000 (20:46 -0800)]
WebCrypto: added missed support for AES-* keys of size 192.
Dmitry Volyntsev [Fri, 30 Dec 2022 04:39:29 +0000 (20:39 -0800)]
WebCrypto: fixed importKey() for AES-* keys.
Previously, key of of any length were accepted, whereas according to the
spec only 128, 192 and 256 bits are allowed.
Jérémy Lal [Thu, 15 Dec 2022 12:04:46 +0000 (13:04 +0100)]
Fixed typos.
Dmitry Volyntsev [Tue, 13 Dec 2022 06:00:23 +0000 (22:00 -0800)]
Modules: added Request, Response and Headers ctors in Fetch API.
Added Headers method and properties: append(), delete(), get(),
forEach(), has(), set().
Added Request method and properties: arrayBuffer(), bodyUsed,
cache, credentials, json(), method, mode, text(), url.
Added Headers, Request, Response constructors.
This closes #425 issue on Github.
Dmitry Volyntsev [Tue, 13 Dec 2022 05:55:47 +0000 (21:55 -0800)]
Modules: fixed nginx logger callback for calls in master.
Dmitry Volyntsev [Thu, 8 Dec 2022 02:11:57 +0000 (18:11 -0800)]
Added njs_vm_string_compare().
Dmitry Volyntsev [Thu, 8 Dec 2022 02:11:56 +0000 (18:11 -0800)]
Added njs_vm_external_ptr().
Dmitry Volyntsev [Thu, 8 Dec 2022 02:11:56 +0000 (18:11 -0800)]
Extended njs_vm_function_alloc().
Dmitry Volyntsev [Thu, 8 Dec 2022 02:11:55 +0000 (18:11 -0800)]
Added njs_value_function_set().
Dmitry Volyntsev [Thu, 8 Dec 2022 02:11:54 +0000 (18:11 -0800)]
Allowing to declare exotic slot for the external objects.
Vadim Zhestikov [Wed, 7 Dec 2022 02:47:53 +0000 (18:47 -0800)]
Improved performance of conditional jumps.
Vadim Zhestikov [Fri, 18 Nov 2022 22:10:25 +0000 (14:10 -0800)]
Fixed for(expr1; conditional syntax error handling.
Dmitry Volyntsev [Fri, 18 Nov 2022 04:38:23 +0000 (20:38 -0800)]
Shell: added signal support in CLI.
Dmitry Volyntsev [Thu, 17 Nov 2022 02:47:36 +0000 (18:47 -0800)]
Version bump.
Dmitry Volyntsev [Thu, 17 Nov 2022 01:47:33 +0000 (17:47 -0800)]
Added tag 0.7.9 for changeset
5f705230a62c
Dmitry Volyntsev [Thu, 17 Nov 2022 01:16:36 +0000 (17:16 -0800)]
Version 0.7.9.
Konstantin Pavlov [Mon, 17 Oct 2022 12:45:53 +0000 (16:45 +0400)]
Added a target to generate pkg-config file.
Vadim Zhestikov [Thu, 17 Nov 2022 00:09:47 +0000 (16:09 -0800)]
Fixed for-in unwanted detection of arrow function.
Vadim Zhestikov [Wed, 16 Nov 2022 17:15:39 +0000 (09:15 -0800)]
Fixed for-in rhs expression parsing error handling.
This fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53426.
Dmitry Volyntsev [Wed, 16 Nov 2022 02:38:49 +0000 (18:38 -0800)]
Modules: fixed Fetch Response prototype reinitialization.
Previously, since
446a1cb64a6a (0.7.7), when at least one js_import directive
was declared in both HTTP and Stream, ngx.fetch() returned inapproriate
response in Stream.
The prototype for Response object was created two times for HTTP and STREAM,
but the second initialization of global variable with the index of the
Response() prototype overwrites the first value with a different value. This
caused a problem in Stream code which manifested itself as a `Stream flags`
object returned as a result of ngx.fetch() call instead of a Response instance.
The fix is to ensure that shared prototypes like a Response prototype
have indentical index value in all the modules.
This fixes #596 issue on Github.
Vadim Zhestikov [Tue, 15 Nov 2022 01:31:03 +0000 (17:31 -0800)]
Masks definition corrected and made regularized.
Vadim Zhestikov [Mon, 14 Nov 2022 17:18:37 +0000 (09:18 -0800)]
Fixed for-in loop with left and right hand side expressions.
This fixes #351 issue on Github.
Dmitry Volyntsev [Fri, 11 Nov 2022 01:53:36 +0000 (17:53 -0800)]
Fixed Array.prototype.splice(s,d) when d resizes "this" during eval.
This closes #592 and #595 issues on Github.
Dmitry Volyntsev [Fri, 11 Nov 2022 01:53:35 +0000 (17:53 -0800)]
Improved njs_value_property_i64_delete() for fast-arrays.
Dmitry Volyntsev [Fri, 11 Nov 2022 01:51:32 +0000 (17:51 -0800)]
Improved njs_object_prop_define() for fast-arrays.
Previously, any Object.defineProperty() for fast-arrays converted them
to slow ones. Now, it is only done when it is necessary.
Dmitry Volyntsev [Thu, 10 Nov 2022 17:33:36 +0000 (09:33 -0800)]
Change: the default JS stack size is reduced to 64k.
After
86784a68e8c8 (Computed goto) the size of a stack frame
njs_vmcode_interpreter() when -O0 is specified during compilation
increased significantly. This might cause system stack overflow for very
deep recursive calls because system stack is exausted faster than JS
stack.
It is possible now to specify JS stack size for CLI.
Dmitry Volyntsev [Mon, 7 Nov 2022 22:22:41 +0000 (14:22 -0800)]
Fixed %TypedArray%.prototype.set(s) when s element changes "this".
This closes #590 issue on Github.
Dmitry Volyntsev [Mon, 7 Nov 2022 22:22:41 +0000 (14:22 -0800)]
Types: fixed description for fs.mkdir() and fs.rmdir() methods.
This closes #600 issue on Github.
Dmitry Volyntsev [Mon, 7 Nov 2022 22:22:41 +0000 (14:22 -0800)]
Fixed default module loader.
Previously, njs_mp_free() was called with invalid pointer because
njs_vm_compile_module() shifts start argument to the last reading
position.
This closes #601 issue on Github.
Dmitry Volyntsev [Mon, 7 Nov 2022 22:22:41 +0000 (14:22 -0800)]
Fixed Array.prototype.fill() when start object changes "this".
This fixed #589, #599 issues on Github.
Vadim Zhestikov [Mon, 7 Nov 2022 22:08:28 +0000 (14:08 -0800)]
Fixed String.prototype.replace(re) if re.exec() returns non-flat array.
This fixes #587 issue on Github.
Vadim Zhestikov [Wed, 26 Oct 2022 23:33:15 +0000 (16:33 -0700)]
Fixed static analyzer issues.
Dmitry Volyntsev [Tue, 25 Oct 2022 16:19:32 +0000 (09:19 -0700)]
Refactored working with an object properties.
1) njs_object_prop_t is compacted from 72 to 40 bytes on 64bit
platforms.
2) njs_object_prop_define() is revorked to accomodate fast
property creation using njs_value_create_data_prop()
which corresponds to CreateDataProperty() from the specs.
Dmitry Volyntsev [Tue, 25 Oct 2022 16:19:14 +0000 (09:19 -0700)]
Version bump.
Vadim Zhestikov [Tue, 25 Oct 2022 13:43:10 +0000 (06:43 -0700)]
Computed goto support added to vmcode.
Dmitry Volyntsev [Tue, 25 Oct 2022 05:49:55 +0000 (22:49 -0700)]
Added tag 0.7.8 for changeset
3308415d7de8
Dmitry Volyntsev [Tue, 25 Oct 2022 04:29:44 +0000 (21:29 -0700)]
Version 0.7.8.
Vadim Zhestikov [Mon, 24 Oct 2022 14:48:28 +0000 (07:48 -0700)]
Fixed labeled empty statement.
This fixes #593 issue on Github.
Dmitry Volyntsev [Sat, 22 Oct 2022 01:48:39 +0000 (18:48 -0700)]
Added njs.memoryStats object.
njs.memoryStats.size is a number of bytes a VM claimed from the OS.
Dmitry Volyntsev [Sat, 22 Oct 2022 01:48:39 +0000 (18:48 -0700)]
Fixed shell tests after changes in backtraces and function names.
Vadim Zhestikov [Thu, 20 Oct 2022 23:40:35 +0000 (16:40 -0700)]
Fixed break label for if statement.
This fixes #591 issue on Github.
Dmitry Volyntsev [Tue, 11 Oct 2022 02:01:56 +0000 (19:01 -0700)]
Enabled successful tests which were skipped previously.
Dmitry Volyntsev [Tue, 11 Oct 2022 01:45:09 +0000 (18:45 -0700)]
Refactored bound function calls according to the spec.
This fixes #533, #546, #579 issues on Github.
Vadim Zhestikov [Fri, 7 Oct 2022 01:28:52 +0000 (18:28 -0700)]
Fixed double declaration detection in modules.
Dmitry Volyntsev [Sat, 1 Oct 2022 00:40:57 +0000 (17:40 -0700)]
Parser: simplified njs_parser_string_create() using existing API.
Dmitry Volyntsev [Fri, 30 Sep 2022 01:48:09 +0000 (18:48 -0700)]
Improved population of process.env object.
1) Keys are always casted to upper case.
2) Keys and values are converted to safe Unicode strings.
Dmitry Volyntsev [Sat, 1 Oct 2022 00:35:52 +0000 (17:35 -0700)]
Fixed parsing of environ variables when duplicate keys are present.
This closes #581 issue on Github.
Dmitry Volyntsev [Thu, 29 Sep 2022 23:32:52 +0000 (16:32 -0700)]
Fixed njs_assert() macro.
Previously, the argument was always evaluated, even if
NJS_DEBUG was undefined.
Dmitry Volyntsev [Thu, 29 Sep 2022 23:32:45 +0000 (16:32 -0700)]
Introduced njs_object_proto_lookup() where appropriate.
Dmitry Volyntsev [Thu, 29 Sep 2022 07:47:43 +0000 (00:47 -0700)]
Removed aligned values which are not required since 0.6.0.
Dmitry Volyntsev [Thu, 29 Sep 2022 07:35:34 +0000 (00:35 -0700)]
Style.
Dmitry Volyntsev [Tue, 27 Sep 2022 23:52:31 +0000 (16:52 -0700)]
Fixed handling of unhandled promise rejection.
Previously, a direct pointer to the first element of an array of
rejected promise values was used to convert that element to a string.
This is not correct because that pointer may become invalid if rejected
promise values array is resized between invocation of "toString" and
"valueOf" methods which are called while converting the element to a
string.
The fix is to ensure that the rejected promise value is never changed.
This closes #580 issue on Github.
Dmitry Volyntsev [Tue, 27 Sep 2022 23:40:06 +0000 (16:40 -0700)]
Fetch: added support for HEAD method.
This closes #577 issue on Github.
Vadim Zhestikov [Tue, 27 Sep 2022 17:56:54 +0000 (10:56 -0700)]
Modules: js_merge_conf is moved to shared library.
Vadim Zhestikov [Tue, 27 Sep 2022 16:32:56 +0000 (09:32 -0700)]
Modules: common code is moved to shared library.
Dmitry Volyntsev [Tue, 27 Sep 2022 00:50:24 +0000 (17:50 -0700)]
Stream: introduced s.sendUpstream() and s.sendDownstream().
Dmitry Volyntsev [Tue, 27 Sep 2022 00:49:39 +0000 (17:49 -0700)]
Stream: improved async callback support for s.send().
Previously, the "from_upstream" flag (introduced in
b33aae5e8dc6 ) was
ignored for s.send() calls invoked directly from a body filter.
This makes the s.send() behaviour context dependent.
The fix is to always take "from_upstream" flag into account when it is
provided.
This fixed #552 issue on Github.
Dmitry Volyntsev [Fri, 23 Sep 2022 02:05:36 +0000 (19:05 -0700)]
HTTP: adding a warning for ignored outgoing header assignments.
Dmitry Volyntsev [Wed, 21 Sep 2022 00:44:25 +0000 (17:44 -0700)]
Introduced "name" instance property for a function object.
This closes #360 issue on Github.
Dmitry Volyntsev [Tue, 20 Sep 2022 00:36:02 +0000 (17:36 -0700)]
Improved complex assignments when key is a primitive object.
When key is a primitive object NJS_VMCODE_TO_PROPERTY_KEY is not
necessary.
Dmitry Volyntsev [Sat, 17 Sep 2022 00:07:04 +0000 (17:07 -0700)]
Fixed typo introduced in
82f41f43abd4 .
Vadim Zhestikov [Fri, 16 Sep 2022 19:27:40 +0000 (12:27 -0700)]
Modules: added js_preload_object directive.
Dmitry Volyntsev [Fri, 16 Sep 2022 03:20:11 +0000 (20:20 -0700)]
Fixed complex assignments.
A new instruction is introduced NJS_VMCODE_TO_PROPERTY_KEY to ensure
that property key is evaluated only once.
Dmitry Volyntsev [Fri, 16 Sep 2022 03:20:10 +0000 (20:20 -0700)]
Fixed property set instruction when key modifies base binding.
Previously, when obj[prop] expression was evaluated, and prop was an
object with custom "toString" method, which modifies obj binding as its
side-effect, the binding update was visible to property set instruction
which is not correct.
This closes #550 issue on Github.
Dmitry Volyntsev [Fri, 16 Sep 2022 00:56:35 +0000 (17:56 -0700)]
Introduced njs_object_to_string().
Dmitry Volyntsev [Thu, 15 Sep 2022 05:14:50 +0000 (22:14 -0700)]
Parser: properly handling unicode space characters.
Vadim Zhestikov [Wed, 14 Sep 2022 04:13:17 +0000 (21:13 -0700)]
Modules: common code for js_import is moved to shared library.
Dmitry Volyntsev [Tue, 13 Sep 2022 00:56:44 +0000 (17:56 -0700)]
Parser: fixed async token as a property name of an object.
This closes #575 issue on Github.
Dmitry Volyntsev [Thu, 8 Sep 2022 17:03:25 +0000 (10:03 -0700)]
Improved njs_mp_free() to aling with free() semantics.
Previously, njs_mp_free() issued an assertion when p == NULL, while NULL
argument is explicitly allowed for free().
Vadim Zhestikov [Wed, 7 Sep 2022 01:44:47 +0000 (18:44 -0700)]
Fixed Object.defineProperty() with fast arrays.
Previously, Object.defineProperty() failed to properly set attributes for properties of fast array.
Vadim Zhestikov [Tue, 6 Sep 2022 18:13:31 +0000 (11:13 -0700)]
Fixed Object.freeze() with fast arrays.
Previously, Object.freeze() failed to freeze the 'length' property of a fast array.
Dmitry Volyntsev [Tue, 6 Sep 2022 17:09:08 +0000 (10:09 -0700)]
WebCrypto: fixed dangling pointer warning by gcc-12.
Dmitry Volyntsev [Fri, 2 Sep 2022 01:12:27 +0000 (18:12 -0700)]
Fixed typo introduced in
a37e4df8f082 .
Dmitry Volyntsev [Fri, 2 Sep 2022 00:49:06 +0000 (17:49 -0700)]
Added error handling for NJS_VMCODE_FUNCTION_COPY instruction.
This closes #572 issue on Github.
Dmitry Volyntsev [Thu, 1 Sep 2022 01:35:58 +0000 (18:35 -0700)]
Fixed String.prototype.trimEnd() with unicode string.
Previously, when the method was invoked with a string consisting of space
characters and at least one of them was a Unicode space separator (code
point above 127) it returned invalid string value with non-zero size
but zero length.
The fix is to update the size of the resulting string appropriately.
This closes #569 issue on Github.
Dmitry Volyntsev [Wed, 31 Aug 2022 23:52:16 +0000 (16:52 -0700)]
Added ngx.conf_prefix.
Dmitry Volyntsev [Wed, 31 Aug 2022 23:52:10 +0000 (16:52 -0700)]
Version bump.
Dmitry Volyntsev [Tue, 30 Aug 2022 04:33:29 +0000 (21:33 -0700)]
Added tag 0.7.7 for changeset
1592d46d9076
Dmitry Volyntsev [Tue, 30 Aug 2022 04:18:20 +0000 (21:18 -0700)]
Version 0.7.7.
Dmitry Volyntsev [Tue, 30 Aug 2022 04:09:12 +0000 (21:09 -0700)]
Fixed njs_value_to_string() with non-writable dst argument.
njs_arg(args, nargs, N) returns a pointer to Nth argument OR a pointer
to undefined constant value njs_value_undefined if N >= nargs.
njs_value_to_string() writes to a dst argument its result.
This means that it is incorrect to use value of njs_arg() directly
as a second argument to njs_value_to_string().
This closes #570 issue on Github.
Dmitry Volyntsev [Tue, 30 Aug 2022 04:09:11 +0000 (21:09 -0700)]
Removed dead code introduced in
f70929728e86 .
Found by Coverity (CID
1512554 ,
1512556 ).
Dmitry Volyntsev [Tue, 30 Aug 2022 04:08:47 +0000 (21:08 -0700)]
Fixed typo introduced in
f70929728e86 .
Found by Coverity (CID
1512553 ,
1512555 ).
Dmitry Volyntsev [Sat, 27 Aug 2022 04:49:14 +0000 (21:49 -0700)]
WebCrypto: fixed sign and verify methods for ECDSA.
Dmitry Volyntsev [Thu, 25 Aug 2022 23:57:28 +0000 (16:57 -0700)]
HTTP: added r.internal property.
Dmitry Volyntsev [Thu, 25 Aug 2022 00:04:58 +0000 (17:04 -0700)]
Modules: sorting external object property descriptors alphabetically.
Dmitry Volyntsev [Wed, 24 Aug 2022 02:36:16 +0000 (19:36 -0700)]
Stream: improved s.send() with async callbacks.
Previously, s.send() was a context dependant method because the
direction it was sending data to was determined by a callback (upstream
or downstream) it was called from. This works for synchronous
callbacks it was originally designed, but fails with async functions
(e.g. ngx.fetch()).
The fix is to store the direction data was going to as a separate flag
which can be used by s.send().
Dmitry Volyntsev [Tue, 23 Aug 2022 05:03:15 +0000 (22:03 -0700)]
Types: added ts types for the recent fs API.
Dmitry Volyntsev [Mon, 22 Aug 2022 23:49:27 +0000 (16:49 -0700)]
Added fs.FileHandle.
The following methods are implemented:
- fs.openSync(path[, flag[, mode]])
- fs.promises.open(path[, flag[, mode]])
- fs.fstatSync(fd)
- fs.readSync(fd, buffer, offset[, length[, position]])
- fs.writeSync(fd, buffer, offset[, length[, position]])
- fs.writeSync(fd, string[, position[, encoding]])
The following properties of FileHandle are implemented:
- filehandle.fd
- filehandle.read(buffer, offset, [length[, position]])
- filehandle.stat()
- filehandle.write(buffer, offset, [length[, position]])
- filehandle.write(string[, position[, encoding]])
- filehandle.close()
Dmitry Volyntsev [Sat, 20 Aug 2022 05:03:06 +0000 (22:03 -0700)]
Added generic handler for external objects.
Dmitry Volyntsev [Sat, 20 Aug 2022 05:02:37 +0000 (22:02 -0700)]
Modules: improved generic external getters.
Dmitry Volyntsev [Sat, 20 Aug 2022 04:38:55 +0000 (21:38 -0700)]
Tests: improved fs test262 tests robustness with different environment.
Dmitry Volyntsev [Thu, 11 Aug 2022 03:04:40 +0000 (20:04 -0700)]
Stream: improved flags argument for s.on() callback methods.
Dmitry Volyntsev [Thu, 11 Aug 2022 03:03:54 +0000 (20:03 -0700)]
Stream: removed unused field ctx->from_upstream.