]>
git.kaiwu.me - njs.git/log
Dmitry Volyntsev [Tue, 3 Mar 2020 14:17:08 +0000 (17:17 +0300)]
Version 0.3.9.
Dmitry Volyntsev [Mon, 2 Mar 2020 18:11:37 +0000 (21:11 +0300)]
HTTP: introduced detached subrequest mode in r.subrequest().
If "options.detached" boolean flag is true the created subrequest is
a detached subrequest. Responses to detached subrequest are ignored.
Unlike ordinary subrequests, a detached subrequest can be created
inside a variable handler. The detached flag and callback argument are
mutually exclusive.
Dmitry Volyntsev [Fri, 28 Feb 2020 16:39:13 +0000 (19:39 +0300)]
Fixed integer-overflow in Date() constructor.
Found by UndefinedBehaviorSanitizer.
Dmitry Volyntsev [Fri, 28 Feb 2020 15:56:24 +0000 (18:56 +0300)]
Fixed njs_date_string().
This closes #292 issue on Github.
hongzhidao [Thu, 30 Jan 2020 13:14:30 +0000 (21:14 +0800)]
Fixed non-native module importing.
Previously, string from "import statement" was used as a key in a hash
to keep track of already loaded modules. This works fine for built-in
modules. It can cause an issue when different modules from different
paths but with identical names are loaded. This patch avoids the issue
by using a full path to a file as a key.
This closes #282 issue on GitHub.
Alexander Borisov [Thu, 27 Feb 2020 11:30:14 +0000 (14:30 +0300)]
Fixed heap-buffer-overflow in lexer introduced in
87d05fb35ff9 .
Dmitry Volyntsev [Wed, 26 Feb 2020 14:48:46 +0000 (17:48 +0300)]
Fixed Unicode Escaping in JSON.stringify() according to spec.
Lowecase hexadecimal number are required.
Alexander Borisov [Tue, 25 Feb 2020 13:03:20 +0000 (16:03 +0300)]
Fixed JSON.stringify() with Number() and String() objects.
According to the specification.
Alexander Borisov [Wed, 26 Feb 2020 13:22:12 +0000 (16:22 +0300)]
Improved fields and typedefs naming in parser.
njs_token_t -> njs_token_type_t
node->token -> node->token_type
lexer->prev_token -> lexer->prev_type
Alexander Borisov [Wed, 26 Feb 2020 13:22:10 +0000 (16:22 +0300)]
Lexer refactoring.
Alexander Borisov [Wed, 26 Feb 2020 09:41:51 +0000 (12:41 +0300)]
Fixed handling of space argument in JSON.stringify().
This closes #294 issue on GitHub.
Dmitry Volyntsev [Wed, 19 Feb 2020 14:21:32 +0000 (17:21 +0300)]
Fixed Number.prototype.toPrecision().
This closes #290 issue on Github.
Artem S. Povalyukhin [Mon, 10 Feb 2020 22:48:24 +0000 (01:48 +0300)]
Added fs.symlink(), fs.unlink(), fs.realpath() and friends.
Dmitry Volyntsev [Tue, 18 Feb 2020 15:55:50 +0000 (18:55 +0300)]
Fixed encodeURI() and decodeURI() according to the spec.
Dmitry Volyntsev [Tue, 18 Feb 2020 15:42:37 +0000 (18:42 +0300)]
Fixed njs_json_append_string().
Dmitry Volyntsev [Tue, 18 Feb 2020 15:41:38 +0000 (18:41 +0300)]
Detecting memory error in njs_chb_*() functions.
Dmitry Volyntsev [Mon, 17 Feb 2020 13:18:40 +0000 (16:18 +0300)]
Fixed potential integer-overflow in String.prototype.replace().
Dmitry Volyntsev [Mon, 17 Feb 2020 13:18:38 +0000 (16:18 +0300)]
Simplified code using magic arguments introduced in
6df48738a043 .
This reduces code duplication and the binary size.
Dmitry Volyntsev [Mon, 17 Feb 2020 13:18:18 +0000 (16:18 +0300)]
Style: removing excessive commentaries.
Dmitry Volyntsev [Mon, 17 Feb 2020 13:13:43 +0000 (16:13 +0300)]
Introduced ToLength() according to ES6.
Since ES6, according to the spec maximum length value is 2**53 - 1 not
2**32 - 1, so uint64_t data type is required.
Alexander Borisov [Thu, 13 Feb 2020 13:25:37 +0000 (16:25 +0300)]
Fixed Object.getOwnPropertySymbols().
This closes #291 issue on GitHub.
Dmitry Volyntsev [Mon, 10 Feb 2020 14:39:41 +0000 (17:39 +0300)]
Filtering out integer indices in njs_object_completions().
This closes #285 issue on Github.
Dmitry Volyntsev [Mon, 10 Feb 2020 14:09:53 +0000 (17:09 +0300)]
Improved Array object allocation after
ccfa84cea2b3 .
Sometimes flat array alignment is desired, even if its "length" exceeds
32768. This patch introduces additional argument for njs_array_alloc()
which enforced flat allocation when it is set.
Artem S. Povalyukhin [Sun, 26 Jan 2020 18:56:23 +0000 (21:56 +0300)]
Introduced fs.access and friends.
Artem S. Povalyukhin [Sat, 25 Jan 2020 18:55:50 +0000 (21:55 +0300)]
Introduced fs.promises API.
Dmitry Volyntsev [Thu, 6 Feb 2020 17:23:12 +0000 (20:23 +0300)]
Moving modules_hash to njs_vm_shared_t.
As it is shared between VM instances.
Dmitry Volyntsev [Wed, 5 Feb 2020 14:30:20 +0000 (17:30 +0300)]
Removed dead code in njs_json_parse_iterator() after
ccfa84cea2b3 .
Dmitry Volyntsev [Wed, 5 Feb 2020 12:54:56 +0000 (15:54 +0300)]
Fixed njs_key_string_get() usage.
njs_key_string_get() converts Symbol instances to strings,
while Symbols should never be converted to strings implicitly.
The function is expected to be used only while generating Error
messages.
Found by Clang static analyzer.
Dmitry Volyntsev [Wed, 5 Feb 2020 12:26:18 +0000 (15:26 +0300)]
Removed dead store assignment after
ccfa84cea2b3 .
Found by Clang static analyzer.
Dmitry Volyntsev [Tue, 4 Feb 2020 17:35:02 +0000 (20:35 +0300)]
Introduced memory-efficient arrays.
1) If "length" of ordinary array exceeds 32768 it is converted to
to array-like object.
2) Array.prototype.concat() is rewritten according to the spec.
3) Array.prototype.slice() is rewritten according to the spec.
Dmitry Volyntsev [Tue, 4 Feb 2020 17:35:00 +0000 (20:35 +0300)]
Added fast path in [[Get]] and [[Set]] for arrays and typed-arrays.
Artem S. Povalyukhin [Mon, 20 Jan 2020 10:24:09 +0000 (13:24 +0300)]
Fixed callback invocations in "fs" module.
This closes #200 issue on Github.
Dmitry Volyntsev [Wed, 22 Jan 2020 12:29:47 +0000 (15:29 +0300)]
Fixed match of native function is backtraces.
Since
6df48738a043 native methods are not uniquely identifiable
by a function pointer as several method may share common
C function and differ only in magic argument.
Dmitry Volyntsev [Wed, 22 Jan 2020 12:29:44 +0000 (15:29 +0300)]
Fixed typo introduced in
1abb97e9d9dc .
Dmitry Volyntsev [Tue, 21 Jan 2020 14:37:37 +0000 (17:37 +0300)]
Version bump.
Dmitry Volyntsev [Tue, 21 Jan 2020 13:30:20 +0000 (16:30 +0300)]
Added tag 0.3.8 for changeset
1abb97e9d9dc
Dmitry Volyntsev [Tue, 21 Jan 2020 13:06:20 +0000 (16:06 +0300)]
Version 0.3.8.
Dmitry Volyntsev [Tue, 21 Jan 2020 13:03:30 +0000 (16:03 +0300)]
Fixed %TypedArray%.prototype.fill().
For subarrays starting from non-zero offset.
Dmitry Volyntsev [Tue, 21 Jan 2020 13:01:48 +0000 (16:01 +0300)]
Added %TypedArray%.prototype.subarray().
Dmitry Volyntsev [Tue, 21 Jan 2020 13:01:45 +0000 (16:01 +0300)]
Fixed Function constructor according to the spec.
"this" value should point to the global object.
Artem S. Povalyukhin [Fri, 17 Jan 2020 07:04:28 +0000 (10:04 +0300)]
Introduced njs_fs_path_arg().
Dmitry Volyntsev [Thu, 16 Jan 2020 18:29:43 +0000 (21:29 +0300)]
Fixed use-of-uninitialized-value for the global this object.
Found by MemorySanitizer.
Dmitry Volyntsev [Thu, 16 Jan 2020 16:18:41 +0000 (19:18 +0300)]
Fixed format specifier in typed-array constructor.
Dmitry Volyntsev [Thu, 16 Jan 2020 16:18:41 +0000 (19:18 +0300)]
Fixed memory-leak introduced in
b840b7af946e .
Dmitry Volyntsev [Thu, 16 Jan 2020 16:18:39 +0000 (19:18 +0300)]
HTTP: introduced promise support in r.subrequest().
If callback is not provided r.subrequest() returns an ordinary
Promise object that resolves to subrequest response object.
Dmitry Volyntsev [Thu, 16 Jan 2020 12:14:38 +0000 (15:14 +0300)]
Added support for typed-arrays in String.bytesFrom().
Dmitry Volyntsev [Tue, 14 Jan 2020 13:52:42 +0000 (16:52 +0300)]
Introduced "global" and "globalThis" aliases to the global object.
Dmitry Volyntsev [Mon, 13 Jan 2020 18:35:15 +0000 (21:35 +0300)]
Refactored njs_benchmark.
Dmitry Volyntsev [Thu, 9 Jan 2020 12:55:05 +0000 (15:55 +0300)]
Removed dead store assignments.
Found by Clang static analyzer.
Dmitry Volyntsev [Thu, 9 Jan 2020 12:54:52 +0000 (15:54 +0300)]
Fixed integer overflow in njs_typed_array_constructor().
Found by Coverity (CID
1457371 ).
Dmitry Volyntsev [Thu, 9 Jan 2020 12:54:16 +0000 (15:54 +0300)]
Removed dead code in njs_typed_array_get() after
1c3c593cc3fd .
Found by Coverity (CID
1457372 ).
Alexander Borisov [Thu, 9 Jan 2020 12:21:08 +0000 (15:21 +0300)]
Fixed typo introduced in
61bf7a31e685 .
Found by Coverity (CIDs
1457370 ,
1457369 ).
Dmitry Volyntsev [Fri, 27 Dec 2019 16:17:26 +0000 (19:17 +0300)]
Fixed "length" may be uninitialized in njs_typed_array_constructor().
Found by Clang static analyzer.
Alexander Borisov [Thu, 26 Dec 2019 12:31:54 +0000 (15:31 +0300)]
Fixed njs_vm_handle_events().
Fixed typo introduced in
61bf7a31e685 . Event loop is expected to process two
queues: posted events and promise events according to the spec. The "do while"
loop was introduced to handle possible promise events which may appear as
a result of posted events processing. The loop termination condition should
check for emptyness of promise events queue, because posted events can only be
created outside the loop (externally).
Dmitry Volyntsev [Thu, 26 Dec 2019 11:53:52 +0000 (14:53 +0300)]
Shell: stopping events handling for uncaught exception in file mode.
This closes #269 issue on Github.
hongzhidao [Fri, 13 Dec 2019 04:47:37 +0000 (12:47 +0800)]
Fixed import segfault.
This closes #274 issue on Github.
Dmitry Volyntsev [Wed, 25 Dec 2019 12:59:01 +0000 (15:59 +0300)]
Introduced TypedArray objects.
Added the global constructors:
Uint8Array, Int8Array, Uint8ClampedArray, Uint16Array, Int16Array,
Uint32Array, Int32Array, Float32Array, Float64Array.
Implemented:
- TypedArray(),
- TypedArray(length),
- TypedArray(buffer, [start, [end]]),
- TypedArray(object),
- TypedArray(typedarray),
- TypedArray.BYTES_PER_ELEMENT.
- %TypedArray%.prototype.constructor
- get %TypedArray%.prototype.buffer
- get %TypedArray%.prototype.byteLength
- get %TypedArray%.prototype.byteOffset
- get %TypedArray%.prototype.length
- %TypedArray%.prototype[@@toStringTag]
- %TypedArray%.prototype.set(array [, start])
- %TypedArray%.prototype.slice([start, [end]])
- %TypedArray%.prototype.toString()
- %TypedArray%.prototype.join(separator)
- %TypedArray%.prototype.fill().
In collaboration with Tiago Natel de Moura.
This closes #264 issue on Github.
Dmitry Volyntsev [Tue, 17 Dec 2019 15:22:50 +0000 (18:22 +0300)]
Shell: fixed output of large values for last evaluated expression.
Alexander Borisov [Tue, 17 Dec 2019 07:35:11 +0000 (10:35 +0300)]
Introduced the Promise object.
Implemented according to the specification without: Promise.all(),
Promise.allSettled(), Promise.race().
This closes #39 issue on GitHub.
Dmitry Volyntsev [Mon, 16 Dec 2019 12:18:51 +0000 (15:18 +0300)]
Fixed stack-use-after-free in njs_value_property_set().
Dmitry Volyntsev [Mon, 16 Dec 2019 12:18:51 +0000 (15:18 +0300)]
Fixed Array.prototype.join().
Resulting string length of Array.prototype.join() was invalid
when joined values are not strings.
The issue was introduced in
5bf71dfc052f .
Valentin Bartenev [Thu, 12 Dec 2019 15:50:27 +0000 (18:50 +0300)]
Introduced nullish coalescing operator.
Dmitry Volyntsev [Wed, 11 Dec 2019 12:58:05 +0000 (15:58 +0300)]
Refactored Array.prototype.join() using njs_chb_t API.
Dmitry Volyntsev [Wed, 11 Dec 2019 12:30:26 +0000 (15:30 +0300)]
Introduced generic string builder API.
Tiago Natel de Moura [Wed, 27 Nov 2019 14:02:04 +0000 (14:02 +0000)]
Introduced the ArrayBuffer object.
Dmitry Volyntsev [Fri, 6 Dec 2019 11:59:48 +0000 (14:59 +0300)]
Improved object type initialization structure.
Allowing predefine magic argument for a type constructor.
This allows to write generic constructor functions.
Dmitry Volyntsev [Fri, 6 Dec 2019 11:44:54 +0000 (14:44 +0300)]
Introduced ToIndex() conversion primitive from the spec.
Dmitry Volyntsev [Fri, 6 Dec 2019 11:44:11 +0000 (14:44 +0300)]
Fixed RegExp() instance properties.
1) "lastIndex" is the only own property descriptor.
2) "lastIndex" property descriptor is writable.
3) "lastIndex" is coersed to integer in RegExpBuiltinExec() and
can be any value (not only positive integers).
Alexander Borisov [Tue, 3 Dec 2019 15:02:40 +0000 (18:02 +0300)]
Added njs_is_memory_error() function.
Alexander Borisov [Tue, 3 Dec 2019 14:58:30 +0000 (17:58 +0300)]
Fixed typo introduced in
904333a40816 .
Alexander Borisov [Tue, 3 Dec 2019 14:13:34 +0000 (17:13 +0300)]
Introduced SpeciesConstructor() from the specification.
Alexander Borisov [Tue, 3 Dec 2019 13:44:03 +0000 (16:44 +0300)]
Style.
Alexander Borisov [Tue, 3 Dec 2019 13:43:04 +0000 (16:43 +0300)]
Shell: fixed memory leak when empty line is entered.
Dmitry Volyntsev [Tue, 3 Dec 2019 11:59:26 +0000 (14:59 +0300)]
Fixed Number.prototype.toString(radix).
Fixed buffer-overflow in Number.prototype.toString(radix) when
fraction == delta == 0. The last comparison might by true for very
small numbers (denormals) around zero when fast-math mode is enabled.
The issue was introduced in
5f0812d53158 .
Artem S. Povalyukhin [Fri, 29 Nov 2019 09:53:33 +0000 (12:53 +0300)]
Added Object.setPrototypeOf().
This closes #265 issue on Github.
Dmitry Volyntsev [Fri, 29 Nov 2019 14:11:11 +0000 (17:11 +0300)]
Making backtrace a property of a thrown exception.
Artem S. Povalyukhin [Thu, 28 Nov 2019 10:25:00 +0000 (13:25 +0300)]
Improved Object.create().
This closes #261 issue on Github.
Artem S. Povalyukhin [Thu, 28 Nov 2019 06:59:10 +0000 (09:59 +0300)]
Added Object.is().
This closes #260 issue on Github.
Dmitry Volyntsev [Wed, 27 Nov 2019 15:28:13 +0000 (18:28 +0300)]
Fixed TypeError message in ValidateAndApplyPropertyDescriptor().
For Symbol key when object is not extensible.
Dmitry Volyntsev [Wed, 27 Nov 2019 13:51:29 +0000 (16:51 +0300)]
Improved Array.prototype.includes().
Dmitry Volyntsev [Wed, 27 Nov 2019 12:48:32 +0000 (15:48 +0300)]
Fixed Object.defineProperties() according to the specification.
This closes #210 issue on Github.
Dmitry Volyntsev [Wed, 27 Nov 2019 12:40:44 +0000 (15:40 +0300)]
Checking extensible flag in ValidateAndApplyPropertyDescriptor().
Dmitry Volyntsev [Wed, 27 Nov 2019 11:36:04 +0000 (14:36 +0300)]
Introduced specification primitives SameValue(), SameValueZero().
Dmitry Volyntsev [Tue, 26 Nov 2019 15:44:11 +0000 (18:44 +0300)]
Fixed JSON.stringify() and njs.dump() allocation error handling.
Previously, the return value of njs_json_buf_append() was not
verified in some places.
Found by Coverity (CID
1456031 ).
Artem S. Povalyukhin [Tue, 26 Nov 2019 10:22:09 +0000 (13:22 +0300)]
Fixed operator "in" according to the specification.
Dmitry Volyntsev [Tue, 26 Nov 2019 12:11:40 +0000 (15:11 +0300)]
Interactive shell: introduced global print() alias to console.log().
Dmitry Volyntsev [Tue, 26 Nov 2019 12:09:45 +0000 (15:09 +0300)]
Introduced njs_vm_bind().
This is a generic replacement for njs_vm_external_bind().
Dmitry Volyntsev [Tue, 26 Nov 2019 12:01:02 +0000 (15:01 +0300)]
Fixed "accumulative" mode of VM.
The issue was introduced in
452ce96df2e3 .
This closes #258 issue on Github.
Dmitry Volyntsev [Mon, 25 Nov 2019 14:54:58 +0000 (17:54 +0300)]
HTTP: improved r.parent property handler.
Previously, r.parent handler threw an exception if it was called not for
a subrequest. This is too restrictive, as it prevents any iterations
over all r properties (for example: JSON.stringify()).
Instead, "undefined" value is returned as it is already done for
r.requestBody when request body is unavailable.
Dmitry Volyntsev [Mon, 25 Nov 2019 14:53:32 +0000 (17:53 +0300)]
Fixed njs.dump() for objects with NJS_PROPERTY_HANDLER props.
Dmitry Volyntsev [Mon, 25 Nov 2019 14:53:19 +0000 (17:53 +0300)]
Added externals support in JSON.stringify().
Artem S. Povalyukhin [Sat, 23 Nov 2019 09:52:06 +0000 (12:52 +0300)]
Pass unprintable values to JSON.stringify() replacer function.
This closes #257 issue on Github.
Artem S. Povalyukhin [Fri, 22 Nov 2019 22:02:04 +0000 (01:02 +0300)]
Fixed handling of Symbol values in JSON.stringify().
Artem S. Povalyukhin [Fri, 22 Nov 2019 21:09:26 +0000 (00:09 +0300)]
Fixed Object.prototype.valueOf() according to the specification.
This closes #256 issue on Github.
Dmitry Volyntsev [Fri, 22 Nov 2019 16:03:23 +0000 (19:03 +0300)]
Introduced Symbol.toStringTag support for builtin objects.
This closes #255 issue on Github.
Artem S. Povalyukhin [Fri, 22 Nov 2019 08:02:55 +0000 (11:02 +0300)]
Fixed typo in njs_string_prototype_pad().
The typo was introduced in
47cdd4680fc2 .
This closes #253 issue on Github.
Artem S. Povalyukhin [Thu, 21 Nov 2019 19:31:14 +0000 (22:31 +0300)]
Fixed hash collision for empty string key.
The issue was introduced in
10a19a2e1d4f .
Dmitry Volyntsev [Thu, 21 Nov 2019 17:56:06 +0000 (20:56 +0300)]
Added Symbol support for builtin operations.
1) object property get/set, object literals.
2) Added Object.getOwnPropertySymbols().
3) Extended to support Symbol: Object.getOwnPropertyNames(),
Object.keys(), Object.defineProperty(), Object.defineProperties(),
Object.getOwnPropertyDescriptor(),
Object.getOwnPropertyDescriptors().
Artem S. Povalyukhin [Tue, 19 Nov 2019 17:45:22 +0000 (20:45 +0300)]
Added initial version of Symbol primitive type.
This closes #249 issue on Github.
Dmitry Volyntsev [Tue, 19 Nov 2019 16:32:26 +0000 (19:32 +0300)]
Introduced njs_fuzzer target.