]> git.kaiwu.me - njs.git/log
njs.git
6 years agoStyle.
Dmitry Volyntsev [Fri, 8 Nov 2019 17:33:46 +0000 (20:33 +0300)]
Style.

6 years agoUnifying Date.prototype.*ToString() function into single handler.
Dmitry Volyntsev [Fri, 8 Nov 2019 13:29:34 +0000 (16:29 +0300)]
Unifying Date.prototype.*ToString() function into single handler.

6 years agoRefactored working with Date object.
Dmitry Volyntsev [Fri, 8 Nov 2019 13:29:29 +0000 (16:29 +0300)]
Refactored working with Date object.

1) Replacing gmtime_r() and localtime_r() with builtin function.
2) Custom getters and setters for each field (like hours, minutes,
   seconds) are replaced with generic functions.

6 years agoPassing to native function additional magic argument.
Dmitry Volyntsev [Fri, 8 Nov 2019 13:29:24 +0000 (16:29 +0300)]
Passing to native function additional magic argument.

This allows to make more generic function handlers.

6 years agoAdded arguments validation for configure script.
Dmitry Volyntsev [Tue, 5 Nov 2019 17:49:57 +0000 (20:49 +0300)]
Added arguments validation for configure script.

6 years agoAdded explanation for why njs CLI cannot be built.
Dmitry Volyntsev [Tue, 5 Nov 2019 17:49:56 +0000 (20:49 +0300)]
Added explanation for why njs CLI cannot be built.

6 years agoauto/cc cleanup.
Dmitry Volyntsev [Tue, 5 Nov 2019 17:49:56 +0000 (20:49 +0300)]
auto/cc cleanup.

6 years agoAdded implementation of Array.prototype.copyWithin().
Alexander Borisov [Tue, 5 Nov 2019 17:24:48 +0000 (20:24 +0300)]
Added implementation of Array.prototype.copyWithin().

6 years agoAdded Object.assign().
Alexander Mazyrin [Sat, 12 Oct 2019 13:23:25 +0000 (16:23 +0300)]
Added Object.assign().

6 years agoFixed "Date" object string formatting.
Dmitry Volyntsev [Fri, 1 Nov 2019 16:26:42 +0000 (19:26 +0300)]
Fixed "Date" object string formatting.

1) Getting rid of strftime() as it is locale dependent
    whereas output should always be in english.

2) Unifying all formatters in a single function.

6 years agoMaking custom top-level objects enumerable.
Dmitry Volyntsev [Fri, 1 Nov 2019 13:02:21 +0000 (16:02 +0300)]
Making custom top-level objects enumerable.

6 years agoFixed typo introduced in c75a8fc6d534.
Dmitry Volyntsev [Fri, 1 Nov 2019 12:48:21 +0000 (15:48 +0300)]
Fixed typo introduced in c75a8fc6d534.

This closes #242 issue on Github.

6 years agoFixed getter/setter proto.
Dmitry Volyntsev [Thu, 31 Oct 2019 16:53:21 +0000 (19:53 +0300)]
Fixed getter/setter proto.

This closes #238 issue on Github.

6 years agoFixed "constructor" property of "Hash" and "Hmac" objects.
Dmitry Volyntsev [Thu, 31 Oct 2019 15:17:34 +0000 (18:17 +0300)]
Fixed "constructor" property of "Hash" and "Hmac" objects.

6 years agoRefactored object type initialization.
Dmitry Volyntsev [Thu, 31 Oct 2019 15:17:33 +0000 (18:17 +0300)]
Refactored object type initialization.

6 years agoRemoving console.help() from CLI as it not needed anymore.
Dmitry Volyntsev [Thu, 31 Oct 2019 15:17:32 +0000 (18:17 +0300)]
Removing console.help() from CLI as it not needed anymore.

Now all available objects are accessible through the global object.

6 years agoRefactored completions and backtrace matches.
Dmitry Volyntsev [Thu, 31 Oct 2019 15:17:31 +0000 (18:17 +0300)]
Refactored completions and backtrace matches.

6 years agoMoving constructors to global object.
Dmitry Volyntsev [Thu, 31 Oct 2019 15:17:31 +0000 (18:17 +0300)]
Moving constructors to global object.

6 years agoMoving top-level objects to global object.
Dmitry Volyntsev [Thu, 31 Oct 2019 15:17:31 +0000 (18:17 +0300)]
Moving top-level objects to global object.

6 years agoExtending njs_prop_handler_t prototype.
Dmitry Volyntsev [Thu, 31 Oct 2019 15:17:30 +0000 (18:17 +0300)]
Extending njs_prop_handler_t prototype.

6 years agoFixed Array.prototype.join() with "undefined" argument.
Alexander Borisov [Wed, 30 Oct 2019 13:43:12 +0000 (16:43 +0300)]
Fixed Array.prototype.join() with "undefined" argument.

This closes #232 issue on GitHub.

6 years agoFixed Array.prototype.includes() with "undefined" argument.
Alexander Borisov [Wed, 30 Oct 2019 13:43:10 +0000 (16:43 +0300)]
Fixed Array.prototype.includes() with "undefined" argument.

This closes #230 issue on GitHub.

6 years agoFixed iterator for Array.prototype.find/findIndex() functions.
Alexander Borisov [Wed, 30 Oct 2019 13:43:09 +0000 (16:43 +0300)]
Fixed iterator for Array.prototype.find/findIndex() functions.

Array might be changed in callback function.  If an array became smaller than
the initial one, it is necessary to iterate the missing values as invalid.

This closes #229 issue on GitHub.

6 years agoFixed strict aliasing warnings with old GCC versions.
Alexander Borisov [Tue, 29 Oct 2019 12:24:58 +0000 (15:24 +0300)]
Fixed strict aliasing warnings with old GCC versions.

6 years agoAdded conversion of this value to object in Array.prototype functions.
Alexander Borisov [Mon, 28 Oct 2019 13:50:20 +0000 (16:50 +0300)]
Added conversion of this value to object in Array.prototype functions.

This closes #231 issue on GitHub.

6 years agoAdded njs_lvalue_arg() macro.
Alexander Borisov [Mon, 28 Oct 2019 13:10:17 +0000 (16:10 +0300)]
Added njs_lvalue_arg() macro.

6 years agoOptimizing njs_vm_clone() for speed.
Dmitry Volyntsev [Fri, 25 Oct 2019 13:20:37 +0000 (16:20 +0300)]
Optimizing njs_vm_clone() for speed.

Postponing allocation of structures where possible.

6 years agoFixed NativeError.prototype.message properties.
Dmitry Volyntsev [Thu, 24 Oct 2019 13:17:17 +0000 (16:17 +0300)]
Fixed NativeError.prototype.message properties.

6 years agoFixed [[Prototype]] slot of NativeErrors.
Dmitry Volyntsev [Thu, 24 Oct 2019 13:17:16 +0000 (16:17 +0300)]
Fixed [[Prototype]] slot of NativeErrors.

6 years agoRefactoring Error value types.
Dmitry Volyntsev [Thu, 24 Oct 2019 13:17:16 +0000 (16:17 +0300)]
Refactoring Error value types.

Eliminating special value types (njs_value_type_t) for error instance
objects.  According to the spec error instance objects are ordinary
objects which have an [[ErrorData]] internal slot.

6 years agoFixed heap-buffer-overflow in njs_array_reverse_iterator() function.
Alexander Borisov [Thu, 24 Oct 2019 13:15:01 +0000 (16:15 +0300)]
Fixed heap-buffer-overflow in njs_array_reverse_iterator() function.

Affected JS functions in Array.prototype: lastIndexOf, reduceRight.

6 years agoRefactoring iteration over external objects.
Dmitry Volyntsev [Wed, 23 Oct 2019 11:42:38 +0000 (14:42 +0300)]
Refactoring iteration over external objects.

Previously, two callbacks were required to support
array-like iteration for external objects (foreach, next).

Instead using only one callback (keys) to simplify.

6 years agoAdded njs_vm_array_alloc() and njs_vm_array_push() public API.
Dmitry Volyntsev [Wed, 23 Oct 2019 11:42:38 +0000 (14:42 +0300)]
Added njs_vm_array_alloc() and njs_vm_array_push() public API.

6 years agoRemoved argument prototypes for built-in functions.
Alexander Borisov [Tue, 22 Oct 2019 16:58:52 +0000 (19:58 +0300)]
Removed argument prototypes for built-in functions.

Many JS functions do not have fixed prototypes as in C. For example
String.prototype.replace() accepts RegExp or String as the first argument.

6 years agoVersion bump.
Dmitry Volyntsev [Tue, 22 Oct 2019 11:43:30 +0000 (14:43 +0300)]
Version bump.

6 years agoAdded tag 0.3.6 for changeset 7b302775917b
Dmitry Volyntsev [Tue, 22 Oct 2019 11:16:59 +0000 (14:16 +0300)]
Added tag 0.3.6 for changeset 7b302775917b

6 years agoVersion 0.3.6. 0.3.6
Dmitry Volyntsev [Tue, 22 Oct 2019 11:16:46 +0000 (14:16 +0300)]
Version 0.3.6.

6 years agoImproved functions for converting value to number.
Alexander Borisov [Mon, 21 Oct 2019 13:43:45 +0000 (16:43 +0300)]
Improved functions for converting value to number.

Added functions:
njs_value_to_number(), njs_value_to_integer(), njs_value_to_length()
njs_value_to_int32(), njs_value_to_uint32(), njs_value_to_uint16().

Removed functions:
njs_primitive_value_to_number(), njs_primitive_value_to_integer(),
njs_primitive_value_to_int32(), njs_primitive_value_to_uint32(),
njs_primitive_value_to_length().

Changed return type for njs_number_to_integer() function from int32_t
to int64_t.

6 years agoFixed keyword list.
Dmitry Volyntsev [Mon, 21 Oct 2019 12:10:34 +0000 (15:10 +0300)]
Fixed keyword list.

"undefined", "NaN" and "Infinity" are not keywords.

This closes #219 issue on Github.

6 years agoMoving global functions to global object.
Dmitry Volyntsev [Fri, 18 Oct 2019 13:38:55 +0000 (16:38 +0300)]
Moving global functions to global object.

This closes #132 issue on Github.

6 years agoQuerying global object when variable cannot be resolved.
Dmitry Volyntsev [Fri, 18 Oct 2019 13:34:50 +0000 (16:34 +0300)]
Querying global object when variable cannot be resolved.

6 years agoAvoiding OBJECT COPY instruction each time global object accessed.
Dmitry Volyntsev [Fri, 18 Oct 2019 13:28:16 +0000 (16:28 +0300)]
Avoiding OBJECT COPY instruction each time global object accessed.

6 years agoFixed "caller" and "arguments" properties of a function instance.
Artem S. Povalyukhin [Sat, 24 Aug 2019 02:41:46 +0000 (05:41 +0300)]
Fixed "caller" and "arguments" properties of a function instance.

This closes #209 issue on Github.

6 years agoHTTP: improved getting of special headers from r.headersIn.
Dmitry Volyntsev [Tue, 15 Oct 2019 17:09:49 +0000 (20:09 +0300)]
HTTP: improved getting of special headers from r.headersIn.

If multiple "Cookie" or "X-Forwarded-For" are present they
are combined into a single return value.

This closes #201 issue on Github.

6 years agoAdded default number of arguments expected by builtin functions.
Alexander Borisov [Fri, 11 Oct 2019 16:41:51 +0000 (19:41 +0300)]
Added default number of arguments expected by builtin functions.

This closes #207 issue on GitHub.

6 years agoFixed variable declaration with "from" name.
Dmitry Volyntsev [Fri, 11 Oct 2019 14:08:28 +0000 (17:08 +0300)]
Fixed variable declaration with "from" name.

Previously, "from" was declared as a reserved word.

6 years agoFixed Date.prototype.setTime().
Artem S. Povalyukhin [Fri, 11 Oct 2019 03:50:33 +0000 (06:50 +0300)]
Fixed Date.prototype.setTime().

This closes #236 issue on Github.

6 years agoFixed type of Date.prototype.
Artem S. Povalyukhin [Fri, 11 Oct 2019 05:01:03 +0000 (08:01 +0300)]
Fixed type of Date.prototype.

This closes #237 issue on Github.

6 years agoFixed Date() constructor according to specification.
Dmitry Volyntsev [Thu, 10 Oct 2019 17:54:03 +0000 (20:54 +0300)]
Fixed Date() constructor according to specification.

6 years agoFixed Date.UTC() according to specification.
Dmitry Volyntsev [Wed, 9 Oct 2019 11:43:09 +0000 (14:43 +0300)]
Fixed Date.UTC() according to specification.

This closes #235 issue on Github.

6 years agoFixed Array.prototype.pop() and shift() for sparse objects.
Alexander Borisov [Wed, 9 Oct 2019 15:54:57 +0000 (18:54 +0300)]
Fixed Array.prototype.pop() and shift() for sparse objects.

This closes #233 issue on GitHub.

6 years agoFixed Array functions according to specification.
Alexander Borisov [Wed, 9 Oct 2019 15:54:54 +0000 (18:54 +0300)]
Fixed Array functions according to specification.

Length property should be queried before checking arguments for validity.

Аffected functions:
every, filter, find, findIndex, forEach, map, reduce, reduceRight, some.

This closes #228 issue on GitHub.

6 years agoFixing Coverity warnings related to close() (CID 1444170).
Dmitry Volyntsev [Tue, 8 Oct 2019 12:56:58 +0000 (15:56 +0300)]
Fixing Coverity warnings related to close() (CID 1444170).

6 years agoFixed Array.prototype.map() for a object with nonexistent values.
Alexander Borisov [Mon, 30 Sep 2019 08:41:00 +0000 (11:41 +0300)]
Fixed Array.prototype.map() for a object with nonexistent values.

Previously nonexistent values in the object were skipped and not added
to the result.

6 years agoAdded Number.prototype.toExponential().
Dmitry Volyntsev [Mon, 7 Oct 2019 15:16:47 +0000 (18:16 +0300)]
Added Number.prototype.toExponential().

6 years agoAligning prototypes of njs_grisu2() and njs_grisu2_prec().
Dmitry Volyntsev [Mon, 7 Oct 2019 15:11:19 +0000 (18:11 +0300)]
Aligning prototypes of njs_grisu2() and njs_grisu2_prec().

6 years agoIncreased maximum allowed recursion depth in parser and generator.
Dmitry Volyntsev [Fri, 4 Oct 2019 16:46:35 +0000 (19:46 +0300)]
Increased maximum allowed recursion depth in parser and generator.

6 years agoStyle.
Dmitry Volyntsev [Fri, 4 Oct 2019 16:46:12 +0000 (19:46 +0300)]
Style.

Fixed typo in njs_arr_t structure.

This closes #226 issue on Github.

6 years agoFixed Regexp.prototype.test() for regexps with backreferences.
Dmitry Volyntsev [Fri, 4 Oct 2019 14:19:06 +0000 (17:19 +0300)]
Fixed Regexp.prototype.test() for regexps with backreferences.

This closes #225 issue on Github.

6 years agoAdded Number.prototype.toPrecision().
Dmitry Volyntsev [Thu, 3 Oct 2019 13:59:22 +0000 (16:59 +0300)]
Added Number.prototype.toPrecision().

This closes #221 issue on Github.

6 years agoImproved naming in njs_dtoa() internal functions.
Dmitry Volyntsev [Thu, 3 Oct 2019 13:26:04 +0000 (16:26 +0300)]
Improved naming in njs_dtoa() internal functions.

6 years agoFixed buffer overflow in Number.prototype.toString(radix).
Alexander Borisov [Thu, 3 Oct 2019 12:41:30 +0000 (15:41 +0300)]
Fixed buffer overflow in Number.prototype.toString(radix).

6 years agoDate.prototype.toUTCString() format was aligned to ES9.
Valentin Bartenev [Fri, 27 Sep 2019 19:21:55 +0000 (22:21 +0300)]
Date.prototype.toUTCString() format was aligned to ES9.

This closes #224 issue on GitHub.

6 years agoImproved iteration over objects indexes in Array functions.
Alexander Borisov [Thu, 19 Sep 2019 07:19:02 +0000 (10:19 +0300)]
Improved iteration over objects indexes in Array functions.

For example, unshift function for object with large length:
var arrayLike = {};
arrayLike.length = 2 ** 53 - 1;
Array.prototype.unshift.call(arrayLike);

6 years agoFixed Array prototype functions according to the specification.
Alexander Borisov [Thu, 19 Sep 2019 07:19:02 +0000 (10:19 +0300)]
Fixed Array prototype functions according to the specification.

The following fuctions were fixed:
pop, push, shift, unshift.

6 years agoAdded njs_value_property_delete().
Alexander Borisov [Thu, 19 Sep 2019 07:19:01 +0000 (10:19 +0300)]
Added njs_value_property_delete().

6 years agoFixed Array prototype functions according to the specification.
Alexander Borisov [Thu, 19 Sep 2019 07:19:00 +0000 (10:19 +0300)]
Fixed Array prototype functions according to the specification.

The following fuctions were fixed:
includes, indexOf, lastIndexOf, reduceRight.

6 years agoFixed stack-use-after-scope in Array.prototype.map().
Alexander Borisov [Tue, 17 Sep 2019 08:29:10 +0000 (11:29 +0300)]
Fixed stack-use-after-scope in Array.prototype.map().

In the njs_array_iterator() an args.value is replaced to value on stack
for non-object strings.

6 years agoFixed njs_value_index().
Alexander Borisov [Tue, 17 Sep 2019 06:20:24 +0000 (09:20 +0300)]
Fixed njs_value_index().

Previous, there were several issues with njs_values_hash_test().
1) The function assumed string types of left and right values are identical.
   (If current value is a long string it assumed the second value is also
   a long string). Long vs short strings collision.
2) The function assumed if hashes are identical value length are equal.
   Long vs long string collision.

The fix is to always check value sizes.

In addition, for short strings njs_value_index() calculated hash value including
padding bytes (which values are undefined). It could result in identical
short strings (but with different padding bytes) treated as different strings.

6 years agoFixed String.prototype.replace() when first argument is not a string.
Alexander Borisov [Mon, 16 Sep 2019 14:21:36 +0000 (17:21 +0300)]
Fixed String.prototype.replace() when first argument is not a string.

This closes #208 issue on GitHub.

6 years agoFixed handing of accessor descriptors in Object.freeze().
Alexander Borisov [Wed, 11 Sep 2019 16:46:30 +0000 (19:46 +0300)]
Fixed handing of accessor descriptors in Object.freeze().

This closes #211 issue on GitHub.

6 years agoStyle.
Dmitry Volyntsev [Fri, 6 Sep 2019 12:47:12 +0000 (15:47 +0300)]
Style.

6 years agoAdded Number.prototype.toFixed().
Dmitry Volyntsev [Tue, 3 Sep 2019 14:31:45 +0000 (17:31 +0300)]
Added Number.prototype.toFixed().

This closes #29 issue on Github.

6 years agoAdded new Function() support.
hongzhidao [Fri, 23 Aug 2019 17:25:50 +0000 (13:25 -0400)]
Added new Function() support.

6 years agoPostponing copying of not-configurable PROPERTY_HANDLER properties.
Dmitry Volyntsev [Thu, 29 Aug 2019 16:18:53 +0000 (19:18 +0300)]
Postponing copying of not-configurable PROPERTY_HANDLER properties.

Since df385232d2af a shared property is copied to object hash on the
first access. It simplified changing of configurable shared properties.

Since 50fded8ccee5 Array.prototype functions treat empty array hash as a
sign that array instance is simple (without property getters and
non-numerical properties) to iterate over array values optimally.

Accessing "length" property made a copy in array hash. As a result next
iterations over array became not optimized.

The fix is to postpone making a mutable copy of not-configurable
NJS_PROPERTY_HANDLER properties until they are really required to change.

This closes #220 issue on Github.

6 years agoFixed incompatible pointer type introduced in 95d04dfea85c.
Alexander Borisov [Thu, 29 Aug 2019 14:11:41 +0000 (17:11 +0300)]
Fixed incompatible pointer type introduced in 95d04dfea85c.

6 years agoFixed Function.prototype.apply() according to the specification.
Alexander Borisov [Thu, 29 Aug 2019 13:39:10 +0000 (16:39 +0300)]
Fixed Function.prototype.apply() according to the specification.

6 years agoFixed undefined behaviour in left shift of int value.
Dmitry Volyntsev [Thu, 29 Aug 2019 12:12:45 +0000 (15:12 +0300)]
Fixed undefined behaviour in left shift of int value.

6 years agoImproved test coverage with MemorySanitizer enabled.
Dmitry Volyntsev [Thu, 29 Aug 2019 12:12:45 +0000 (15:12 +0300)]
Improved test coverage with MemorySanitizer enabled.

6 years agoFixed null pointer passing for args declared to never be null.
Dmitry Volyntsev [Thu, 29 Aug 2019 12:12:44 +0000 (15:12 +0300)]
Fixed null pointer passing for args declared to never be null.

Found by UndefinedBehaviorSanitizer.

6 years agoFixed typo introduced in 50fded8ccee5.
Alexander Borisov [Thu, 29 Aug 2019 10:12:33 +0000 (13:12 +0300)]
Fixed typo introduced in 50fded8ccee5.

6 years agoFixed Array prototype functions according to the specification.
Alexander Borisov [Wed, 28 Aug 2019 11:59:28 +0000 (14:59 +0300)]
Fixed Array prototype functions according to the specification.

The following fuctions were fixed:
every,  filter, find, findIndex, forEach, map, reduce, some.

6 years agoFixed parseFloat().
Dmitry Volyntsev [Wed, 28 Aug 2019 16:10:01 +0000 (19:10 +0300)]
Fixed parseFloat().

6 years agoFixed integer-overflow while parsing exponent of number literals.
Dmitry Volyntsev [Tue, 27 Aug 2019 15:58:43 +0000 (18:58 +0300)]
Fixed integer-overflow while parsing exponent of number literals.

6 years agoLimiting recursion depth while compiling unary expressions.
Dmitry Volyntsev [Tue, 27 Aug 2019 13:31:00 +0000 (16:31 +0300)]
Limiting recursion depth while compiling unary expressions.

This extends 8057f3ad56c1 and is related to #146 issue on Github.

6 years agoFixed heap-buffer-overflow while parsing regexp literals.
Dmitry Volyntsev [Mon, 26 Aug 2019 16:00:13 +0000 (19:00 +0300)]
Fixed heap-buffer-overflow while parsing regexp literals.

This closes #174 issue on Github.

6 years agoIncreased max function nesting.
Dmitry Volyntsev [Fri, 23 Aug 2019 17:00:40 +0000 (20:00 +0300)]
Increased max function nesting.

6 years agoLimiting recursion depth while compiling.
Dmitry Volyntsev [Fri, 23 Aug 2019 12:13:45 +0000 (15:13 +0300)]
Limiting recursion depth while compiling.

This closes #146 issue on Github.

6 years agoMaking "prototype" property of function instances writable.
Dmitry Volyntsev [Thu, 22 Aug 2019 15:27:34 +0000 (18:27 +0300)]
Making "prototype" property of function instances writable.

This closes #40 issue on Github.

6 years agoIntroduced njs_variables_copy().
hongzhidao [Wed, 21 Aug 2019 03:03:26 +0000 (23:03 -0400)]
Introduced njs_variables_copy().

6 years agoFixed division token in lexer.
hongzhidao [Wed, 21 Aug 2019 02:59:38 +0000 (22:59 -0400)]
Fixed division token in lexer.

6 years agoFixed prototype mutation for object literals.
Dmitry Volyntsev [Tue, 20 Aug 2019 17:51:39 +0000 (20:51 +0300)]
Fixed prototype mutation for object literals.

6 years agoUsing "printf" instead of "echo -n" for portability.
Dmitry Volyntsev [Tue, 20 Aug 2019 17:51:39 +0000 (20:51 +0300)]
Using "printf" instead of "echo -n" for portability.

This closes #205 issue on Github.

6 years agoVersion bump.
Dmitry Volyntsev [Tue, 20 Aug 2019 17:51:33 +0000 (20:51 +0300)]
Version bump.

6 years agoAdded tag 0.3.5 for changeset b7fa83f27f1b
Dmitry Volyntsev [Thu, 15 Aug 2019 16:36:57 +0000 (19:36 +0300)]
Added tag 0.3.5 for changeset b7fa83f27f1b

6 years agoVersion 0.3.5. 0.3.5
Dmitry Volyntsev [Thu, 15 Aug 2019 16:36:39 +0000 (19:36 +0300)]
Version 0.3.5.

6 years agoFixed module importing using require().
Dmitry Volyntsev [Thu, 15 Aug 2019 16:22:01 +0000 (19:22 +0300)]
Fixed module importing using require().

Previously, require() did not make a mutable copy of imported module.
As a result, cloned VMs could change a shared module object making
module.object->hash inconsistent.

Before 04d7a5d93ae6, the problem manifested itself only in "PROP GET"
operations, for example, using "require('fs').renameSync", because
njs_value_property() makes a mutable copy of shared methods in
module.object->hash.

After 04d7a5d93ae6, "METHOD CALL" operations, such as
"require('fs').renameSync()", now have the same problem as in "PROP
GET".

Importing modules using "import" statement is not affected, because
for it "OBJECT COPY" instruction is generated, which makes a mutable
copy of imported module object.

The fix is to make a mutable copy of a shared module in require().

This closes #206 issue on Github.

6 years agoFixed handling of NJS_DECLINED returned by NJS_PROPERTY_HANDLER.
Dmitry Volyntsev [Wed, 14 Aug 2019 17:22:32 +0000 (20:22 +0300)]
Fixed handling of NJS_DECLINED returned by NJS_PROPERTY_HANDLER.

6 years agoFixed [[SetPrototypeOf]].
Dmitry Volyntsev [Wed, 14 Aug 2019 17:22:26 +0000 (20:22 +0300)]
Fixed [[SetPrototypeOf]].

6 years agoVersion bump.
Dmitry Volyntsev [Wed, 14 Aug 2019 17:22:20 +0000 (20:22 +0300)]
Version bump.