]> git.kaiwu.me - njs.git/log
njs.git
7 years agoFixed Date() constructor with one argument.
Dmitry Volyntsev [Thu, 25 Apr 2019 16:50:20 +0000 (19:50 +0300)]
Fixed Date() constructor with one argument.

This closes #144 issue on Github.

7 years agoImproved text for method frame exception.
Dmitry Volyntsev [Thu, 25 Apr 2019 16:33:35 +0000 (19:33 +0300)]
Improved text for method frame exception.

7 years agoFixed njs_vmcode_restart().
hongzhidao [Thu, 25 Apr 2019 12:56:44 +0000 (15:56 +0300)]
Fixed njs_vmcode_restart().

7 years agoDisabling njs_retain() and njs_release().
Dmitry Volyntsev [Thu, 25 Apr 2019 12:50:03 +0000 (15:50 +0300)]
Disabling njs_retain() and njs_release().

Until there is a working GC.

7 years agoFixed special getters for objects created using Object.create().
Dmitry Volyntsev [Thu, 25 Apr 2019 12:19:37 +0000 (15:19 +0300)]
Fixed special getters for objects created using Object.create().

This closes #124 issue on Github.

7 years agoFixed string object creation using Object() constructor.
Dmitry Volyntsev [Thu, 25 Apr 2019 12:19:36 +0000 (15:19 +0300)]
Fixed string object creation using Object() constructor.

7 years agoImproved String.prototype.match() function.
Alexander Borisov [Wed, 24 Apr 2019 16:04:23 +0000 (19:04 +0300)]
Improved String.prototype.match() function.

7 years agoAdded processing asterisk quantifier for String.prototype.match().
Alexander Borisov [Wed, 24 Apr 2019 16:04:22 +0000 (19:04 +0300)]
Added processing asterisk quantifier for String.prototype.match().

The lack of processing asterisk quantification in regexp led to infinity
loop in String.prototype.match() function.

7 years agoAdded macro for converting surrogate pair to code point.
Alexander Borisov [Tue, 23 Apr 2019 15:10:37 +0000 (18:10 +0300)]
Added macro for converting surrogate pair to code point.

7 years agoFixed parsing surrogate pair presents as UTF-16 escape sequences.
Alexander Borisov [Mon, 22 Apr 2019 13:23:50 +0000 (16:23 +0300)]
Fixed parsing surrogate pair presents as UTF-16 escape sequences.

This closes #96 issue on GitHub.

7 years agoFixed length calculation for UTF-8 string with escape characters.
Alexander Borisov [Mon, 22 Apr 2019 13:23:43 +0000 (16:23 +0300)]
Fixed length calculation for UTF-8 string with escape characters.

This closes #133 issue on GitHub.

7 years agoFixed condition on already been declared exception.
Dmitry Volyntsev [Tue, 23 Apr 2019 12:31:40 +0000 (15:31 +0300)]
Fixed condition on already been declared exception.

7 years agoAdded support for template literals.
hongzhidao [Mon, 22 Apr 2019 16:53:41 +0000 (19:53 +0300)]
Added support for template literals.

What is supported:
1) Multiline strings
`string text line 1
string text line 2`

2) Expression interpolation
`string text ${expression} string text`

3) Nested templates
4) Tagged templates

This closes #107 issue on Github.

In collaboration with Artem S. Povalyukhin.

7 years agoAdded block scoped function definitions support.
hongzhidao [Sun, 21 Apr 2019 10:11:58 +0000 (18:11 +0800)]
Added block scoped function definitions support.

This closes #134 issue on Github.

7 years agoImproved array allocation test for low memory machines.
Alexander Borisov [Mon, 22 Apr 2019 15:06:17 +0000 (18:06 +0300)]
Improved array allocation test for low memory machines.

7 years agoRestricted function declaration to top level or inside a block.
hongzhidao [Sun, 21 Apr 2019 09:36:25 +0000 (17:36 +0800)]
Restricted function declaration to top level or inside a block.

7 years agoAdded option to run unit tests in module mode.
hongzhidao [Sun, 21 Apr 2019 09:33:31 +0000 (17:33 +0800)]
Added option to run unit tests in module mode.

7 years agoFixed overflow in Array.prototype.concat().
Alexander Borisov [Fri, 19 Apr 2019 14:24:29 +0000 (17:24 +0300)]
Fixed overflow in Array.prototype.concat().

This closes #131 issue on GitHub.

7 years agoAdded uint32_t overflow check for njs_array_alloc() function.
Alexander Borisov [Fri, 19 Apr 2019 14:48:39 +0000 (17:48 +0300)]
Added uint32_t overflow check for njs_array_alloc() function.

7 years agoSimplified typeof operation.
hongzhidao [Fri, 19 Apr 2019 12:03:49 +0000 (20:03 +0800)]
Simplified typeof operation.

7 years agoStyle.
Dmitry Volyntsev [Thu, 18 Apr 2019 17:51:53 +0000 (20:51 +0300)]
Style.

7 years agoRefactored variable reference.
hongzhidao [Thu, 18 Apr 2019 16:28:31 +0000 (00:28 +0800)]
Refactored variable reference.

7 years agoTests: freeing pcre structs to silence leak-sanitizer.
Dmitry Volyntsev [Thu, 18 Apr 2019 16:17:22 +0000 (19:17 +0300)]
Tests: freeing pcre structs to silence leak-sanitizer.

7 years agoWalking over prototypes chain during iteration over an object.
Alexander Borisov [Wed, 17 Apr 2019 15:00:56 +0000 (18:00 +0300)]
Walking over prototypes chain during iteration over an object.

This closes #33 issue on Github.

7 years agoAdded two new function for working with enumerate value.
Alexander Borisov [Wed, 17 Apr 2019 14:27:14 +0000 (17:27 +0300)]
Added two new function for working with enumerate value.

New functions njs_value_enumerate() and njs_value_own_enumerate().
Changed function njs_object_enumerate() for working only with object.

7 years agoAdded function to get length of the string.
Alexander Borisov [Wed, 17 Apr 2019 14:13:39 +0000 (17:13 +0300)]
Added function to get length of the string.

Renamed function njs_string_length() to njs_string_eval_length().

7 years agoSaving hash key to result for each() function in level hash.
Alexander Borisov [Mon, 8 Apr 2019 16:01:56 +0000 (19:01 +0300)]
Saving hash key to result for each() function in level hash.

7 years agoFixed RegExp constructor for regexp value arguments.
Dmitry Volyntsev [Thu, 18 Apr 2019 15:14:56 +0000 (18:14 +0300)]
Fixed RegExp constructor for regexp value arguments.

This closes #59 issue on Github.

7 years agoImproved working with arguments in Regexp.prototype methods.
Dmitry Volyntsev [Thu, 18 Apr 2019 12:44:37 +0000 (15:44 +0300)]
Improved working with arguments in Regexp.prototype methods.

7 years agoShell: fixed njs_vm_value_dump() for empty string values.
Dmitry Volyntsev [Thu, 18 Apr 2019 12:05:27 +0000 (15:05 +0300)]
Shell: fixed njs_vm_value_dump() for empty string values.

This closes #139 issue on Github.

7 years agoFixed Regexp.prototype.exec() for unicode only regexps.
Dmitry Volyntsev [Wed, 17 Apr 2019 18:12:21 +0000 (21:12 +0300)]
Fixed Regexp.prototype.exec() for unicode only regexps.

This closes #138 issue on Github.

7 years agoFixed handling of unicode only regexp expressions.
Dmitry Volyntsev [Wed, 17 Apr 2019 15:43:13 +0000 (18:43 +0300)]
Fixed handling of unicode only regexp expressions.

This fixes #125 issue on Github.

7 years agoVersion bump.
Dmitry Volyntsev [Tue, 16 Apr 2019 15:34:57 +0000 (18:34 +0300)]
Version bump.

7 years agoFixed changelog 0.3.1 description.
Dmitry Volyntsev [Tue, 16 Apr 2019 15:34:18 +0000 (18:34 +0300)]
Fixed changelog 0.3.1 description.

7 years agoAdded tag 0.3.1 for changeset ebfbdb8d8fe2
Dmitry Volyntsev [Tue, 16 Apr 2019 14:30:56 +0000 (17:30 +0300)]
Added tag 0.3.1 for changeset ebfbdb8d8fe2

7 years agoVersion 0.3.1. 0.3.1
Dmitry Volyntsev [Tue, 16 Apr 2019 14:30:11 +0000 (17:30 +0300)]
Version 0.3.1.

7 years agoAdded implementation of functions: ToInt32, ToUint32, ToLength.
Alexander Borisov [Mon, 15 Apr 2019 14:23:02 +0000 (17:23 +0300)]
Added implementation of functions: ToInt32, ToUint32, ToLength.

According to ES6 type conversion: 7.1.5, 7.1.6, and 7.1.15.

7 years agoFixed ToInteger function in accordance with the specification.
Alexander Borisov [Mon, 15 Apr 2019 14:23:21 +0000 (17:23 +0300)]
Fixed ToInteger function in accordance with the specification.

According to ES6 type conversion 7.1.4.

7 years agoFixed function declaration with the same name as a variable.
hongzhidao [Sat, 13 Apr 2019 15:38:53 +0000 (23:38 +0800)]
Fixed function declaration with the same name as a variable.

This closes #126 issue on Github.

7 years agoMaking parser hoist more generic.
hongzhidao [Fri, 12 Apr 2019 17:11:49 +0000 (01:11 +0800)]
Making parser hoist more generic.

7 years agoRenaming node->label to node->name.
hongzhidao [Fri, 12 Apr 2019 17:07:34 +0000 (01:07 +0800)]
Renaming node->label to node->name.

To reuse it for function name without introducing newly field.

7 years agoAdded quiet option for vm to support bit-exact output in test262.
Dmitry Volyntsev [Fri, 12 Apr 2019 17:48:44 +0000 (20:48 +0300)]
Added quiet option for vm to support bit-exact output in test262.

7 years agoAdded arrow function support.
hongzhidao [Sun, 7 Apr 2019 06:26:13 +0000 (14:26 +0800)]
Added arrow function support.

This closes #106 issue on Github.

In collaboration with Artem S. Povalyukhin.

7 years agoThis object as a variable.
Dmitry Volyntsev [Wed, 10 Apr 2019 14:46:29 +0000 (17:46 +0300)]
This object as a variable.

Non-local this is introduced to support arrow functions.
this is non-local when reference scope != first non-arrow
function scope.

7 years agoAdded support for module mode of execution.
Dmitry Volyntsev [Wed, 10 Apr 2019 14:46:29 +0000 (17:46 +0300)]
Added support for module mode of execution.

According to ES6:15.2 global this is undefined in module
mode.

7 years agoFixed objects instance properties.
Dmitry Volyntsev [Fri, 12 Apr 2019 15:36:02 +0000 (18:36 +0300)]
Fixed objects instance properties.

Some properties like 'length' of Array, String or Function
objects should be instance properties not prototype properties.

7 years agoShell: improved njs_vm_value_dump().
Dmitry Volyntsev [Thu, 11 Apr 2019 18:24:16 +0000 (21:24 +0300)]
Shell: improved njs_vm_value_dump().

njs_vm_value_dump() is used in two modes:
1) printing value of the previous expression in the shell.
2) console.log().

The behavior is different. Strings are printed with quotes
in the first case, but without in the second. Also special
ASCII symbols should not be escaped in console.log().

7 years agoShell: added shebang support.
Dmitry Volyntsev [Thu, 11 Apr 2019 17:09:42 +0000 (20:09 +0300)]
Shell: added shebang support.

7 years agoAdded string functions wrappers.
Dmitry Volyntsev [Thu, 11 Apr 2019 17:09:41 +0000 (20:09 +0300)]
Added string functions wrappers.

nxt_strlen(), nxt_strchr(), nxt_strlchr().

7 years agoUNIT style indentation in njs_string.h.
Dmitry Volyntsev [Thu, 11 Apr 2019 17:09:41 +0000 (20:09 +0300)]
UNIT style indentation in njs_string.h.

7 years agoImproved console.log() for string values.
Dmitry Volyntsev [Thu, 11 Apr 2019 15:53:19 +0000 (18:53 +0300)]
Improved console.log() for string values.

Outputting string values without quotes.

7 years agoChecking for duplicate function parameter names.
hongzhidao [Thu, 11 Apr 2019 13:13:03 +0000 (21:13 +0800)]
Checking for duplicate function parameter names.

This closes #80 issue on Github.

7 years agoAllowing to output large values in console.log().
Dmitry Volyntsev [Thu, 11 Apr 2019 13:32:06 +0000 (16:32 +0300)]
Allowing to output large values in console.log().

Previously, the size was limited to 2048 bytes.

This closes #127 issue on Github.

7 years agoHTTP: documenting props removal in changelog.
Dmitry Volyntsev [Thu, 11 Apr 2019 12:00:17 +0000 (15:00 +0300)]
HTTP: documenting props removal in changelog.

res.contentLength and res.contentType were deprecated in
0.2.2 and removed in 0.2.8.

7 years agoMaking njs_function_closures() inline function.
Dmitry Volyntsev [Wed, 10 Apr 2019 14:46:14 +0000 (17:46 +0300)]
Making njs_function_closures() inline function.

7 years agoFixed njs_function_copy().
Dmitry Volyntsev [Sun, 7 Apr 2019 05:38:04 +0000 (13:38 +0800)]
Fixed njs_function_copy().

7 years agoFixed using %*s format in nxt_printf().
Sergey Kandaurov [Tue, 9 Apr 2019 12:00:27 +0000 (15:00 +0300)]
Fixed using %*s format in nxt_printf().

7 years agoFixed Function.prototype.bind().
hongzhidao [Sat, 6 Apr 2019 16:09:09 +0000 (00:09 +0800)]
Fixed Function.prototype.bind().

Making a correct copy of a function.

7 years agoAdded support array-like objects for Function.prototype.apply().
Alexander Borisov [Fri, 5 Apr 2019 14:49:22 +0000 (17:49 +0300)]
Added support array-like objects for Function.prototype.apply().

This closes #51 issue on Github.

7 years agoMaking njs_parser_var_statement() more generic.
hongzhidao [Fri, 5 Apr 2019 13:16:41 +0000 (21:16 +0800)]
Making njs_parser_var_statement() more generic.

7 years agoRemoved unnecessary njs_parser_var_expression().
hongzhidao [Fri, 5 Apr 2019 12:59:15 +0000 (20:59 +0800)]
Removed unnecessary njs_parser_var_expression().

7 years agoAdding const qualifier to njs_value_property().
Dmitry Volyntsev [Fri, 5 Apr 2019 13:49:21 +0000 (16:49 +0300)]
Adding const qualifier to njs_value_property().

7 years agoArguments object as a variable.
hongzhidao [Mon, 25 Mar 2019 16:42:39 +0000 (00:42 +0800)]
Arguments object as a variable.

7 years agoRefactored njs_parser_call_expression().
hongzhidao [Wed, 3 Apr 2019 03:27:05 +0000 (11:27 +0800)]
Refactored njs_parser_call_expression().

7 years agoRefactored njs_parser_object() and njs_parser_array().
hongzhidao [Wed, 3 Apr 2019 03:19:14 +0000 (11:19 +0800)]
Refactored njs_parser_object() and njs_parser_array().

7 years agoIntroduced njs_parser_variable_node().
Dmitry Volyntsev [Tue, 2 Apr 2019 16:32:43 +0000 (19:32 +0300)]
Introduced njs_parser_variable_node().

7 years agoMaking __proto__ accessor descriptor of Object mutable.
Dmitry Volyntsev [Tue, 2 Apr 2019 14:45:38 +0000 (17:45 +0300)]
Making __proto__ accessor descriptor of Object mutable.

7 years agoFixed editline detection.
Igor Sysoev [Tue, 2 Apr 2019 14:17:49 +0000 (17:17 +0300)]
Fixed editline detection.

This simplifies building on modern macOS.

7 years agoRefactored function object creation.
Dmitry Volyntsev [Mon, 1 Apr 2019 16:11:39 +0000 (19:11 +0300)]
Refactored function object creation.

7 years agoRefactored out terminal tokens into njs_parser_terminal.c.
hongzhidao [Sun, 31 Mar 2019 14:59:04 +0000 (22:59 +0800)]
Refactored out terminal tokens into njs_parser_terminal.c.

7 years agoAdded Object.getOwnPropertyDescriptors().
Artem S. Povalyukhin [Wed, 27 Mar 2019 17:49:03 +0000 (20:49 +0300)]
Added Object.getOwnPropertyDescriptors().

This closes #119 issue on Github.

7 years agoIntroduced njs_object_property_descriptor().
Artem S. Povalyukhin [Wed, 27 Mar 2019 17:45:39 +0000 (20:45 +0300)]
Introduced njs_object_property_descriptor().

7 years agoImproved njs_object_enumerate().
Dmitry Volyntsev [Thu, 28 Mar 2019 17:42:11 +0000 (20:42 +0300)]
Improved njs_object_enumerate().

7 years agoAvoiding strict check in export default value expressions.
Dmitry Volyntsev [Thu, 28 Mar 2019 17:31:20 +0000 (20:31 +0300)]
Avoiding strict check in export default value expressions.

Previously, only object literals were allowed.

7 years agoUsing nxt_printf() everywhere.
Dmitry Volyntsev [Thu, 28 Mar 2019 16:45:58 +0000 (19:45 +0300)]
Using nxt_printf() everywhere.

7 years agoAdded njs_vm_json_parse() and njs_vm_json_stringify().
Dmitry Volyntsev [Wed, 27 Mar 2019 18:00:20 +0000 (21:00 +0300)]
Added njs_vm_json_parse() and njs_vm_json_stringify().

7 years agoImproved njs API tests.
Dmitry Volyntsev [Wed, 27 Mar 2019 18:00:19 +0000 (21:00 +0300)]
Improved njs API tests.

7 years agoAdded nxt_dprintf() and nxt_printf().
Dmitry Volyntsev [Wed, 27 Mar 2019 18:00:19 +0000 (21:00 +0300)]
Added nxt_dprintf() and nxt_printf().

7 years agoImproved working with arguments in JSON methods.
Dmitry Volyntsev [Wed, 27 Mar 2019 18:00:19 +0000 (21:00 +0300)]
Improved working with arguments in JSON methods.

7 years agoAdding const qualifier njs_string_prop().
Dmitry Volyntsev [Wed, 27 Mar 2019 18:00:18 +0000 (21:00 +0300)]
Adding const qualifier njs_string_prop().

8 years agoAdded njs_vm_value().
Dmitry Volyntsev [Mon, 16 Apr 2018 16:28:07 +0000 (19:28 +0300)]
Added njs_vm_value().

7 years agoAdded Object.getOwnPropertyNames().
Artem S. Povalyukhin [Tue, 26 Mar 2019 05:04:02 +0000 (08:04 +0300)]
Added Object.getOwnPropertyNames().

This closes #4 issue on Github.

7 years agoVersion bump.
Dmitry Volyntsev [Tue, 26 Mar 2019 20:06:46 +0000 (23:06 +0300)]
Version bump.

7 years agoAdded tag 0.3.0 for changeset 1935ab4643fd
Dmitry Volyntsev [Tue, 26 Mar 2019 13:58:43 +0000 (16:58 +0300)]
Added tag 0.3.0 for changeset 1935ab4643fd

7 years agoVersion 0.3.0. 0.3.0
Dmitry Volyntsev [Tue, 26 Mar 2019 13:56:32 +0000 (16:56 +0300)]
Version 0.3.0.

7 years agoModules: added js_path directive.
Dmitry Volyntsev [Tue, 26 Mar 2019 12:52:53 +0000 (15:52 +0300)]
Modules: added js_path directive.

7 years agoModules: improved working with arguments.
Dmitry Volyntsev [Tue, 26 Mar 2019 12:35:45 +0000 (15:35 +0300)]
Modules: improved working with arguments.

According to ES 5.1:10.5 direct checking of the number
of arguments should be avoided.

7 years agoTreating null and undefined as empty string for external prop set.
Dmitry Volyntsev [Tue, 26 Mar 2019 12:28:18 +0000 (15:28 +0300)]
Treating null and undefined as empty string for external prop set.

7 years agoModules: returning undefined value for absent values.
Dmitry Volyntsev [Tue, 26 Mar 2019 11:51:03 +0000 (14:51 +0300)]
Modules: returning undefined value for absent values.

Instead of empty string.

7 years agoResetting loaded modules in accumulative mode.
Dmitry Volyntsev [Mon, 25 Mar 2019 14:51:19 +0000 (17:51 +0300)]
Resetting loaded modules in accumulative mode.

This closes #113 issue on Github.

7 years agoShell: fixed potential memory leak in main().
Dmitry Volyntsev [Mon, 25 Mar 2019 12:41:21 +0000 (15:41 +0300)]
Shell: fixed potential memory leak in main().

7 years agoFixed accesing global function and objects in modules.
Dmitry Volyntsev [Sat, 23 Mar 2019 13:39:40 +0000 (16:39 +0300)]
Fixed accesing global function and objects in modules.

7 years agoFixed nxt_file_dirname() for paths with no dir component.
hongzhidao [Sat, 23 Mar 2019 11:57:52 +0000 (14:57 +0300)]
Fixed nxt_file_dirname() for paths with no dir component.

Making it more similar to dirname shell cmd.

This closes #114 issue on Github.

7 years agoAdded initial modules support.
hongzhidao [Sat, 2 Mar 2019 12:31:10 +0000 (20:31 +0800)]
Added initial modules support.

The following syntax is supported:
1) default import statements:
import lib1 from '../relative/path/lib.js';
import lib2 from '/abs/path/lib.js';
import fs from 'fs'; // built-in modules

2) default export statements:
export default {fun1, fun2, ...}; // export module object

Modules look up procedure:
1) absolute paths (start with '/') are used as is.
2) otherwise the following paths are tried:
dir + '/' + path where dir is
  a) the directory of the current file.
  b) additions paths provided with njs_vm_add_path().

This closes #91 on Github.

7 years agoHTTP: handling absence of value while iterating over r.args.
Dmitry Volyntsev [Wed, 20 Mar 2019 12:56:22 +0000 (15:56 +0300)]
HTTP: handling absence of value while iterating over r.args.

7 years agoFixed Math.max() for undefined arguments.
Alexander Borisov [Tue, 19 Mar 2019 15:26:44 +0000 (18:26 +0300)]
Fixed Math.max() for undefined arguments.

7 years agoRenaming void to undefined.
Dmitry Volyntsev [Tue, 19 Mar 2019 13:02:07 +0000 (16:02 +0300)]
Renaming void to undefined.

7 years agoSetting [[Construct]] internal property for Function Objects.
Dmitry Volyntsev [Mon, 18 Mar 2019 16:20:02 +0000 (19:20 +0300)]
Setting [[Construct]] internal property for Function Objects.

According to ES5.1: 13.2 [[Construct]] is set by default.

7 years agoFixed native frame arguments number.
hongzhidao [Mon, 18 Mar 2019 13:05:27 +0000 (16:05 +0300)]
Fixed native frame arguments number.

7 years agoStyle.
hongzhidao [Sun, 17 Mar 2019 13:22:30 +0000 (21:22 +0800)]
Style.