]> git.kaiwu.me - njs.git/log
njs.git
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.

7 years agoRemoved unused closures field in njs_variable_t.
Dmitry Volyntsev [Sun, 17 Mar 2019 14:36:17 +0000 (17:36 +0300)]
Removed unused closures field in njs_variable_t.

7 years agoFixed njs_parser_peek_token().
hongzhidao [Sun, 17 Mar 2019 14:11:09 +0000 (17:11 +0300)]
Fixed njs_parser_peek_token().

7 years agoIntroducing UNIT makefile dependency scripts.
Dmitry Volyntsev [Wed, 13 Mar 2019 07:04:58 +0000 (15:04 +0800)]
Introducing UNIT makefile dependency scripts.

    1) Autogenerating Makefile.
    2) Correct makefile dependency tracking.
    3) Makefile.conf is removed.
    4) nxt/auto scripts moved to auto.

    In collaboration with 洪志道 (Hong Zhi Dao).

This closes #110 issue on Github.

7 years agoReporting file name and function name in disassembler output.
Dmitry Volyntsev [Tue, 12 Mar 2019 16:28:11 +0000 (19:28 +0300)]
Reporting file name and function name in disassembler output.

7 years agoAdded Object.prototype.propertyIsEnumerable().
Dmitry Volyntsev [Mon, 11 Mar 2019 15:31:40 +0000 (18:31 +0300)]
Added Object.prototype.propertyIsEnumerable().

7 years agoImproved handling of arguments object.
Dmitry Volyntsev [Mon, 11 Mar 2019 08:15:20 +0000 (11:15 +0300)]
Improved handling of arguments object.

7 years agoIntroduced njs_parser_peek_token().
Dmitry Volyntsev [Sun, 10 Mar 2019 19:26:25 +0000 (22:26 +0300)]
Introduced njs_parser_peek_token().

7 years agoFixed heap-buffer-overflow in lexer.
Dmitry Volyntsev [Sun, 10 Mar 2019 18:13:26 +0000 (21:13 +0300)]
Fixed heap-buffer-overflow in lexer.

The issue was introduced in 8e2cb4da5e46.

7 years agoAdded support for arbitrary number of peek tokens in lexer.
hongzhidao [Sun, 10 Mar 2019 14:25:59 +0000 (22:25 +0800)]
Added support for arbitrary number of peek tokens in lexer.

7 years agoRefactored njs_parser_function_lambda().
hongzhidao [Sun, 10 Mar 2019 09:44:16 +0000 (17:44 +0800)]
Refactored njs_parser_function_lambda().

The function is split into reusable components.

7 years agoImproved njs_parser_reference().
Dmitry Volyntsev [Sun, 10 Mar 2019 13:14:37 +0000 (16:14 +0300)]
Improved njs_parser_reference().

7 years agoIntroduced njs_lexer_token_t.
hongzhidao [Thu, 7 Mar 2019 16:11:23 +0000 (00:11 +0800)]
Introduced njs_lexer_token_t.

7 years agoCorrectly setting length of UTF8 string in fs.readFileSync().
Dmitry Volyntsev [Wed, 6 Mar 2019 16:39:21 +0000 (19:39 +0300)]
Correctly setting length of UTF8 string in fs.readFileSync().

This closes #109 issue on Github.

7 years agoFixed RegExp literal parsing.
Dmitry Volyntsev [Tue, 5 Mar 2019 16:54:23 +0000 (19:54 +0300)]
Fixed RegExp literal parsing.

7 years agoStyle.
hongzhidao [Tue, 5 Mar 2019 00:32:54 +0000 (08:32 +0800)]
Style.

7 years agoAdded additional RegExp tests.
Dmitry Volyntsev [Thu, 28 Feb 2019 17:34:47 +0000 (20:34 +0300)]
Added additional RegExp tests.

7 years agoFixed lexer referencing in runtime.
Dmitry Volyntsev [Thu, 28 Feb 2019 16:30:32 +0000 (19:30 +0300)]
Fixed lexer referencing in runtime.

7 years agoShell: passing original filename to parser.
Dmitry Volyntsev [Thu, 28 Feb 2019 12:32:15 +0000 (15:32 +0300)]
Shell: passing original filename to parser.

7 years agoImproved njs_value_index().
hongzhidao [Tue, 26 Feb 2019 02:19:14 +0000 (10:19 +0800)]
Improved njs_value_index().

7 years agoImproved parser syntax error.
hongzhidao [Tue, 26 Feb 2019 02:11:53 +0000 (10:11 +0800)]
Improved parser syntax error.

7 years agoShell: fixed function redeclarations.
hongzhidao [Wed, 27 Feb 2019 09:52:50 +0000 (17:52 +0800)]
Shell: fixed function redeclarations.

This closes #108 issue on Github.

7 years agoStyle.
hongzhidao [Wed, 27 Feb 2019 09:49:03 +0000 (17:49 +0800)]
Style.

7 years agoImproved parser scope filename.
hongzhidao [Tue, 26 Feb 2019 09:30:02 +0000 (17:30 +0800)]
Improved parser scope filename.

7 years agoStyle.
hongzhidao [Tue, 26 Feb 2019 09:32:59 +0000 (17:32 +0800)]
Style.

7 years agoImproved checking that filename is not empty.
Dmitry Volyntsev [Tue, 26 Feb 2019 14:11:50 +0000 (17:11 +0300)]
Improved checking that filename is not empty.

file->start can be non NULL for empty string.

7 years agoRenaming njs_value_void_set() to njs_value_undefined_set().
Dmitry Volyntsev [Tue, 26 Feb 2019 14:11:47 +0000 (17:11 +0300)]
Renaming njs_value_void_set() to njs_value_undefined_set().

7 years agoVersion bump.
Dmitry Volyntsev [Tue, 26 Feb 2019 14:11:42 +0000 (17:11 +0300)]
Version bump.

7 years agoAdded tag 0.2.8 for changeset ee190d3ace00
Dmitry Volyntsev [Tue, 26 Feb 2019 14:03:24 +0000 (17:03 +0300)]
Added tag 0.2.8 for changeset ee190d3ace00

7 years agoVersion 0.2.8. 0.2.8
Dmitry Volyntsev [Tue, 26 Feb 2019 13:36:29 +0000 (16:36 +0300)]
Version 0.2.8.

7 years agoHTTP: avoid creating empty request_body buffer in r.subrequest().
Dmitry Volyntsev [Tue, 26 Feb 2019 13:16:08 +0000 (16:16 +0300)]
HTTP: avoid creating empty request_body buffer in r.subrequest().

This fixes #101 issue on Github.

7 years agoMoving boilerplate code into njs_generate_code().
Dmitry Volyntsev [Mon, 25 Feb 2019 16:00:56 +0000 (19:00 +0300)]
Moving boilerplate code into njs_generate_code().

7 years agoAdded labels support.
Dmitry Volyntsev [Mon, 25 Feb 2019 16:00:55 +0000 (19:00 +0300)]
Added labels support.

7 years agoHTTP: setting exception if memory allocation fails.
Dmitry Volyntsev [Mon, 25 Feb 2019 16:00:54 +0000 (19:00 +0300)]
HTTP: setting exception if memory allocation fails.

7 years agoFixed Array.prototype.fill().
Artem S. Povalyukhin [Sat, 23 Feb 2019 01:21:44 +0000 (04:21 +0300)]
Fixed Array.prototype.fill().

This closes #71 issue on Github.

7 years agoStyle.
Artem S. Povalyukhin [Sat, 23 Feb 2019 01:20:23 +0000 (04:20 +0300)]
Style.

7 years agoFixed heap-buffer-overflow in String.prototype.split().
Dmitry Volyntsev [Fri, 22 Feb 2019 17:33:31 +0000 (20:33 +0300)]
Fixed heap-buffer-overflow in String.prototype.split().

7 years agoAdded support for setting nginx variables.
Dmitry Volyntsev [Thu, 21 Feb 2019 17:47:52 +0000 (20:47 +0300)]
Added support for setting nginx variables.

This closes #37 issue on Github.

7 years agoImproved API for value creation from the outside of VM.
Dmitry Volyntsev [Thu, 21 Feb 2019 13:35:52 +0000 (16:35 +0300)]
Improved API for value creation from the outside of VM.

7 years agoFixed njs_benchmark.
hongzhidao [Wed, 20 Feb 2019 16:30:40 +0000 (00:30 +0800)]
Fixed njs_benchmark.

7 years agoStyle.
Dmitry Volyntsev [Wed, 20 Feb 2019 18:04:22 +0000 (21:04 +0300)]
Style.

7 years agoFixed %*s length argument type in nxt_sprintf() fmt string.
Dmitry Volyntsev [Wed, 20 Feb 2019 18:04:19 +0000 (21:04 +0300)]
Fixed %*s length argument type in nxt_sprintf() fmt string.

7 years agoFixed creation of long UTF8 strings.
Dmitry Volyntsev [Wed, 20 Feb 2019 15:25:01 +0000 (18:25 +0300)]
Fixed creation of long UTF8 strings.

This closes #98 issue on Github.

7 years agoFixed fast paths.
hongzhidao [Sat, 16 Feb 2019 15:18:43 +0000 (23:18 +0800)]
Fixed fast paths.

7 years agoImproved njs_vm_compile().
hongzhidao [Sat, 16 Feb 2019 15:18:43 +0000 (23:18 +0800)]
Improved njs_vm_compile().

7 years agoAllocating njs_lexer_t on stack.
hongzhidao [Sat, 16 Feb 2019 15:18:43 +0000 (23:18 +0800)]
Allocating njs_lexer_t on stack.

7 years agoAllocating njs_generator_t on stack.
hongzhidao [Sat, 16 Feb 2019 15:18:43 +0000 (23:18 +0800)]
Allocating njs_generator_t on stack.

7 years agoMaking njs_vm_invoke() public.
hongzhidao [Sat, 16 Feb 2019 15:18:43 +0000 (23:18 +0800)]
Making njs_vm_invoke() public.

7 years agoIntroduced njs_parser_global_scope().
hongzhidao [Sat, 16 Feb 2019 15:18:43 +0000 (23:18 +0800)]
Introduced njs_parser_global_scope().

7 years agoIntroduced nxt_file_basename() and nxt_file_dirname().
Dmitry Volyntsev [Wed, 20 Feb 2019 13:16:30 +0000 (16:16 +0300)]
Introduced nxt_file_basename() and nxt_file_dirname().

7 years agoFixed String.prototype.split() for unicode strings.
Dmitry Volyntsev [Thu, 14 Feb 2019 18:19:51 +0000 (21:19 +0300)]
Fixed String.prototype.split() for unicode strings.

This closes #95 issue on Github.

7 years agoAdding const qualifiers to njs_string_prototype_split() and friends.
Dmitry Volyntsev [Thu, 14 Feb 2019 18:19:51 +0000 (21:19 +0300)]
Adding const qualifiers to njs_string_prototype_split() and friends.

7 years agoStyle.
Dmitry Volyntsev [Thu, 14 Feb 2019 14:01:26 +0000 (17:01 +0300)]
Style.

7 years agoFixed line number in reporting variable reference errors.
Dmitry Volyntsev [Thu, 14 Feb 2019 12:21:02 +0000 (15:21 +0300)]
Fixed line number in reporting variable reference errors.

This closes #94 issue on Github.

7 years agoFixed parsing of string literals.
Dmitry Volyntsev [Thu, 14 Feb 2019 11:40:50 +0000 (14:40 +0300)]
Fixed parsing of string literals.

This closes #93 issue on Github.

7 years agoEliminating sprintf() and vsnprintf() usage.
Dmitry Volyntsev [Tue, 12 Feb 2019 15:56:04 +0000 (18:56 +0300)]
Eliminating sprintf() and vsnprintf() usage.

7 years agoReplacing vsprintf with nxt_vsprintf in modules' exceptions API.
Dmitry Volyntsev [Tue, 12 Feb 2019 15:37:59 +0000 (18:37 +0300)]
Replacing vsprintf with nxt_vsprintf in modules' exceptions API.

7 years agoAdded support for shorthand property names for Object literals.
Dmitry Volyntsev [Mon, 11 Feb 2019 15:15:43 +0000 (18:15 +0300)]
Added support for shorthand property names for Object literals.

This closes #87 issue on Github.

7 years agoRefactored njs_parser_terminal().
hongzhidao [Sat, 9 Feb 2019 09:34:04 +0000 (17:34 +0800)]
Refactored njs_parser_terminal().

1) Introduced njs_parser_reference().
2) njs_parser_builtin_object() and njs_parser_builtin_function()
    are refactored into njs_parser_builtin().
3) njs_parser_external() is simplified and renamed as
    njs_external_lookup().

7 years agoImproved njs_parser_property_token().
hongzhidao [Sat, 9 Feb 2019 08:26:08 +0000 (16:26 +0800)]
Improved njs_parser_property_token().

7 years agoRemoving unused argument of njs_parser_property_name().
Dmitry Volyntsev [Fri, 8 Feb 2019 17:22:28 +0000 (20:22 +0300)]
Removing unused argument of njs_parser_property_name().

7 years agoShell: avoid reporting filenames in exception is quiet mode.
Dmitry Volyntsev [Fri, 8 Feb 2019 17:14:55 +0000 (20:14 +0300)]
Shell: avoid reporting filenames in exception is quiet mode.

7 years agoUpdated list of reserved keywords.
Dmitry Volyntsev [Fri, 8 Feb 2019 17:06:05 +0000 (20:06 +0300)]
Updated list of reserved keywords.

7 years agoHTTP: skipping deleted elements while iterating over headers.
Dmitry Volyntsev [Thu, 7 Feb 2019 17:05:16 +0000 (20:05 +0300)]
HTTP: skipping deleted elements while iterating over headers.

7 years agoHTTP: added support for delete operation in r.headersOut.
Dmitry Volyntsev [Thu, 7 Feb 2019 17:05:14 +0000 (20:05 +0300)]
HTTP: added support for delete operation in r.headersOut.

This closes #64 issue on Github.

7 years agoHTTP: improved setting empty headers.
Dmitry Volyntsev [Wed, 6 Feb 2019 16:52:54 +0000 (19:52 +0300)]
HTTP: improved setting empty headers.

Treating empty value as deleting.

7 years agoHTTP: improved setting of special response headers.
Dmitry Volyntsev [Wed, 6 Feb 2019 16:22:18 +0000 (19:22 +0300)]
HTTP: improved setting of special response headers.

7 years agoModules: reporting njs filenames in exceptions.
Dmitry Volyntsev [Wed, 6 Feb 2019 12:50:03 +0000 (15:50 +0300)]
Modules: reporting njs filenames in exceptions.

7 years agoShell: improved filenames reporting in exceptions.
hongzhidao [Wed, 6 Feb 2019 04:27:41 +0000 (12:27 +0800)]
Shell: improved filenames reporting in exceptions.

7 years agoHTTP: setting default content type in sendHeader().
Dmitry Volyntsev [Tue, 5 Feb 2019 16:27:24 +0000 (19:27 +0300)]
HTTP: setting default content type in sendHeader().

7 years agoReporting filename in runtime errors.
hongzhidao [Mon, 4 Feb 2019 17:07:45 +0000 (01:07 +0800)]
Reporting filename in runtime errors.

7 years agoReporting filename in generator errors.
hongzhidao [Mon, 4 Feb 2019 16:53:18 +0000 (00:53 +0800)]
Reporting filename in generator errors.

7 years agoUsing nxt_sprintf() instead of sprintf() in backtraces.
hongzhidao [Mon, 4 Feb 2019 15:00:25 +0000 (23:00 +0800)]
Using nxt_sprintf() instead of sprintf() in backtraces.

7 years agoRemoved a surplus argument to the parser exception macro.
Sergey Kandaurov [Mon, 4 Feb 2019 13:30:27 +0000 (16:30 +0300)]
Removed a surplus argument to the parser exception macro.

While here, fixed nearby style.

7 years agoFixed building with Apple clang.
Dmitry Volyntsev [Mon, 4 Feb 2019 08:45:24 +0000 (11:45 +0300)]
Fixed building with Apple clang.

This closes #89 issue on Github.

7 years agoRenaming njs_exception_error_create() with njs_error_fmt_new().
hongzhidao [Sun, 3 Feb 2019 22:22:51 +0000 (06:22 +0800)]
Renaming njs_exception_error_create() with njs_error_fmt_new().

7 years agoReporting filename in parser errors.
hongzhidao [Sun, 3 Feb 2019 21:33:19 +0000 (05:33 +0800)]
Reporting filename in parser errors.

7 years agoImproved exception creation.
hongzhidao [Sun, 3 Feb 2019 21:26:42 +0000 (05:26 +0800)]
Improved exception creation.

7 years agoIntroduced njs_vm_invoke().
hongzhidao [Sat, 2 Feb 2019 08:01:39 +0000 (16:01 +0800)]
Introduced njs_vm_invoke().

7 years agoImproved njs_parser_statement_chain().
hongzhidao [Sat, 2 Feb 2019 06:21:26 +0000 (14:21 +0800)]
Improved njs_parser_statement_chain().

7 years agoImproved parsing object literals.
Dmitry Volyntsev [Fri, 1 Feb 2019 15:26:18 +0000 (18:26 +0300)]
Improved parsing object literals.

7 years agoFixed parsing object literals.
Dmitry Volyntsev [Fri, 1 Feb 2019 15:09:02 +0000 (18:09 +0300)]
Fixed parsing object literals.

7 years agoSimplified parser builtin function.
hongzhidao [Fri, 1 Feb 2019 11:48:30 +0000 (19:48 +0800)]
Simplified parser builtin function.

7 years agoSimplified parser tree building.
hongzhidao [Tue, 29 Jan 2019 08:30:13 +0000 (16:30 +0800)]
Simplified parser tree building.

7 years agoUnifying quotes usage in exceptions.
Dmitry Volyntsev [Wed, 30 Jan 2019 15:50:33 +0000 (18:50 +0300)]
Unifying quotes usage in exceptions.