]> git.kaiwu.me - njs.git/log
njs.git
9 years agoMore Math methods from ES6.
Valentin Bartenev [Fri, 18 Nov 2016 14:25:25 +0000 (17:25 +0300)]
More Math methods from ES6.

9 years agoA workround for Solaris bugs in acos() and asin().
Igor Sysoev [Wed, 16 Nov 2016 12:21:07 +0000 (15:21 +0300)]
A workround for Solaris bugs in acos() and asin().

9 years agoFixed unit tests on FreeBSD.
Igor Sysoev [Wed, 16 Nov 2016 12:21:03 +0000 (15:21 +0300)]
Fixed unit tests on FreeBSD.

9 years agoRemoved checking for range errors in Math.hypot().
Valentin Bartenev [Wed, 16 Nov 2016 09:49:53 +0000 (12:49 +0300)]
Removed checking for range errors in Math.hypot().

It seems other interpreters do not return an exception in this case.

9 years agoRefactored Math methods.
Valentin Bartenev [Wed, 16 Nov 2016 09:49:53 +0000 (12:49 +0300)]
Refactored Math methods.

9 years agoUnit tests for all Math methods.
Valentin Bartenev [Wed, 16 Nov 2016 09:49:52 +0000 (12:49 +0300)]
Unit tests for all Math methods.

9 years agoAdded tag 0.1.5 for changeset 9c813c2bb2ac
Igor Sysoev [Tue, 15 Nov 2016 15:28:35 +0000 (18:28 +0300)]
Added tag 0.1.5 for changeset 9c813c2bb2ac

9 years agoVersion 0.1.5. 0.1.5
Igor Sysoev [Tue, 15 Nov 2016 15:28:18 +0000 (18:28 +0300)]
Version 0.1.5.

9 years agoNative methods and non-constructor functions must throw
Igor Sysoev [Tue, 15 Nov 2016 14:43:05 +0000 (17:43 +0300)]
Native methods and non-constructor functions must throw
TypeError exception if they are called as constructor.

9 years agoRemoved irrelevant overhead in clone/destroy benchmark.
Igor Sysoev [Fri, 11 Nov 2016 15:12:13 +0000 (18:12 +0300)]
Removed irrelevant overhead in clone/destroy benchmark.

9 years agoNow the empty regexp pattern is created on compile stage only.
Igor Sysoev [Fri, 11 Nov 2016 14:28:47 +0000 (17:28 +0300)]
Now the empty regexp pattern is created on compile stage only.

This speeds up njs_vm_clone() operation twice.

9 years agoMoved njs_string_offset_map_init() closer to its usage.
Valentin Bartenev [Thu, 10 Nov 2016 16:09:13 +0000 (19:09 +0300)]
Moved njs_string_offset_map_init() closer to its usage.

No functional changes.

9 years agoOn-demand initialization of UTF-8 strings offset map.
Valentin Bartenev [Thu, 10 Nov 2016 15:54:28 +0000 (18:54 +0300)]
On-demand initialization of UTF-8 strings offset map.

9 years agoImproved UTF-8 offset map related macros (no functional changes).
Valentin Bartenev [Thu, 10 Nov 2016 15:45:10 +0000 (18:45 +0300)]
Improved UTF-8 offset map related macros (no functional changes).

9 years agoRemoved misused __attribute__((malloc)).
Valentin Bartenev [Thu, 10 Nov 2016 13:47:52 +0000 (16:47 +0300)]
Removed misused __attribute__((malloc)).

According to the documentation:

| This tells the compiler that a function is malloc-like, i.e., that the
| pointer P returned by the function cannot alias any other pointer valid
| when the function returns, and moreover no pointers to valid objects
| occur in any storage addressed by P.

The njs_string_alloc() allocates a storage for a string and makes the
storage accessible via the passed "value" argument.  The function also
returns an intermediate pointer which is used only for string content
initialization and then discarded.  Since the pointer is not stored
anywhere after the initialization, GCC with -O or higher optimisation
levels rightfully optimizes out the initialization.

9 years agoFixed building on Solaris after d8b1e2576409.
Valentin Bartenev [Thu, 10 Nov 2016 13:19:13 +0000 (16:19 +0300)]
Fixed building on Solaris after d8b1e2576409.

9 years agoFixed building with GCC ASan.
Valentin Bartenev [Thu, 10 Nov 2016 12:33:02 +0000 (15:33 +0300)]
Fixed building with GCC ASan.

9 years agoStyle and small miscellaneous fixes.
Igor Sysoev [Wed, 9 Nov 2016 12:04:40 +0000 (15:04 +0300)]
Style and small miscellaneous fixes.

9 years agoString.indexOf() and String.includes() simplification.
Valentin Bartenev [Wed, 9 Nov 2016 11:34:32 +0000 (14:34 +0300)]
String.indexOf() and String.includes() simplification.

9 years agoMath.hypot() method.
Valentin Bartenev [Tue, 8 Nov 2016 19:09:40 +0000 (22:09 +0300)]
Math.hypot() method.

9 years agoString.startsWith() and String.endsWith() methods.
Valentin Bartenev [Wed, 9 Nov 2016 09:37:59 +0000 (12:37 +0300)]
String.startsWith() and String.endsWith() methods.

9 years agoVarious Number methods.
Valentin Bartenev [Sun, 6 Nov 2016 13:03:29 +0000 (16:03 +0300)]
Various Number methods.

9 years agoVarious Number constants.
Valentin Bartenev [Sun, 6 Nov 2016 13:03:03 +0000 (16:03 +0300)]
Various Number constants.

9 years agoFunction expressions did not have prototypes.
Igor Sysoev [Fri, 4 Nov 2016 20:45:35 +0000 (23:45 +0300)]
Function expressions did not have prototypes.

9 years agoRemoved redefinition of isinf() and isnan().
Valentin Bartenev [Fri, 4 Nov 2016 15:25:55 +0000 (18:25 +0300)]
Removed redefinition of isinf() and isnan().

9 years agoRemoved redefinition of NAN and INFINITY macros.
Valentin Bartenev [Fri, 4 Nov 2016 15:25:55 +0000 (18:25 +0300)]
Removed redefinition of NAN and INFINITY macros.

9 years agoMore precise Math constants.
Valentin Bartenev [Fri, 4 Nov 2016 15:25:55 +0000 (18:25 +0300)]
More precise Math constants.

9 years agoString.prototype.repeat() did not check the count parameter
Igor Sysoev [Fri, 4 Nov 2016 13:22:56 +0000 (16:22 +0300)]
String.prototype.repeat() did not check the count parameter
for single character strings.  The count parameter should be
checked also for empty string.

In collaboration with Andrey Zelenkov and Valentin Bartenev.

9 years agoString.prototype.repeat method fix.
Andrey Zelenkov [Thu, 3 Nov 2016 15:12:10 +0000 (18:12 +0300)]
String.prototype.repeat method fix.

Found with afl-fuzz.

9 years agoMath.sign() method.
Valentin Bartenev [Mon, 31 Oct 2016 13:28:12 +0000 (16:28 +0300)]
Math.sign() method.

9 years agoMath.trunc() method.
Valentin Bartenev [Mon, 31 Oct 2016 13:25:54 +0000 (16:25 +0300)]
Math.trunc() method.

9 years agoA surplus check has been removed.
Igor Sysoev [Mon, 31 Oct 2016 12:56:49 +0000 (15:56 +0300)]
A surplus check has been removed.

Found by Coverity Scan.

9 years agoA possible memory leak has been fixed.
Igor Sysoev [Mon, 31 Oct 2016 12:51:12 +0000 (15:51 +0300)]
A possible memory leak has been fixed.

Thanks to 洪志道 (Hong Zhi Dao).

9 years agoFixed building on modern Linux kernels.
Igor Sysoev [Fri, 28 Oct 2016 21:04:29 +0000 (00:04 +0300)]
Fixed building on modern Linux kernels.

9 years agoAdded missing <nxt_auto_config.h> includes.
Piotr Sikora [Fri, 28 Oct 2016 16:29:38 +0000 (19:29 +0300)]
Added missing <nxt_auto_config.h> includes.

Previously, most objects were compiled without any
features detected by the ./configure script.

Signed-off-by: Piotr Sikora <piotrsikora@google.com>
9 years agoString.prototype.repeat() method.
Valentin Bartenev [Fri, 28 Oct 2016 11:20:23 +0000 (14:20 +0300)]
String.prototype.repeat() method.

9 years agoString.prototype.trim() method.
Igor Sysoev [Fri, 28 Oct 2016 10:32:33 +0000 (13:32 +0300)]
String.prototype.trim() method.

In collaboration with Valentin Bartenev.

9 years agoString.prototype.lastIndexOf() method fix.
Igor Sysoev [Thu, 27 Oct 2016 13:38:05 +0000 (16:38 +0300)]
String.prototype.lastIndexOf() method fix.

In collaboration with Valentin Bartenev.

9 years agoString.prototypes.includes() method.
Igor Sysoev [Thu, 27 Oct 2016 08:14:46 +0000 (11:14 +0300)]
String.prototypes.includes() method.

9 years agoString.prototype.lastIndexOf() method fixes and optimizations.
Igor Sysoev [Thu, 27 Oct 2016 07:56:54 +0000 (10:56 +0300)]
String.prototype.lastIndexOf() method fixes and optimizations.

In collaboration with Valentin Bartenev.

9 years agoString.prototype.indexOf() method fixes.
Igor Sysoev [Thu, 27 Oct 2016 07:47:48 +0000 (10:47 +0300)]
String.prototype.indexOf() method fixes.

9 years agoArray.prototypes.includes() method.
Igor Sysoev [Tue, 25 Oct 2016 14:52:18 +0000 (17:52 +0300)]
Array.prototypes.includes() method.

9 years agoArray.prototype.lastIndexOf() and Array.prototype.indexOf() fixes.
Andrey Zelenkov [Mon, 24 Oct 2016 16:02:31 +0000 (19:02 +0300)]
Array.prototype.lastIndexOf() and Array.prototype.indexOf() fixes.

The fromIndex parameter processing in lastIndexOf() has been fixed.
The lastIndexOf() search algorithm has been optimized.
The njs_array_index_of() function has been removed.

In collaboration with Valentin Bartenev.

9 years agoIncomplete non-recursive parser has been removed.
Igor Sysoev [Mon, 24 Oct 2016 15:27:31 +0000 (18:27 +0300)]
Incomplete non-recursive parser has been removed.

9 years agoStyle unification of configure feature tests.
Igor Sysoev [Mon, 24 Oct 2016 14:29:27 +0000 (17:29 +0300)]
Style unification of configure feature tests.

9 years agoA build with -Werror=return-type has been fixed.
Igor Sysoev [Mon, 24 Oct 2016 14:23:00 +0000 (17:23 +0300)]
A build with -Werror=return-type has been fixed.

Patch by Piotr Sikora.

9 years agoA build with -Werror=old-style-definition has been fixed.
Igor Sysoev [Mon, 24 Oct 2016 14:16:10 +0000 (17:16 +0300)]
A build with -Werror=old-style-definition has been fixed.

Patch by Piotr Sikora.

9 years agoAdded tag 0.1.4 for changeset 508689c1fb94
Igor Sysoev [Mon, 24 Oct 2016 12:04:57 +0000 (15:04 +0300)]
Added tag 0.1.4 for changeset 508689c1fb94

9 years agoVersion 0.1.4. 0.1.4
Igor Sysoev [Mon, 24 Oct 2016 12:04:50 +0000 (15:04 +0300)]
Version 0.1.4.

9 years agonjs_array_realloc() has been changed to njs_array_expand().
Igor Sysoev [Mon, 24 Oct 2016 11:56:28 +0000 (14:56 +0300)]
njs_array_realloc() has been changed to njs_array_expand().

9 years agoArray creation and reallocation optimizations.
Igor Sysoev [Mon, 24 Oct 2016 11:12:12 +0000 (14:12 +0300)]
Array creation and reallocation optimizations.

9 years agoA fix in decodeURI() and decodeURIComponent() functions.
Igor Sysoev [Sat, 22 Oct 2016 17:24:32 +0000 (20:24 +0300)]
A fix in decodeURI() and decodeURIComponent() functions.

Found with afl-fuzz.

9 years agoA fix in Array.prototype.splice() function.
Igor Sysoev [Fri, 21 Oct 2016 20:03:02 +0000 (23:03 +0300)]
A fix in Array.prototype.splice() function.

Found with afl-fuzz.

9 years agoA fix in typeof function.
Andrey Zelenkov [Thu, 20 Oct 2016 14:12:42 +0000 (17:12 +0300)]
A fix in typeof function.

Found with afl-fuzz.

9 years agoArray.indexOf() and Array.lastIndexOf() have been fixed.
Igor Sysoev [Tue, 18 Oct 2016 14:44:01 +0000 (17:44 +0300)]
Array.indexOf() and Array.lastIndexOf() have been fixed.

9 years agoInvalid Unicode code point processing has been fixed.
Igor Sysoev [Tue, 18 Oct 2016 12:48:22 +0000 (15:48 +0300)]
Invalid Unicode code point processing has been fixed.

9 years agoA fix of function name usage.
Igor Sysoev [Tue, 18 Oct 2016 12:48:19 +0000 (15:48 +0300)]
A fix of function name usage.

9 years agoFixes in generating "continue" and "break" statements.
Igor Sysoev [Tue, 18 Oct 2016 12:48:13 +0000 (15:48 +0300)]
Fixes in generating "continue" and "break" statements.

9 years agoRelative addresses have been added to disassembler output.
Igor Sysoev [Mon, 17 Oct 2016 20:29:15 +0000 (23:29 +0300)]
Relative addresses have been added to disassembler output.

9 years agoStyle fixes.
Igor Sysoev [Mon, 17 Oct 2016 14:03:22 +0000 (17:03 +0300)]
Style fixes.

9 years agoFixes in various String methods which return part of string.
Igor Sysoev [Mon, 17 Oct 2016 13:42:31 +0000 (16:42 +0300)]
Fixes in various String methods which return part of string.

9 years agoObject argument in some Date methods was not checked.
Igor Sysoev [Fri, 14 Oct 2016 15:21:37 +0000 (18:21 +0300)]
Object argument in some Date methods was not checked.

9 years agoA fix of var declaration.
Igor Sysoev [Fri, 14 Oct 2016 15:12:36 +0000 (18:12 +0300)]
A fix of var declaration.

9 years agoA fix in Array.splice() function.
Igor Sysoev [Fri, 14 Oct 2016 14:21:35 +0000 (17:21 +0300)]
A fix in Array.splice() function.

9 years agoA fix in Array.slice() function.
Igor Sysoev [Wed, 12 Oct 2016 16:08:57 +0000 (19:08 +0300)]
A fix in Array.slice() function.

9 years agoConstructor function prototypes should be real functions.
Igor Sysoev [Tue, 11 Oct 2016 17:09:18 +0000 (20:09 +0300)]
Constructor function prototypes should be real functions.

9 years agoAccessing the global this object caused segfault.
Igor Sysoev [Tue, 11 Oct 2016 14:44:05 +0000 (17:44 +0300)]
Accessing the global this object caused segfault.

9 years agoSegfaults in the delete operator have been fixed.
Igor Sysoev [Tue, 11 Oct 2016 14:44:01 +0000 (17:44 +0300)]
Segfaults in the delete operator have been fixed.

9 years agoSegfaults in increment and decrement operators have been fixed.
Igor Sysoev [Tue, 11 Oct 2016 14:04:28 +0000 (17:04 +0300)]
Segfaults in increment and decrement operators have been fixed.

9 years agoSegfaults in Date have been fixed.
Igor Sysoev [Tue, 11 Oct 2016 10:01:41 +0000 (13:01 +0300)]
Segfaults in Date have been fixed.

9 years agoAdded tag 0.1.3 for changeset 360449773d51
Igor Sysoev [Mon, 10 Oct 2016 14:22:26 +0000 (17:22 +0300)]
Added tag 0.1.3 for changeset 360449773d51

9 years agoVersion 0.1.3. 0.1.3
Igor Sysoev [Mon, 10 Oct 2016 14:21:53 +0000 (17:21 +0300)]
Version 0.1.3.

9 years agoNow njs_vm_compile() returns all global functions via the export
Igor Sysoev [Mon, 10 Oct 2016 13:33:56 +0000 (16:33 +0300)]
Now njs_vm_compile() returns all global functions via the export
array.

9 years agoNow setting property of primitive type returns TypeError exception.
Igor Sysoev [Mon, 10 Oct 2016 10:08:40 +0000 (13:08 +0300)]
Now setting property of primitive type returns TypeError exception.

9 years agoA dead code found by Coverity Scan has been removed.
Igor Sysoev [Tue, 4 Oct 2016 08:28:29 +0000 (11:28 +0300)]
A dead code found by Coverity Scan has been removed.

9 years agoInclusive "new" operators and "new" operator calls without
Igor Sysoev [Fri, 30 Sep 2016 19:07:07 +0000 (22:07 +0300)]
Inclusive "new" operators and "new" operator calls without
parenthesis are supported.

9 years agoA "var" statement termination has been fixed.
Igor Sysoev [Fri, 30 Sep 2016 11:11:27 +0000 (14:11 +0300)]
A "var" statement termination has been fixed.

9 years agoStream js: js_access, js_preread, js_filter.
Roman Arutyunyan [Wed, 28 Sep 2016 16:52:05 +0000 (19:52 +0300)]
Stream js: js_access, js_preread, js_filter.

9 years agoA function stored in array could not be called.
Igor Sysoev [Mon, 26 Sep 2016 15:41:57 +0000 (18:41 +0300)]
A function stored in array could not be called.

9 years agoString processing unification using njs_string_length(),
Igor Sysoev [Mon, 26 Sep 2016 11:01:45 +0000 (14:01 +0300)]
String processing unification using njs_string_length(),
njs_utf8_t, and njs_regexp_utf8_t.

9 years agoThe cause of linker hanging on Linux/PPC64 has been
Igor Sysoev [Mon, 26 Sep 2016 11:01:39 +0000 (14:01 +0300)]
The cause of linker hanging on Linux/PPC64 has been
finally tracked down and thus only the aligment attribute
has been correctly disabled on this platform.

9 years agoA fix of possible sign extension overflow,
Igor Sysoev [Sun, 25 Sep 2016 07:54:51 +0000 (10:54 +0300)]
A fix of possible sign extension overflow,
the issue has been found by Coverity Scan.

9 years agoAll C feature attributes have been disabled for Linux/PPC64.
Igor Sysoev [Sat, 24 Sep 2016 19:13:31 +0000 (22:13 +0300)]
All C feature attributes have been disabled for Linux/PPC64.

9 years agoThe visibility attribute disabling in the commit af6c17324584
Igor Sysoev [Fri, 23 Sep 2016 08:59:58 +0000 (11:59 +0300)]
The visibility attribute disabling in the commit af6c17324584
had not resovled the issue.  So now it is enabled and the aligment
attribute has been disabled instead for Linux/PPC64.

9 years agoStyle and small miscellaneous fixes.
Igor Sysoev [Fri, 23 Sep 2016 08:59:56 +0000 (11:59 +0300)]
Style and small miscellaneous fixes.

9 years agoString.replace() function.
Igor Sysoev [Fri, 23 Sep 2016 08:59:48 +0000 (11:59 +0300)]
String.replace() function.

9 years agoReturning an intptr_t result by rbtree comparison function
Igor Sysoev [Thu, 15 Sep 2016 15:00:55 +0000 (18:00 +0300)]
Returning an intptr_t result by rbtree comparison function
decreases overhead required to implement correct addresses
comparison without result truncation.

9 years agoA fix of use-after-free memory bug.
Igor Sysoev [Thu, 15 Sep 2016 14:37:52 +0000 (17:37 +0300)]
A fix of use-after-free memory bug.

9 years agoFixed compilation of nginx njs module without stream or http.
Roman Arutyunyan [Thu, 15 Sep 2016 14:34:34 +0000 (17:34 +0300)]
Fixed compilation of nginx njs module without stream or http.

Additionally, support for nginx versions without dynamic modules is now dropped.

9 years agoStyle: express requirement to use PCRE via $ngx_module_libs.
Ruslan Ermilov [Thu, 15 Sep 2016 07:52:01 +0000 (10:52 +0300)]
Style: express requirement to use PCRE via $ngx_module_libs.

9 years agoAdded tag 0.1.2 for changeset 5b066b4db54c
Igor Sysoev [Tue, 13 Sep 2016 13:59:27 +0000 (16:59 +0300)]
Added tag 0.1.2 for changeset 5b066b4db54c

9 years agoVersion 0.1.2. 0.1.2
Igor Sysoev [Tue, 13 Sep 2016 13:59:09 +0000 (16:59 +0300)]
Version 0.1.2.

9 years agoFixed building by GCC 4.
Igor Sysoev [Tue, 13 Sep 2016 13:53:24 +0000 (16:53 +0300)]
Fixed building by GCC 4.

9 years agoConstructor function prototypes now have correct types and values.
Igor Sysoev [Tue, 13 Sep 2016 13:19:26 +0000 (16:19 +0300)]
Constructor function prototypes now have correct types and values.

9 years agoNow Date.parse() and Date() accept shortcut date strings.
Igor Sysoev [Thu, 1 Sep 2016 13:12:31 +0000 (16:12 +0300)]
Now Date.parse() and Date() accept shortcut date strings.

9 years agoAttribute visibility detection has been disabled.
Sergey Kandaurov [Thu, 1 Sep 2016 10:28:44 +0000 (13:28 +0300)]
Attribute visibility detection has been disabled.

Old GNU ld linker hangs on Linux ppc64le platform.

9 years agoA fix in decodeURI() and decodeURIComponent() functions.
Igor Sysoev [Wed, 31 Aug 2016 16:28:08 +0000 (19:28 +0300)]
A fix in decodeURI() and decodeURIComponent() functions.

9 years agoA fix in decodeURI() function.
Igor Sysoev [Wed, 31 Aug 2016 16:18:47 +0000 (19:18 +0300)]
A fix in decodeURI() function.

9 years agoA fix in decodeURI() and decodeURIComponent() functions.
Igor Sysoev [Wed, 31 Aug 2016 14:51:54 +0000 (17:51 +0300)]
A fix in decodeURI() and decodeURIComponent() functions.

9 years agoAn invalid value of Date object has been fixed.
Igor Sysoev [Wed, 31 Aug 2016 12:53:13 +0000 (15:53 +0300)]
An invalid value of Date object has been fixed.