]>
git.kaiwu.me - njs.git/log
Dmitry Volyntsev [Mon, 15 Jul 2019 12:54:41 +0000 (15:54 +0300)]
Tests: passing unit tests options in a struct.
Dmitry Volyntsev [Fri, 12 Jul 2019 20:30:22 +0000 (23:30 +0300)]
Improved typeof for internal types.
Dmitry Volyntsev [Fri, 12 Jul 2019 18:18:30 +0000 (21:18 +0300)]
Allowing to configure ar binary.
Dmitry Volyntsev [Thu, 11 Jul 2019 18:29:59 +0000 (21:29 +0300)]
Fixed Array.prototype.lastIndexOf() with undefined arguments.
Valentin Bartenev [Thu, 11 Jul 2019 13:10:33 +0000 (16:10 +0300)]
Optimized inlining of njs_values_strict_equal().
This function is often called inside loops and basically it does only a few cmp
instructions that can be inlined.
The more complex part related to comparing of two strings is functionally
identical to njs_string_eq(), but contains an optimization that avoids memcmp()
when strings have different lengths. This optimization has been merged into
njs_string_eq().
No functional changes.
Alexander Borisov [Thu, 11 Jul 2019 12:42:33 +0000 (15:42 +0300)]
Fixed used of uninitialized memory in String.prototype.match().
Dmitry Volyntsev [Thu, 11 Jul 2019 12:33:40 +0000 (15:33 +0300)]
Fixed Object.values() and Object.entries() for shared objects.
Previously, there was a mismatch between
njs_object_enumerate_object_length() and
njs_object_own_enumerate_object() in the way they enumerated
values.
This closes #194, #195, #196 issues on Github.
Alexander Borisov [Wed, 10 Jul 2019 18:54:33 +0000 (21:54 +0300)]
Fixed UTF-8 character escaping.
Alexander Borisov [Wed, 10 Jul 2019 11:20:53 +0000 (14:20 +0300)]
Added UTF8 validation for string literals.
All bad UTF-8 characters are replaced by '\uFFFD'
(REPLACEMENT CHARACTER).
Dmitry Volyntsev [Mon, 8 Jul 2019 14:51:58 +0000 (17:51 +0300)]
Using njs_set_regexp() and njs_regexp() where approprite.
Dmitry Volyntsev [Mon, 8 Jul 2019 14:51:35 +0000 (17:51 +0300)]
Using njs_function() and njs_set_function() where applicable.
Dmitry Volyntsev [Mon, 8 Jul 2019 14:49:43 +0000 (17:49 +0300)]
Using njs_object() macro where applicable.
Dmitry Volyntsev [Mon, 8 Jul 2019 14:49:14 +0000 (17:49 +0300)]
Using njs_number() and njs_set_number() everywhere.
Dmitry Volyntsev [Mon, 8 Jul 2019 12:31:39 +0000 (15:31 +0300)]
Added njs_date() and njs_set_date() macros.
hongzhidao [Sat, 6 Jul 2019 14:27:14 +0000 (10:27 -0400)]
Moving value methods to njs_value.c.
hongzhidao [Wed, 3 Jul 2019 02:18:56 +0000 (22:18 -0400)]
Splitting njs_vm_value_to_ext_string().
Into njs_vm_value_to_string() and njs_vm_backtrace_dump().
hongzhidao [Wed, 3 Jul 2019 02:10:19 +0000 (22:10 -0400)]
Introduced njs_function_lambda_alloc().
Dmitry Volyntsev [Wed, 3 Jul 2019 15:30:59 +0000 (18:30 +0300)]
Fixed heap-buffer-overflow while importing module.
This closes #187 issue on Github.
Dmitry Volyntsev [Wed, 3 Jul 2019 14:16:40 +0000 (17:16 +0300)]
Fixed Array.prototype.slice() for primitive types.
This closes #188 issue on Github.
Dmitry Volyntsev [Tue, 2 Jul 2019 18:37:10 +0000 (21:37 +0300)]
Refactored functions inlining.
Allowing compiler to decide whether inline a function or not by
removing most of nxt_noinline prefixes.
Inlining simple functions.
Splitting public function getters from njs internal value getters.
Alexander Borisov [Tue, 2 Jul 2019 15:14:47 +0000 (18:14 +0300)]
Fixed String.prototype.replace() for '$0' replacement string.
For example:
'0'.replace(/^/g, "$0")
Valentin Bartenev [Mon, 1 Jul 2019 19:44:14 +0000 (22:44 +0300)]
Reduced nesting level of branches in njs_string_replace_regexp().
No functional changes.
David Carlier [Tue, 18 Jun 2019 15:02:57 +0000 (15:02 +0000)]
Crypto: zeroing the context after usage.
Regardless of the compiler optimisation.
This closes #181 pull request.
Alexander Borisov [Mon, 1 Jul 2019 16:57:34 +0000 (19:57 +0300)]
Added support for functions in regexp with global match.
This closes #183 issue on GitHub.
Dmitry Volyntsev [Mon, 1 Jul 2019 16:24:10 +0000 (19:24 +0300)]
Fixed using of uninitialized value in String.prototype.padStart().
Valentin Bartenev [Thu, 27 Jun 2019 15:55:34 +0000 (18:55 +0300)]
Removed unused nxt_lvlhsh_ctx_t structure.
Valentin Bartenev [Thu, 27 Jun 2019 15:55:34 +0000 (18:55 +0300)]
Removed unused nalloc parameter from lvlhsh allocation functions.
Valentin Bartenev [Thu, 27 Jun 2019 15:54:21 +0000 (18:54 +0300)]
Version bump.
Dmitry Volyntsev [Tue, 25 Jun 2019 11:44:55 +0000 (14:44 +0300)]
Added tag 0.3.3 for changeset
c65a4be9867d
Dmitry Volyntsev [Tue, 25 Jun 2019 11:43:56 +0000 (14:43 +0300)]
Version 0.3.3.
Artem S. Povalyukhin [Mon, 24 Jun 2019 21:06:12 +0000 (00:06 +0300)]
Added signed zero support in njs.dump().
This closes #184 issue on Github.
Artem S. Povalyukhin [Sat, 22 Jun 2019 20:35:52 +0000 (23:35 +0300)]
Fixed parseInt('-0').
Dmitry Volyntsev [Thu, 20 Jun 2019 12:20:34 +0000 (15:20 +0300)]
Fixed use-of-uninitialized-value in njs_string_replace_join().
hongzhidao [Thu, 20 Jun 2019 11:36:57 +0000 (07:36 -0400)]
Getting rid of lexer property and property_token.
hongzhidao [Tue, 11 Jun 2019 02:23:56 +0000 (22:23 -0400)]
Added property getter/setter support in Object.defineProperty().
In collaboration with Dmitry Volyntsev.
Dmitry Volyntsev [Tue, 18 Jun 2019 17:27:39 +0000 (20:27 +0300)]
Style.
Dmitry Volyntsev [Tue, 18 Jun 2019 17:27:25 +0000 (20:27 +0300)]
Changed njs_object_prop_define() prototype.
Dmitry Volyntsev [Tue, 18 Jun 2019 14:57:38 +0000 (17:57 +0300)]
Added process global object.
process object properties:
argv - an array containing the command line arguments
env - an object containing the user environment
pid - process PID
ppid - process parent PID
This closes #84 issue on Github.
Dmitry Volyntsev [Tue, 18 Jun 2019 14:57:22 +0000 (17:57 +0300)]
Fixed uninitialized field in njs_vm_value_dump().
MemorySanitizer: use-of-uninitialized-value in
njs_json_push_stringify_state().
Dmitry Volyntsev [Fri, 14 Jun 2019 18:20:25 +0000 (21:20 +0300)]
Fixed njs_run expect tests.
Using exec instead of spawn to get the njs output
synchronously.
Dmitry Volyntsev [Fri, 14 Jun 2019 18:19:52 +0000 (21:19 +0300)]
Improved njs_object_own_enumerate().
Enumerating enumerable shared_hash entries even if all is false.
Dmitry Volyntsev [Tue, 11 Jun 2019 14:34:59 +0000 (17:34 +0300)]
Fixed truth value of JSON numbers in JSON.parse().
This closes #180 issue on Github.
hongzhidao [Tue, 11 Jun 2019 01:40:11 +0000 (21:40 -0400)]
Style.
hongzhidao [Tue, 11 Jun 2019 01:30:29 +0000 (21:30 -0400)]
Moving object property methods to njs_object_property.c.
hongzhidao [Wed, 5 Jun 2019 14:13:47 +0000 (22:13 +0800)]
Improved object property attributes.
Dmitry Volyntsev [Tue, 4 Jun 2019 16:38:50 +0000 (19:38 +0300)]
Fixed Object.defineProperty() for shared descriptors.
This closes #172 issue on Github.
Dmitry Volyntsev [Tue, 4 Jun 2019 13:07:14 +0000 (16:07 +0300)]
HTTP: support for null as a second argument of r.subrequest().
This closes #173 issue on Github.
Dmitry Volyntsev [Tue, 4 Jun 2019 09:45:06 +0000 (12:45 +0300)]
Handling zero byte characters inside RegExp pattern strings.
Fixed heap-buffer-overflow in RegExp.prototype.source.
This closes #168 issue on Github.
Dmitry Volyntsev [Thu, 30 May 2019 17:05:14 +0000 (20:05 +0300)]
Escaping lone closing square brackets in RegExp() constructor.
This correctly fixes #157. As in
88263426432d this was done only
for regexp literals.
Dmitry Volyntsev [Fri, 31 May 2019 12:11:39 +0000 (15:11 +0300)]
Fixed String.prototype.toBytes() for ASCII strings.
This closes #155 issue on Github.
Dmitry Volyntsev [Thu, 30 May 2019 13:46:26 +0000 (16:46 +0300)]
Fixed heap-buffer-overflow in toUpperCase() and toLowerCase().
In String.prototype. This closes #162 issue on Github.
Dmitry Volyntsev [Thu, 30 May 2019 13:16:22 +0000 (16:16 +0300)]
Moving test added in
ab5d059e4ef8 to a conditional list.
As it can fail on older libpcre versions (pcre-7.8 for example).
Dmitry Volyntsev [Thu, 30 May 2019 11:17:59 +0000 (14:17 +0300)]
Removing possible ignored regexp compilation error.
Alexander Borisov [Tue, 28 May 2019 17:51:24 +0000 (20:51 +0300)]
Improved processing of invalid surrogate pairs in JSON strings.
Previously, an exception was thrown on invalid surrogate pairs.
Now, all such pairs are converted to replacement character.
Alexander Borisov [Tue, 28 May 2019 17:49:58 +0000 (20:49 +0300)]
Improved processing of invalid surrogate pairs in strings.
Previously, an exception was thrown on invalid surrogate pairs.
Now, all such pairs are converted to replacement character.
This closes #170 issue on GitHub.
Alexander Borisov [Thu, 23 May 2019 15:03:46 +0000 (18:03 +0300)]
Added generic implementation of Array.prototype.fill().
According to ES6: 22.1.3.6.
This closes #72 issue on GitHub.
Dmitry Volyntsev [Tue, 28 May 2019 14:04:40 +0000 (17:04 +0300)]
Stream: fixed processing empty output chain in body filter.
This closes #1735 on trac.
Dmitry Volyntsev [Tue, 28 May 2019 14:04:33 +0000 (17:04 +0300)]
HTTP: improved working with unknown methods in subrequest().
Dmitry Volyntsev [Tue, 28 May 2019 12:57:35 +0000 (15:57 +0300)]
HTTP: improved getting of special response headers.
Alexander Borisov [Thu, 23 May 2019 14:39:22 +0000 (17:39 +0300)]
Added njs_value_property_set() function.
Alexander Borisov [Mon, 27 May 2019 16:06:34 +0000 (19:06 +0300)]
Fixed format of the reference exception.
Previously, it did not include filename.
hongzhidao [Tue, 21 May 2019 23:54:58 +0000 (07:54 +0800)]
Fixed Array.prototype.toString() and Date.prototype.toJSON().
This closes #163, #164, #166 issues on Github.
Valentin Bartenev [Thu, 23 May 2019 13:21:55 +0000 (16:21 +0300)]
Added "name" property for built-in methods.
Valentin Bartenev [Thu, 23 May 2019 12:05:52 +0000 (15:05 +0300)]
Fixed overwriting "constructor" property of built-in prototypes.
Valentin Bartenev [Thu, 23 May 2019 12:05:51 +0000 (15:05 +0300)]
Fixed array length property handler.
Previously it might change the length of prototype arrays.
Valentin Bartenev [Thu, 23 May 2019 12:05:51 +0000 (15:05 +0300)]
Made writable most of built-in properties and methods.
Valentin Bartenev [Thu, 23 May 2019 12:05:50 +0000 (15:05 +0300)]
Fixed setting of object properties.
Now writability of prototype properties is properly taken into account.
Alexander Borisov [Wed, 22 May 2019 18:01:39 +0000 (21:01 +0300)]
Improved working with undefined symbols.
Throwing ReferenceError in runtime.
This closes #150 issue on GitHub.
Valentin Bartenev [Tue, 21 May 2019 18:15:21 +0000 (21:15 +0300)]
Uncommented a successful test of Object.create([1,2]).length.
It's actually passing after
f5bdddca3252 .
Alexander Borisov [Tue, 21 May 2019 17:45:42 +0000 (20:45 +0300)]
Fixed integer-overflow in String.prototype.concat().
This closes #159 issue on GitHub.
Dmitry Volyntsev [Tue, 21 May 2019 16:39:25 +0000 (19:39 +0300)]
Version bump.
Dmitry Volyntsev [Tue, 21 May 2019 14:32:32 +0000 (17:32 +0300)]
Added tag 0.3.2 for changeset
82101d50fff6
Dmitry Volyntsev [Tue, 21 May 2019 14:31:13 +0000 (17:31 +0300)]
Version 0.3.2.
hongzhidao [Mon, 20 May 2019 08:05:58 +0000 (16:05 +0800)]
Style.
hongzhidao [Mon, 20 May 2019 15:14:29 +0000 (23:14 +0800)]
Fixed handling of empty block statements.
This closes #165 issue on Github.
Alexander Borisov [Fri, 17 May 2019 14:01:10 +0000 (17:01 +0300)]
Added escaping to lone closing square brackets in a regexp.
PCRE with PCRE_JAVASCRIPT_COMPAT flag rejects regexps with
lone closing square brackets as invalid. Whereas according
to ES6: 11.8.5 it is a valid regexp expression.
As a workaround, the solution is to escape those lone brackets.
This closes #157 issue on GitHub.
Dmitry Volyntsev [Fri, 17 May 2019 18:16:31 +0000 (21:16 +0300)]
Fixed String.prototype.split() for UTF8-invalid byte strings.
This closes #161 issue on Github.
Dmitry Volyntsev [Fri, 17 May 2019 14:52:30 +0000 (17:52 +0300)]
Fixed Array.prototype.slice() for UTF8-invalid byte strings.
This closes #160 issue on Github.
Alexander Borisov [Tue, 14 May 2019 10:00:44 +0000 (13:00 +0300)]
Improved String.prototype.replace().
If replace value is a function and the function return non string
value, then convert returned value to string.
This closes #61 issue on GitHub.
Alexander Borisov [Wed, 8 May 2019 14:05:05 +0000 (17:05 +0300)]
Fixed processing * quantifier for String.prototype.replace().
This closes #73 issue on GitHub.
Dmitry Volyntsev [Thu, 16 May 2019 12:20:31 +0000 (15:20 +0300)]
Fixed uninitialized-memory-access in Object.defineProperties().
This closes #158 issue on Github.
Alexander Borisov [Wed, 15 May 2019 09:51:31 +0000 (12:51 +0300)]
Fixed regexp literals parsing.
Problems were observed:
1. Escaping symbols: /\\\\/
2. Solidus symbol ('/') in square bracket: /[/]/
This closes #149 issue on GitHub.
Dmitry Volyntsev [Tue, 14 May 2019 16:13:53 +0000 (19:13 +0300)]
Fixed heap-buffer-overflow in String.prototype.lastIndexOf().
This closes #151 issue on Github.
Dmitry Volyntsev [Tue, 14 May 2019 16:00:03 +0000 (19:00 +0300)]
Improved working with arguments in String.prototype.lastIndexOf().
Dmitry Volyntsev [Mon, 13 May 2019 17:28:40 +0000 (20:28 +0300)]
Fixed heap-buffer-overflow in String.prototype.replace().
This closes #154 issue on GitHub.
Valentin Bartenev [Wed, 8 May 2019 16:09:10 +0000 (19:09 +0300)]
Fixed arrays expansion.
There were two problems with njs_array_expand():
1. It checked that the requred size with the appended elements wasn't bigger
then the array size and then did nothing. If there were elements removed
from the beggining (by shift() operation), then "size <= array->size" can
be true even if there wasn't enought free space after the array.
2. After allocating more space to prepend elements, it set array->size without
counting those elements.
Probably, the original idea was to decrement array->size while removing
elements from the beginning, but it wasn't done right. Even if so, the
new version of the function looks cleaner.
This closes #152 and closes #153 issues on Github.
Valentin Bartenev [Wed, 8 May 2019 16:09:10 +0000 (19:09 +0300)]
Simplified check for array length limit in njs_array_expand().
No functional changes.
Valentin Bartenev [Wed, 8 May 2019 16:09:10 +0000 (19:09 +0300)]
Better name for append elements count in njs_array_expand().
No functional changes.
Valentin Bartenev [Tue, 7 May 2019 17:41:07 +0000 (20:41 +0300)]
Made all constructor properties configurable.
Note that actual "constructor" property is created on demand in the prototypes'
private hash with "configurable" option set. This change corrects its state
before any access.
Dmitry Volyntsev [Tue, 7 May 2019 16:50:39 +0000 (19:50 +0300)]
Shell: executing command from command line arguments.
Dmitry Volyntsev [Tue, 7 May 2019 16:50:38 +0000 (19:50 +0300)]
Shell: sorting arguments in alphabetic order.
Dmitry Volyntsev [Tue, 7 May 2019 16:50:35 +0000 (19:50 +0300)]
Improved expect tests.
Valentin Bartenev [Mon, 6 May 2019 02:40:03 +0000 (05:40 +0300)]
Made configurable "length", "name", and most of built-in methods.
Valentin Bartenev [Mon, 6 May 2019 18:24:31 +0000 (21:24 +0300)]
Fixed return value on deleting non-existent property.
Valentin Bartenev [Mon, 6 May 2019 17:26:58 +0000 (20:26 +0300)]
Added own constructors to prototypes of built-in objects.
Valentin Bartenev [Mon, 6 May 2019 16:42:06 +0000 (19:42 +0300)]
Added support for RegExp "groups" object (ES9).
Valentin Bartenev [Mon, 6 May 2019 08:33:23 +0000 (11:33 +0300)]
Fixed own properties quering.
njs_property_query() and njs_object_property_query() were simplified.
Valentin Bartenev [Mon, 6 May 2019 14:47:26 +0000 (17:47 +0300)]
Fixed alignment of njs_object_prop_t in njs_method_private_copy().
It must be aligned to njs_value_t.
Valentin Bartenev [Mon, 6 May 2019 02:07:51 +0000 (05:07 +0300)]
Added missing "static" to njs_object_property_query() declaration.
Valentin Bartenev [Sun, 5 May 2019 21:27:22 +0000 (00:27 +0300)]
Uncommented a successful test of getOwnPropertyNames().
It's actully passing after
1213e0a2b485 and
d7a0eb59a7e7 changes.