]>
git.kaiwu.me - njs.git/log
Alexander Borisov [Thu, 25 Jun 2020 10:10:04 +0000 (13:10 +0300)]
Parser: fixed broken for expressions parsing.
Alexander Borisov [Thu, 25 Jun 2020 10:10:03 +0000 (13:10 +0300)]
Parser: fixed broken object literals parsing.
Alexander Borisov [Fri, 19 Jun 2020 16:48:13 +0000 (19:48 +0300)]
Parser: fixed line counting in template literals.
This closes #321 issue on GitHub.
Alexander Borisov [Fri, 19 Jun 2020 16:48:12 +0000 (19:48 +0300)]
Parser: fixed heap-use-after-free in optional chain.
Dmitry Volyntsev [Thu, 18 Jun 2020 18:56:24 +0000 (18:56 +0000)]
Optimizing njs_builtin_match_native_function() for speed.
Dmitry Volyntsev [Thu, 18 Jun 2020 18:56:24 +0000 (18:56 +0000)]
Introduced line level backtrace.
This closes #140 issue on Github.
Dmitry Volyntsev [Wed, 17 Jun 2020 14:38:23 +0000 (14:38 +0000)]
Improved unit test.
1) Accepting multiple options.
2) Added filter option, to run only selected suites.
For example, the following command would run only
selected tests:
$ njs_unit_test -f "module|externals"
module tests: PASSED [5/5]
externals tests: PASSED [76/76]
TOTAL: PASSED [81/81]
Dmitry Volyntsev [Tue, 16 Jun 2020 13:55:25 +0000 (13:55 +0000)]
Optimizing njs_native_frame_t structure.
Moving njs_exception_t from njs_native_frame_t to njs_frame_t,
as the exception structure is only needed for lambda frames.
Alexander Borisov [Mon, 15 Jun 2020 15:33:57 +0000 (18:33 +0300)]
Parser: fixed semicolon check after continue/break statement.
This closes #318 issue on GitHub.
Dmitry Volyntsev [Mon, 15 Jun 2020 15:26:44 +0000 (15:26 +0000)]
Merging interactive tests into unit_test binary.
Dmitry Volyntsev [Mon, 15 Jun 2020 15:26:40 +0000 (15:26 +0000)]
Fixed potential memory corruption in njs_function_frame_invoke().
It is a bug to cast vm->top_frame which is (njs_native_frame_t *) type,
to (njs_frame_t *) in general context. The cast is allowed only for the
lambda frames.
The bug did not manifest itself previously because native frames were
allocated with NJS_NATIVE_FRAME_SIZE, which is sizeof(njs_value_t) aligned
size of njs_native_frame_t (on 64bit platform are 80 and 72 bytes
respectively). njs_frame_t contains njs_native_frame_t as a first field.
The frame->retval assignment for native frames resulted in 8 padding bytes
were used as a storage space for the retval field.
The bug becomes visible when the size of njs_native_frame_t changes.
The issue was introduced in
540f03725df2 .
Artem S. Povalyukhin [Sun, 31 May 2020 05:45:41 +0000 (08:45 +0300)]
Added fs.Dirent, fs.readdir() and friends.
This closes #254 issue on Github.
Dmitry Volyntsev [Tue, 9 Jun 2020 12:56:56 +0000 (12:56 +0000)]
Introduced njs_array_push().
Alexander Borisov [Sat, 6 Jun 2020 15:15:07 +0000 (18:15 +0300)]
Parser: correctly fixing closing brace unwinding for invalid syntax.
The issue was introduced in
86f55a7dc4a4 .
Previous attempts to catch unprocessed token in
ea1754b79e7a and
61dce54ce3d5
were misplaced.
Alexander Borisov [Thu, 4 Jun 2020 14:26:01 +0000 (17:26 +0300)]
Parser: added line positions for AST nodes.
Dmitry Volyntsev [Fri, 5 Jun 2020 11:42:41 +0000 (11:42 +0000)]
Fixed %TypedArray%.prototype.copyWithin() with nonzero byte offset.
Dmitry Volyntsev [Fri, 5 Jun 2020 11:42:40 +0000 (11:42 +0000)]
Added %TypedArray%.prototype.sort().
Dmitry Volyntsev [Fri, 5 Jun 2020 11:40:42 +0000 (11:40 +0000)]
Fixed AST printing with long strings values.
The issue was introduced in
d255e73aed3b .
Dmitry Volyntsev [Wed, 3 Jun 2020 18:40:10 +0000 (18:40 +0000)]
Fixed Array.prototype.splice() according to the specification.
Dmitry Volyntsev [Wed, 3 Jun 2020 18:40:09 +0000 (18:40 +0000)]
Introduced njs_array_copy_within().
Alexander Borisov [Wed, 3 Jun 2020 17:49:52 +0000 (20:49 +0300)]
Fixed parsing of invalid unary expression.
The issue was introduced in
86f55a7dc4a4 .
Alexander Borisov [Wed, 3 Jun 2020 12:17:51 +0000 (15:17 +0300)]
Removed support for functions in labelled statements.
In strict mode, support for functions is prohibited.
The issue was introduced in
86f55a7dc4a4 .
Dmitry Volyntsev [Tue, 2 Jun 2020 12:08:04 +0000 (12:08 +0000)]
Ensuring Array.prototype.sort() stability.
For fast arrays with empty or undefined elements.
This closes #312 issue on Github.
Dmitry Volyntsev [Tue, 2 Jun 2020 14:59:30 +0000 (14:59 +0000)]
Fixed endless loop in Array.prototype.sort().
With non-consistent comparison function.
The issue was introduced in
1d0825906438 .
Dmitry Volyntsev [Tue, 2 Jun 2020 14:59:27 +0000 (14:59 +0000)]
Fixed typo introduced in
db77713e0536 .
Alexander Borisov [Tue, 2 Jun 2020 14:53:29 +0000 (17:53 +0300)]
Added necessary checks for obligatory grammar symbols.
The issue was introduced in
86f55a7dc4a4 .
Alexander Borisov [Tue, 2 Jun 2020 14:53:28 +0000 (17:53 +0300)]
Fixed parsing of invalid binary expressions.
The issue was introduced in
86f55a7dc4a4 .
Alexander Borisov [Tue, 2 Jun 2020 14:53:27 +0000 (17:53 +0300)]
Fixed checking return value in primary expression.
The issue was introduced in
86f55a7dc4a4 .
Alexander Borisov [Mon, 1 Jun 2020 15:09:29 +0000 (18:09 +0300)]
Silenced cast to smaller integer type warning.
This fixes compilation with clang 11.
Alexander Borisov [Mon, 1 Jun 2020 15:09:29 +0000 (18:09 +0300)]
Fixed grammar introduced in
86f55a7dc4a4 .
Alexander Borisov [Mon, 1 Jun 2020 15:09:28 +0000 (18:09 +0300)]
Removed unnecessary NULL checks introduced in
86f55a7dc4a4 .
Found by Clang static analyzer.
Alexander Borisov [Mon, 1 Jun 2020 15:09:27 +0000 (18:09 +0300)]
Fixed potential NULL-pointer dereference added in
86f55a7dc4a4 .
Found by Coverity (CID
1463867 ).
Dmitry Volyntsev [Fri, 29 May 2020 19:29:59 +0000 (19:29 +0000)]
Added AST serialization.
Alexander Borisov [Fri, 29 May 2020 17:00:32 +0000 (20:00 +0300)]
Parser refactoring.
Alexander Borisov [Fri, 29 May 2020 11:49:36 +0000 (14:49 +0300)]
Added return value check forgotten in
9beb9ea093b5 .
Found by Coverity (CID
1463859 ,
1463860 ).
Alexander Borisov [Wed, 27 May 2020 15:18:40 +0000 (18:18 +0300)]
Fixed heap-use-after-free in JSON.parse() function.
Dmitry Volyntsev [Wed, 27 May 2020 12:02:59 +0000 (12:02 +0000)]
Fixed use-of-uninitialized-value after
1d0825906438 .
Found by Coverity (CID
1463834 ).
Dmitry Volyntsev [Tue, 26 May 2020 19:03:11 +0000 (19:03 +0000)]
Removed dead store assignment after
1d0825906438 .
Found with Clang Static Analyzer.
Dmitry Volyntsev [Tue, 26 May 2020 19:02:57 +0000 (19:02 +0000)]
Fixed potential undefined behavior in memcpy().
The issue was introduced in
1d0825906438 .
Found with Clang Static Analyzer.
Dmitry Volyntsev [Tue, 26 May 2020 16:35:11 +0000 (16:35 +0000)]
Fixed Array.prototype.reverse() according to the specification.
Dmitry Volyntsev [Tue, 26 May 2020 16:34:45 +0000 (16:34 +0000)]
Added friends functions to fs.renameSync().
Dmitry Volyntsev [Tue, 26 May 2020 16:21:05 +0000 (16:21 +0000)]
Improved handling of retvals of system function in "fs".
Artem S. Povalyukhin [Tue, 12 May 2020 09:31:19 +0000 (12:31 +0300)]
Added fs.mkdir(), fs.rmdir() and friends.
Dmitry Volyntsev [Mon, 25 May 2020 14:21:22 +0000 (14:21 +0000)]
Fixed Array.prototype.sort() according to the specification.
Artem S. Povalyukhin [Mon, 11 May 2020 06:58:28 +0000 (09:58 +0300)]
Introduced fs.Error.code.
Artem S. Povalyukhin [Mon, 11 May 2020 06:58:28 +0000 (09:58 +0300)]
Introduced njs_errno_string().
Dmitry Volyntsev [Mon, 25 May 2020 14:21:20 +0000 (14:21 +0000)]
Introduced quick sort implementation.
Dmitry Volyntsev [Mon, 25 May 2020 14:21:14 +0000 (14:21 +0000)]
Version bump.
Dmitry Volyntsev [Tue, 19 May 2020 11:42:11 +0000 (11:42 +0000)]
Added tag 0.4.1 for changeset
9400790bf538
Dmitry Volyntsev [Tue, 19 May 2020 11:41:05 +0000 (11:41 +0000)]
Version 0.4.1.
Dmitry Volyntsev [Mon, 18 May 2020 14:43:00 +0000 (14:43 +0000)]
Fixed benchmark test missed in
78b8cfd5b1e9 .
Dmitry Volyntsev [Mon, 18 May 2020 13:22:34 +0000 (13:22 +0000)]
Fixed Array.prototype.slice() for sparse arrays.
Dmitry Volyntsev [Fri, 8 May 2020 15:52:40 +0000 (15:52 +0000)]
HTTP: introduced raw headers API.
1) r.rawHeadersIn returns an array of key-value pairs exactly as they
were received from the client.
2) r.rawHeadersOut returns an array of key-value pairs of respose
headers.
Header names are not lowercased, and duplicates are not merged.
Dmitry Volyntsev [Fri, 8 May 2020 12:02:32 +0000 (12:02 +0000)]
Added description for API methods.
Dmitry Volyntsev [Thu, 7 May 2020 13:49:55 +0000 (13:49 +0000)]
Modules: added typescript API description.
This closes #177 issue on Github.
Dmitry Volyntsev [Thu, 30 Apr 2020 10:11:33 +0000 (10:11 +0000)]
Modules: setting retval to undefined for functions returning nothing.
This fixes #305 issue on Github.
Dmitry Volyntsev [Thu, 30 Apr 2020 09:44:00 +0000 (09:44 +0000)]
HTTP: simplifed headers handling.
Dmitry Volyntsev [Wed, 29 Apr 2020 11:57:11 +0000 (11:57 +0000)]
HTTP: improved getting of multi-valued headers in r.headersIn.
1) Duplicates of Content-Type, ETag, From, Max-Forwards, Referer,
Proxy-Authorization, User-Agent are ignored.
2) Duplicate Cookie headers are joined together with ';'.
3) All other duplicate header values are joined together with ','.
Dmitry Volyntsev [Wed, 29 Apr 2020 11:57:10 +0000 (11:57 +0000)]
Version bump.
Dmitry Volyntsev [Thu, 23 Apr 2020 11:30:25 +0000 (11:30 +0000)]
Added tag 0.4.0 for changeset
6144aafa1472
Dmitry Volyntsev [Thu, 23 Apr 2020 10:46:54 +0000 (10:46 +0000)]
Version 0.4.0.
Dmitry Volyntsev [Tue, 21 Apr 2020 12:37:00 +0000 (12:37 +0000)]
HTTP: added support for multi-valued headers in r.headersOut.
1) Added support for an array of values in assignments:
r.headersOut['Set-Cookie'] = ['a', '', 'b'] will result in
Set-Cookie: a
Set-Cookie: b
headers in output. All previous Set-Cookie are deleted.
Only the last element in the table will take effect for standard
headers such as Content-Type that only accept a single value.
r.headersOut.foo = [] is the same as
delete r.headersOut.foo
2) Improved getting of special arrays:
Set-Cookie is always returned as an array.
Duplicates of Age, Content-Length, Content-Type, ETag, Expires,
Last-Modified, Location, Retry-After are ignored.
All other duplicate header values are joined together with ','.
This closes #266 issue on Github.
Dmitry Volyntsev [Tue, 21 Apr 2020 11:57:29 +0000 (11:57 +0000)]
HTTP: improved iteration over header objects with duplicates.
In
9e327cd3a33e duplicates were filtered out only for Cookie and
X-Forwarded-For.
Dmitry Volyntsev [Tue, 21 Apr 2020 11:56:46 +0000 (11:56 +0000)]
HTTP: improved iteration over r.headersOut with special headers.
In
f6234460852a getting of special headers "Content-Type" and
"Content-Length" was introduced. Still these headers were invisible
during iteration over r.headersOut object.
Dmitry Volyntsev [Tue, 21 Apr 2020 11:56:37 +0000 (11:56 +0000)]
Improved njs_vm_value() in case of a value is not found.
Dmitry Volyntsev [Fri, 17 Apr 2020 17:04:18 +0000 (17:04 +0000)]
Improved reading of pseudofiles.
Dmitry Volyntsev [Fri, 17 Apr 2020 17:03:59 +0000 (17:03 +0000)]
Shell: introduced scripts arguments support.
Dmitry Volyntsev [Tue, 14 Apr 2020 12:43:09 +0000 (12:43 +0000)]
Fixed String.prototype.replace() when function returns non-string.
This closes #303 issue on Github.
Dmitry Volyntsev [Tue, 14 Apr 2020 12:42:05 +0000 (12:42 +0000)]
Fixed RegExp() constructor with empty pattern and non-empty flags.
Dmitry Volyntsev [Tue, 14 Apr 2020 12:18:25 +0000 (12:18 +0000)]
Modules: added js_import directive.
Dmitry Volyntsev [Sun, 12 Apr 2020 12:56:25 +0000 (12:56 +0000)]
Added "lineNumber" and "fileName" to SyntaxError.
Dmitry Volyntsev [Sun, 12 Apr 2020 10:01:40 +0000 (10:01 +0000)]
Introduced njs_vm_opt_init().
Dmitry Volyntsev [Fri, 10 Apr 2020 11:15:12 +0000 (11:15 +0000)]
Fixed potential heap-buffer-overflow in njs_vm_value().
The issue was introduced in
7ccb8b32cc02 .
Dmitry Volyntsev [Wed, 8 Apr 2020 13:15:02 +0000 (13:15 +0000)]
Linking global variables and global object properties.
Dmitry Volyntsev [Fri, 3 Apr 2020 16:10:00 +0000 (16:10 +0000)]
Added API for working with arrays.
Dmitry Volyntsev [Fri, 3 Apr 2020 16:06:55 +0000 (16:06 +0000)]
Fixed building unit tests by SunC 5.15.
Fixed warning "initializer will be sign-extended".
Dmitry Volyntsev [Thu, 26 Mar 2020 14:12:16 +0000 (17:12 +0300)]
Improved njs_object_length() and friends prototypes.
While object length is always non-negative it is simpler to work with
signed value to avoid too many typecasts.
Dmitry Volyntsev [Mon, 23 Mar 2020 16:58:50 +0000 (19:58 +0300)]
Fixed instructions jump offset output.
Previously jump offsets were rendered as unsigned integers whereas jump
offsets can be negative.
Dmitry Volyntsev [Mon, 23 Mar 2020 16:52:02 +0000 (19:52 +0300)]
Fixed "PROP NEXT" instruction.
The proper way to access array's elements is "start" field whereas
"data" is an allocation field. While currently they are numerically
indentical it may change in the future.
Dmitry Volyntsev [Mon, 23 Mar 2020 14:15:46 +0000 (17:15 +0300)]
Lexer: fixed handling of no-newline at the end of the script.
Dmitry Volyntsev [Fri, 20 Mar 2020 14:33:10 +0000 (17:33 +0300)]
Removed outdated commentary after
ccfa84cea2b3 .
Dmitry Volyntsev [Fri, 20 Mar 2020 14:33:10 +0000 (17:33 +0300)]
HTTP: returning undefined value when "responseBody" is unavailable.
Missed in
b758915e2406 .
Dmitry Volyntsev [Fri, 20 Mar 2020 14:33:06 +0000 (17:33 +0300)]
Refactored externals.
This closes #16 issue on Github.
Dmitry Volyntsev [Wed, 18 Mar 2020 15:29:17 +0000 (18:29 +0300)]
Stream: fixed typo in the log message introduced in
bbec3cdb747b .
Dmitry Volyntsev [Wed, 18 Mar 2020 11:50:46 +0000 (14:50 +0300)]
Simplifed object enumeration.
Dmitry Volyntsev [Tue, 17 Mar 2020 15:33:25 +0000 (18:33 +0300)]
Added benchmark tests for externals.
Dmitry Volyntsev [Mon, 16 Mar 2020 12:49:51 +0000 (15:49 +0300)]
Fixed makefile dependency issue introduced in
eb9258cfcf40 .
Dmitry Volyntsev [Thu, 5 Mar 2020 13:05:40 +0000 (16:05 +0300)]
Removed unused typedef.
Dmitry Volyntsev [Thu, 5 Mar 2020 12:24:54 +0000 (15:24 +0300)]
Added externals backtrace test.
Dmitry Volyntsev [Thu, 5 Mar 2020 12:24:52 +0000 (15:24 +0300)]
Sharing external initialization between unit and interactive tests.
Alexander Borisov [Wed, 4 Mar 2020 14:12:55 +0000 (17:12 +0300)]
Fixed NULL-pointer dereference in "__proto__" property handler.
This closes #293 issue on GitHub.
Dmitry Volyntsev [Tue, 3 Mar 2020 17:14:48 +0000 (20:14 +0300)]
Fixed compilation with gcc.
Dmitry Volyntsev [Tue, 3 Mar 2020 16:00:54 +0000 (19:00 +0300)]
Fixed integer constant is too large compilation error by gcc 4.4.
Dmitry Volyntsev [Tue, 3 Mar 2020 15:57:15 +0000 (18:57 +0300)]
Version bump.
Dmitry Volyntsev [Tue, 3 Mar 2020 14:18:06 +0000 (17:18 +0300)]
Added tag 0.3.9 for changeset
fc4eeaaf0dfe
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.