]> git.kaiwu.me - njs.git/log
njs.git
5 years agoAdded TypeScript description for fs module.
Jakub Jirutka [Fri, 9 Oct 2020 00:33:31 +0000 (02:33 +0200)]
Added TypeScript description for fs module.

5 years agoAdded TypeScript description for Buffer type.
Jakub Jirutka [Fri, 16 Oct 2020 23:38:31 +0000 (01:38 +0200)]
Added TypeScript description for Buffer type.

5 years agoAdded support for Object.prototype.valueOf() in Buffer.from().
Alexander Borisov [Tue, 20 Oct 2020 11:00:40 +0000 (14:00 +0300)]
Added support for Object.prototype.valueOf() in Buffer.from().

Missed in 27bb9caf186c.

5 years agoFixed returned value for Buffer.prototype.write* functions.
Alexander Borisov [Mon, 19 Oct 2020 12:51:37 +0000 (15:51 +0300)]
Fixed returned value for Buffer.prototype.write* functions.

All Buffer.prototype.write* functions must return offset plus
the number of bytes written.

The issue was introduced in 27bb9caf186c.

5 years agoFixed heap-buffer-overflow for RegExp.prototype[Symbol.replace].
Alexander Borisov [Tue, 13 Oct 2020 12:44:33 +0000 (15:44 +0300)]
Fixed heap-buffer-overflow for RegExp.prototype[Symbol.replace].

Previously, RegExp.prototype[Symbol.replace] might overrun the boundaries
of the result of the custom "exec" method for a RegExp argument. The
issue occurred when the result object had zero length.  The length is
used to create an array and the zero index was always written without
respect for the length resulting is heap-buffer-overflow.

The issue was introduced in 1c729f765cfb.

5 years agoHTTP: throwing an exception in internalRedirect() for a subrequest.
Alexander Borisov [Thu, 8 Oct 2020 15:47:04 +0000 (18:47 +0300)]
HTTP: throwing an exception in internalRedirect() for a subrequest.

This closes #214 issue on GitHub.

5 years agoFixed JSON.stringify() for arrays resizable via getters.
Alexander Borisov [Tue, 6 Oct 2020 17:51:56 +0000 (20:51 +0300)]
Fixed JSON.stringify() for arrays resizable via getters.

5 years agoFixed heap-use-after-free in JSON.stringify().
Alexander Borisov [Tue, 6 Oct 2020 17:24:21 +0000 (20:24 +0300)]
Fixed heap-use-after-free in JSON.stringify().

njs_json_stringify_iterator() assumed, while stringifying flat arrays, that a
flat array will always remain flat.  This is not the case for flat arrays with
values with custom getters which may modify the enclosing array upon
invocation.

This closes #322 issue on GitHub.

5 years agoFixed heap-use-after-free in JSON.parse().
Alexander Borisov [Tue, 6 Oct 2020 16:53:26 +0000 (19:53 +0300)]
Fixed heap-use-after-free in JSON.parse().

This correctly fixes the issues addressed in 1405:9beb9ea093b5.
The initial fix wrongly assumed that the "value" pointer is still valid when
njs_is_fast_array(&state->value) is true and the pointer can be used for
the fast path.  This is not the case when the array object is resized.

Moreover, the fast path branch may be completely eliminated because
JSON.parse() with the replacer function is relatively slow by itself.

This closes #323, #324, #325 issues on GitHub.

5 years agoImproved working with the path argument in "fs" module.
Dmitry Volyntsev [Fri, 2 Oct 2020 12:18:44 +0000 (12:18 +0000)]
Improved working with the path argument in "fs" module.

5 years agoVersion bump.
Dmitry Volyntsev [Fri, 2 Oct 2020 12:18:41 +0000 (12:18 +0000)]
Version bump.

5 years agoAdded tag 0.4.4 for changeset fdfd580b0dd6
Dmitry Volyntsev [Tue, 29 Sep 2020 13:32:37 +0000 (13:32 +0000)]
Added tag 0.4.4 for changeset fdfd580b0dd6

5 years agoVersion 0.4.4. 0.4.4
Dmitry Volyntsev [Tue, 29 Sep 2020 13:31:47 +0000 (13:31 +0000)]
Version 0.4.4.

5 years agoAdding support for Buffer objects in "fs" methods.
Dmitry Volyntsev [Mon, 28 Sep 2020 17:45:44 +0000 (17:45 +0000)]
Adding support for Buffer objects in "fs" methods.

fs.writeFile(), fs.appendFile() and friends may accept an instance of
Buffer as an argument.

Also, fs.readFile() and friends now return an instance of Buffer instead of
Byte-string when encoding is not provided.

Added Buffer encoding for fs.readdir(), fs.realpath() and friends.

5 years agoFixed njs_buffer_set() introduced in 27bb9caf186c.
Dmitry Volyntsev [Mon, 28 Sep 2020 16:59:35 +0000 (16:59 +0000)]
Fixed njs_buffer_set() introduced in 27bb9caf186c.

Previously an instance of Uint8Array was returned, not Buffer.

5 years agoFixed dead store assignment after eef4ab1bee70.
Dmitry Volyntsev [Thu, 24 Sep 2020 19:00:38 +0000 (19:00 +0000)]
Fixed dead store assignment after eef4ab1bee70.

Found by Clang static analyzer.

5 years agoAdding support for Buffer objects in crypto methods.
Dmitry Volyntsev [Tue, 22 Sep 2020 18:42:21 +0000 (18:42 +0000)]
Adding support for Buffer objects in crypto methods.

5 years agoFixed unit test on big-endian platforms.
Dmitry Volyntsev [Mon, 21 Sep 2020 17:15:10 +0000 (17:15 +0000)]
Fixed unit test on big-endian platforms.

5 years agoAdded support for detached-buffers.
Dmitry Volyntsev [Fri, 18 Sep 2020 18:00:32 +0000 (18:00 +0000)]
Added support for detached-buffers.

5 years agoAdded forgotten 'break' statement missed in 27bb9caf186c.
Alexander Borisov [Thu, 17 Sep 2020 10:10:51 +0000 (13:10 +0300)]
Added forgotten 'break' statement missed in 27bb9caf186c.

Found by Coverity (CID 1466731).

5 years agoIntroduced Buffer implementation.
Alexander Borisov [Wed, 16 Sep 2020 14:22:01 +0000 (17:22 +0300)]
Introduced Buffer implementation.

5 years agoHTTP: added support for http/2 and http/3 in r.httpVersion.
Dmitry Volyntsev [Fri, 11 Sep 2020 13:54:57 +0000 (13:54 +0000)]
HTTP: added support for http/2 and http/3 in r.httpVersion.

5 years agoFixed TextDecoder.prototype.decode() with non-zero TypedArray offset.
Alexander Borisov [Mon, 7 Sep 2020 14:55:24 +0000 (17:55 +0300)]
Fixed TextDecoder.prototype.decode() with non-zero TypedArray offset.

5 years agoAdded support for ArrayBuffer in TextDecoder.prototype.decode().
Alexander Borisov [Mon, 7 Sep 2020 14:55:10 +0000 (17:55 +0300)]
Added support for ArrayBuffer in TextDecoder.prototype.decode().

This closes #331 issue on Github.

5 years agoSeparating string length counting and encoding conversion.
Alexander Borisov [Mon, 7 Sep 2020 14:54:47 +0000 (17:54 +0300)]
Separating string length counting and encoding conversion.

5 years agoAdded %TypedArray% remaining methods.
Dmitry Volyntsev [Mon, 7 Sep 2020 12:44:07 +0000 (12:44 +0000)]
Added %TypedArray% remaining methods.

The following methods were added: of(), from().

5 years agoFixed TextDecoder() test on big-endian platforms.
Dmitry Volyntsev [Thu, 3 Sep 2020 13:30:17 +0000 (13:30 +0000)]
Fixed TextDecoder() test on big-endian platforms.

5 years agoFixed TypedArraySpeciesCreate().
Dmitry Volyntsev [Thu, 3 Sep 2020 13:30:16 +0000 (13:30 +0000)]
Fixed TypedArraySpeciesCreate().

According to the spec, it is expected to verify that created
typed-array instance has appropriate length.

5 years agoFixed RegExp.prototype[Symbol.replace] when replace val is function.
Dmitry Volyntsev [Thu, 3 Sep 2020 13:30:15 +0000 (13:30 +0000)]
Fixed RegExp.prototype[Symbol.replace] when replace val is function.

Previously, a custom function received garbage value as the first
argument.

5 years agoFixed RegExpBuiltinExec() with global flag and byte-strings.
Dmitry Volyntsev [Tue, 1 Sep 2020 17:25:33 +0000 (17:25 +0000)]
Fixed RegExpBuiltinExec() with global flag and byte-strings.

The issue was introduced in f9082cd59ba6 (0.4.2).  Since 1c729f765cfb
(0.4.2) RegExp.prototype[Symbol.replace] with a regexp with the global
flag may result in an endless loop for byte-strings with broken UTF8
encoding.

5 years agoAdded DataView object.
Dmitry Volyntsev [Tue, 1 Sep 2020 16:37:33 +0000 (16:37 +0000)]
Added DataView object.

5 years agoIntroduced copy-on-write for ArrayBuffer.
Dmitry Volyntsev [Fri, 28 Aug 2020 11:51:35 +0000 (11:51 +0000)]
Introduced copy-on-write for ArrayBuffer.

5 years agoAligning switch statements in njs_typed_array_prototype_iterator().
Dmitry Volyntsev [Fri, 28 Aug 2020 11:48:22 +0000 (11:48 +0000)]
Aligning switch statements in njs_typed_array_prototype_iterator().

Merging NJS_ARRAY_FILTER case to default case for all switch statements.
This makes code more static-analyzer friendly.

5 years agoFixed double close in njs_ftw() introduced in 5a80b43b7098.
Dmitry Volyntsev [Fri, 28 Aug 2020 11:47:50 +0000 (11:47 +0000)]
Fixed double close in njs_ftw() introduced in 5a80b43b7098.

This correctly fixes Coverity CID 1465877.

5 years agoIntroduced njs_assert() macro.
Dmitry Volyntsev [Thu, 27 Aug 2020 14:43:23 +0000 (14:43 +0000)]
Introduced njs_assert() macro.

5 years agoSplitting debug and debug-memory configure options.
Dmitry Volyntsev [Thu, 27 Aug 2020 14:43:22 +0000 (14:43 +0000)]
Splitting debug and debug-memory configure options.

5 years agoParser: fixed njs_queue_remove() macro usage.
Dmitry Volyntsev [Thu, 27 Aug 2020 14:43:19 +0000 (14:43 +0000)]
Parser: fixed njs_queue_remove() macro usage.

The issue caused segfault when NJS_DEBUG is defined.

The issue was introduced in 86f55a7dc4a4.

5 years agoFixed return value for string base64/base64url encoding.
Alexander Borisov [Wed, 26 Aug 2020 18:11:03 +0000 (21:11 +0300)]
Fixed return value for string base64/base64url encoding.

5 years agoImproved UTF-8 encoding/decoding.
Alexander Borisov [Wed, 26 Aug 2020 18:05:46 +0000 (21:05 +0300)]
Improved UTF-8 encoding/decoding.

5 years agoFixed String.prototype.indexOf() for byte-strings.
Dmitry Volyntsev [Wed, 26 Aug 2020 14:56:47 +0000 (14:56 +0000)]
Fixed String.prototype.indexOf() for byte-strings.

The issue was introduced in e8a941b394a3 (0.4.3).

This closes #335 issue on Github.

5 years agoGenerator: simplified runtime errors generation.
Dmitry Volyntsev [Wed, 26 Aug 2020 14:55:47 +0000 (14:55 +0000)]
Generator: simplified runtime errors generation.

5 years agoAdapted expect tests after 775c81dcbe61.
Dmitry Volyntsev [Wed, 26 Aug 2020 14:55:28 +0000 (14:55 +0000)]
Adapted expect tests after 775c81dcbe61.

5 years agoFixed function "constructor" property handler while setting.
Dmitry Volyntsev [Mon, 24 Aug 2020 11:28:21 +0000 (11:28 +0000)]
Fixed function "constructor" property handler while setting.

5 years agoImproved njs.dump() with built-in functions.
Dmitry Volyntsev [Fri, 21 Aug 2020 13:07:54 +0000 (13:07 +0000)]
Improved njs.dump() with built-in functions.

5 years agoAdded remaining methods for %TypedArray%.prototype.
Dmitry Volyntsev [Fri, 21 Aug 2020 13:07:48 +0000 (13:07 +0000)]
Added remaining methods for %TypedArray%.prototype.

The following methods were added:
every(), filter(), find(), findIndex(), forEach(), includes(),
indexOf(), lastIndexOf(), map(), reduce(), reduceRight(), reverse(),
some().

5 years agoFixed njs_property_query() while quering symbol keys.
Dmitry Volyntsev [Wed, 19 Aug 2020 12:43:23 +0000 (12:43 +0000)]
Fixed njs_property_query() while quering symbol keys.

Since 37f1f20de909, njs_object_hash_test() requires lhq->key.start
to be NULL to avoid hash collisions.

The field is zeroed by njs_property_query_init(), but the field still
might be non-zero when njs_property_query() is called inside a loop.

The fix is to ensure lhq->key.start == NULL for symbol keys.

This closes #268 issue on Github.

5 years agoFixed function "prototype" property handler while setting.
Dmitry Volyntsev [Tue, 18 Aug 2020 16:53:46 +0000 (16:53 +0000)]
Fixed function "prototype" property handler while setting.

njs_function_prototype_create() works as a getter and setter.  As a
getter the function is expected to create "prototype" property on the
first access, it also sets F.prototype.constructor property to ensure
F.prototype.constructor === F.

Setting of "constructor" property is not needed in setter context, as
it may overwrite existing "constructor" property in setval.

This closes #333 issue on Github.

5 years agoRefactored iterator Array methods.
Dmitry Volyntsev [Tue, 18 Aug 2020 11:52:17 +0000 (11:52 +0000)]
Refactored iterator Array methods.

5 years agoAdded support for numeric separators (ES12).
Valentin Bartenev [Mon, 17 Aug 2020 16:55:46 +0000 (19:55 +0300)]
Added support for numeric separators (ES12).

5 years agoUnicode case tables updated to version 13.0.0 (March 2020).
Valentin Bartenev [Mon, 17 Aug 2020 11:44:29 +0000 (14:44 +0300)]
Unicode case tables updated to version 13.0.0 (March 2020).

5 years agoHTTP: fixed location merge.
Dmitry Volyntsev [Mon, 17 Aug 2020 11:22:35 +0000 (11:22 +0000)]
HTTP: fixed location merge.

5 years agoImproved error handling in njs_file_tree_walk().
Dmitry Volyntsev [Thu, 13 Aug 2020 13:40:36 +0000 (13:40 +0000)]
Improved error handling in njs_file_tree_walk().

This also fixes Coverity CID 1465877.

5 years agoFixing Coverity warnings introduced in 24de499877ca.
Dmitry Volyntsev [Wed, 12 Aug 2020 14:57:31 +0000 (14:57 +0000)]
Fixing Coverity warnings introduced in 24de499877ca.

CIDs: 146587014658711465872.

5 years agoVersion bump.
Dmitry Volyntsev [Wed, 12 Aug 2020 12:56:35 +0000 (12:56 +0000)]
Version bump.

5 years agoAdded tag 0.4.3 for changeset 1ada1061a040
Dmitry Volyntsev [Tue, 11 Aug 2020 14:31:50 +0000 (14:31 +0000)]
Added tag 0.4.3 for changeset 1ada1061a040

5 years agoVersion 0.4.3. 0.4.3
Dmitry Volyntsev [Tue, 11 Aug 2020 14:31:07 +0000 (14:31 +0000)]
Version 0.4.3.

5 years agoImproved fs.rmdir() to support recursive directory removal.
Artem S. Povalyukhin [Sat, 25 Jul 2020 12:49:03 +0000 (15:49 +0300)]
Improved fs.rmdir() to support recursive directory removal.

5 years agoGetting rid of non-portable _GNU_SOURCE define.
Dmitry Volyntsev [Tue, 11 Aug 2020 14:31:04 +0000 (14:31 +0000)]
Getting rid of non-portable _GNU_SOURCE define.

5 years agoIntroduced TextEncoder/TextDecoder implementation.
Alexander Borisov [Tue, 28 Jul 2020 13:58:59 +0000 (16:58 +0300)]
Introduced TextEncoder/TextDecoder implementation.

According to WHATWG encoding spec.

5 years agoIntroduced tags for NJS_DATA type.
Dmitry Volyntsev [Thu, 30 Jul 2020 17:47:05 +0000 (17:47 +0000)]
Introduced tags for NJS_DATA type.

NJS_DATA is designed to contain arbitrary opaque pointers.
Tags are used to distinguish different opaque pointers.

5 years agoFixed njs_prop_handler_t inline documentation.
Dmitry Volyntsev [Wed, 29 Jul 2020 17:00:23 +0000 (17:00 +0000)]
Fixed njs_prop_handler_t inline documentation.

5 years agoImproved readability of surrogate pairs handling.
Dmitry Volyntsev [Mon, 27 Jul 2020 14:34:35 +0000 (14:34 +0000)]
Improved readability of surrogate pairs handling.

5 years agoFixed TOCTOU in fs.mkdir() introduced in cb2ff67e595d.
Dmitry Volyntsev [Mon, 27 Jul 2020 14:18:15 +0000 (14:18 +0000)]
Fixed TOCTOU in fs.mkdir() introduced in cb2ff67e595d.

Found by Coverity (CID 1465508).

5 years agoImproved fs.mkdir() to support recursive directory creation.
Artem S. Povalyukhin [Wed, 15 Jul 2020 12:51:06 +0000 (15:51 +0300)]
Improved fs.mkdir() to support recursive directory creation.

5 years agoImproved String.prototype.toString() for ordinary strings.
Dmitry Volyntsev [Fri, 24 Jul 2020 14:02:04 +0000 (14:02 +0000)]
Improved String.prototype.toString() for ordinary strings.

Allowing converting all strings to encodings 'hex', 'base64', 'base64url'.

5 years agoFixed pre/post increment/decrement in assignment operations.
Alexander Borisov [Thu, 23 Jul 2020 10:24:10 +0000 (13:24 +0300)]
Fixed pre/post increment/decrement in assignment operations.

Previously, the compound assignment operations did not create temporary
index for increments/decrements in the generator. The result was that
the increment/decrement changed the value immediately in place, which
led to incorrect calculations.

The fix is to use a separate temporary index for increments/decrements in
assignment operations.

This closes #271 issue on GitHub.

5 years agoIntroduced Query String module implementation.
Alexander Borisov [Wed, 22 Jul 2020 12:21:15 +0000 (15:21 +0300)]
Introduced Query String module implementation.

In collaboration with Dmitry Volyntsev.

This closes #288 issue on GitHub.

5 years agoFixed njs_value_property() for NJS_DECLINED from prop handler.
Alexander Borisov [Wed, 22 Jul 2020 12:21:14 +0000 (15:21 +0300)]
Fixed njs_value_property() for NJS_DECLINED from prop handler.

This ensures retval has valid value for any case except NJS_ERROR.

5 years agoFixed clearing UTF-8 context for two-byte codepoints.
Alexander Borisov [Wed, 22 Jul 2020 12:21:13 +0000 (15:21 +0300)]
Fixed clearing UTF-8 context for two-byte codepoints.

5 years agoFixed njs_string_truncate() function for non-byte strings.
Alexander Borisov [Wed, 22 Jul 2020 12:21:13 +0000 (15:21 +0300)]
Fixed njs_string_truncate() function for non-byte strings.

5 years agoIntroduced njs_chb_append_str() as inline function.
Dmitry Volyntsev [Wed, 22 Jul 2020 11:27:18 +0000 (11:27 +0000)]
Introduced njs_chb_append_str() as inline function.

To catch erroneous passing of njs_string_prop_t (instead of njs_str_t)
in compile time.

5 years agoIntroduced UTF-8 decoder according to WHATWG encoding spec.
Alexander Borisov [Wed, 15 Jul 2020 16:19:19 +0000 (19:19 +0300)]
Introduced UTF-8 decoder according to WHATWG encoding spec.

5 years agoIntroduced UTF-16 according to WHATWG encoding spec.
Alexander Borisov [Wed, 15 Jul 2020 16:19:18 +0000 (19:19 +0300)]
Introduced UTF-16 according to WHATWG encoding spec.

5 years agoFixed detection of endianness introduced in fcb5e172abaf.
Dmitry Volyntsev [Wed, 15 Jul 2020 15:34:16 +0000 (15:34 +0000)]
Fixed detection of endianness introduced in fcb5e172abaf.

Previously, NJS_HAVE_LITTLE_ENDIAN was declared unconditionally.

This correctly fixes #326 issue on Github.

5 years agoTests: improved declaring of sparse arrays in unit tests.
Dmitry Volyntsev [Tue, 14 Jul 2020 18:22:03 +0000 (18:22 +0000)]
Tests: improved declaring of sparse arrays in unit tests.

5 years agoStyle.
Dmitry Volyntsev [Tue, 14 Jul 2020 17:21:53 +0000 (17:21 +0000)]
Style.

5 years agoParser: fixed regexp-literals parsing with '=' characters.
Dmitry Volyntsev [Tue, 14 Jul 2020 17:20:29 +0000 (17:20 +0000)]
Parser: fixed regexp-literals parsing with '=' characters.

Previously, njs lexer decoded '/=' as an assignment token.

This closes #329 issue on Github.

5 years agoFixed unit test on big-endian platforms.
Dmitry Volyntsev [Tue, 14 Jul 2020 13:16:06 +0000 (13:16 +0000)]
Fixed unit test on big-endian platforms.

This closes #326 issue on Github.

5 years agoFixed njs_number_to_int32() for big-endian platforms.
Dmitry Volyntsev [Tue, 14 Jul 2020 13:16:05 +0000 (13:16 +0000)]
Fixed njs_number_to_int32() for big-endian platforms.

This is related to #326 issue in Github.

5 years agoParser: fixed parsing return statement without semicolon.
Alexander Borisov [Tue, 14 Jul 2020 11:49:46 +0000 (14:49 +0300)]
Parser: fixed parsing return statement without semicolon.

The issue was introduced in 86f55a7dc4a4.

This closes #330 issue on GitHub.

5 years agoFixed SetFunctionName() with Symbol keys.
Dmitry Volyntsev [Thu, 9 Jul 2020 13:57:10 +0000 (13:57 +0000)]
Fixed SetFunctionName() with Symbol keys.

This improves 85c1b6ba326b.

5 years agoHTTP: removed dead store assignment after 3df09cf5345c.
Dmitry Volyntsev [Wed, 8 Jul 2020 13:07:06 +0000 (13:07 +0000)]
HTTP: removed dead store assignment after 3df09cf5345c.

5 years agoFixed Array.prototype.join() with TypeArray instance.
Dmitry Volyntsev [Wed, 8 Jul 2020 13:07:05 +0000 (13:07 +0000)]
Fixed Array.prototype.join() with TypeArray instance.

Found by Clang static analyzer.
The issue was introduced in ccfa84cea2b3.

5 years agoVersion bump.
Dmitry Volyntsev [Wed, 8 Jul 2020 13:07:03 +0000 (13:07 +0000)]
Version bump.

5 years agoAdded tag 0.4.2 for changeset b409e86fd02a
Dmitry Volyntsev [Tue, 7 Jul 2020 12:25:03 +0000 (12:25 +0000)]
Added tag 0.4.2 for changeset b409e86fd02a

5 years agoVersion 0.4.2. 0.4.2
Dmitry Volyntsev [Tue, 7 Jul 2020 12:23:48 +0000 (12:23 +0000)]
Version 0.4.2.

5 years agoRemoved dead store assignment after 1c729f765cfb.
Dmitry Volyntsev [Tue, 7 Jul 2020 12:23:47 +0000 (12:23 +0000)]
Removed dead store assignment after 1c729f765cfb.

Found by Clang static analyzer.

5 years agoFixed String.prototype.replace() when replacer throws exception.
Dmitry Volyntsev [Tue, 7 Jul 2020 12:23:46 +0000 (12:23 +0000)]
Fixed String.prototype.replace() when replacer throws exception.

This issue was introduced in 1c729f765cfb.
Found by Clang static analyzer.

5 years agoFixed GetSubstitution() with absent namedCaptures.
Dmitry Volyntsev [Tue, 7 Jul 2020 12:23:45 +0000 (12:23 +0000)]
Fixed GetSubstitution() with absent namedCaptures.

This issue was introduced in 1c729f765cfb.
Found by Clang static analyzer.

5 years agoSilenced Coverity false-positive NULL-pointer dereference warning.
Dmitry Volyntsev [Tue, 7 Jul 2020 12:23:44 +0000 (12:23 +0000)]
Silenced Coverity false-positive NULL-pointer dereference warning.

Found by Coverity (CID 1463869).

5 years agoFixed potential NULL-pointer dereference (CID 1464584).
Dmitry Volyntsev [Tue, 7 Jul 2020 12:23:42 +0000 (12:23 +0000)]
Fixed potential NULL-pointer dereference (CID 1464584).

5 years agoAdded TypeScript test.
Dmitry Volyntsev [Mon, 6 Jul 2020 18:37:13 +0000 (18:37 +0000)]
Added TypeScript test.

5 years agoHTTP: fixed TypeScript description for headers.
Dmitry Volyntsev [Mon, 6 Jul 2020 16:44:03 +0000 (16:44 +0000)]
HTTP: fixed TypeScript description for headers.

The common headers were declared using only lowercase characters.
Unknown outgoing headers are declared as having the following type:
NjsStringLike | NjsStringLike[]. This causes an issue when unknown
header is used in the context requiring only NjsStringLike.

The fix is to declare common headers using canonical casing.

The issue was introduced in 8f3ef384f69e.

5 years agoHTTP: improved TypeScript API description for detached subrequests.
Artem S. Povalyukhin [Sat, 27 Jun 2020 16:26:41 +0000 (19:26 +0300)]
HTTP: improved TypeScript API description for detached subrequests.

5 years agoFixed TypeScript description for NjsByteString type.
Artem S. Povalyukhin [Sat, 27 Jun 2020 16:26:41 +0000 (19:26 +0300)]
Fixed TypeScript description for NjsByteString type.

NjsByteString was declared as it has no relation to string primitive type.
This causes a problem when a variable of type NjsByteString is passed into
built-in functions expecting string type.

The issue was introduced in 8f3ef384f69e.

5 years agoFixed String.prototype.replace() according to the specification.
Dmitry Volyntsev [Thu, 2 Jul 2020 14:00:16 +0000 (14:00 +0000)]
Fixed String.prototype.replace() according to the specification.

This closes #308 issue on Github.

5 years agoIntroduced RegExpBuiltinExec().
Dmitry Volyntsev [Thu, 2 Jul 2020 13:59:33 +0000 (13:59 +0000)]
Introduced RegExpBuiltinExec().

5 years agoImproved README page.
Dmitry Volyntsev [Thu, 2 Jul 2020 12:59:54 +0000 (12:59 +0000)]
Improved README page.

5 years agoFixed String.prototype.repeat() according to the specification.
Dmitry Volyntsev [Thu, 2 Jul 2020 12:59:48 +0000 (12:59 +0000)]
Fixed String.prototype.repeat() according to the specification.

5 years agoParser: fixed parsing of regexp flags.
Dmitry Volyntsev [Thu, 2 Jul 2020 12:58:50 +0000 (12:58 +0000)]
Parser: fixed parsing of regexp flags.