]> git.kaiwu.me - njs.git/log
njs.git
6 years agoModules: added typescript API description.
Dmitry Volyntsev [Thu, 7 May 2020 13:49:55 +0000 (13:49 +0000)]
Modules: added typescript API description.

This closes #177 issue on Github.

6 years agoModules: setting retval to undefined for functions returning nothing.
Dmitry Volyntsev [Thu, 30 Apr 2020 10:11:33 +0000 (10:11 +0000)]
Modules: setting retval to undefined for functions returning nothing.

This fixes #305 issue on Github.

6 years agoHTTP: simplifed headers handling.
Dmitry Volyntsev [Thu, 30 Apr 2020 09:44:00 +0000 (09:44 +0000)]
HTTP: simplifed headers handling.

6 years agoHTTP: improved getting of multi-valued headers in r.headersIn.
Dmitry Volyntsev [Wed, 29 Apr 2020 11:57:11 +0000 (11:57 +0000)]
HTTP: improved getting of multi-valued headers in r.headersIn.

1) Duplicates of Content-Type, ETag, From, Max-Forwards, Referer,
   Proxy-Authorization, User-Agent are ignored.
2) Duplicate Cookie headers are joined together with ';'.
3) All other duplicate header values are joined together with ','.

6 years agoVersion bump.
Dmitry Volyntsev [Wed, 29 Apr 2020 11:57:10 +0000 (11:57 +0000)]
Version bump.

6 years agoAdded tag 0.4.0 for changeset 6144aafa1472
Dmitry Volyntsev [Thu, 23 Apr 2020 11:30:25 +0000 (11:30 +0000)]
Added tag 0.4.0 for changeset 6144aafa1472

6 years agoVersion 0.4.0. 0.4.0
Dmitry Volyntsev [Thu, 23 Apr 2020 10:46:54 +0000 (10:46 +0000)]
Version 0.4.0.

6 years agoHTTP: added support for multi-valued headers in r.headersOut.
Dmitry Volyntsev [Tue, 21 Apr 2020 12:37:00 +0000 (12:37 +0000)]
HTTP: added support for multi-valued headers in r.headersOut.

1) Added support for an array of values in assignments:
    r.headersOut['Set-Cookie'] = ['a', '', 'b'] will result in

    Set-Cookie: a
    Set-Cookie: b

    headers in output. All previous Set-Cookie are deleted.

    Only the last element in the table will take effect for standard
    headers such as Content-Type that only accept a single value.

    r.headersOut.foo = [] is the same as

    delete r.headersOut.foo

2) Improved getting of special arrays:
    Set-Cookie is always returned as an array.
    Duplicates of Age, Content-Length, Content-Type, ETag, Expires,
    Last-Modified, Location, Retry-After are ignored.
    All other duplicate header values are joined together with ','.

This closes #266 issue on Github.

6 years agoHTTP: improved iteration over header objects with duplicates.
Dmitry Volyntsev [Tue, 21 Apr 2020 11:57:29 +0000 (11:57 +0000)]
HTTP: improved iteration over header objects with duplicates.

In 9e327cd3a33e duplicates were filtered out only for Cookie and
X-Forwarded-For.

6 years agoHTTP: improved iteration over r.headersOut with special headers.
Dmitry Volyntsev [Tue, 21 Apr 2020 11:56:46 +0000 (11:56 +0000)]
HTTP: improved iteration over r.headersOut with special headers.

In f6234460852a getting of special headers "Content-Type" and
"Content-Length" was introduced.  Still these headers were invisible
during iteration over r.headersOut object.

6 years agoImproved njs_vm_value() in case of a value is not found.
Dmitry Volyntsev [Tue, 21 Apr 2020 11:56:37 +0000 (11:56 +0000)]
Improved njs_vm_value() in case of a value is not found.

6 years agoImproved reading of pseudofiles.
Dmitry Volyntsev [Fri, 17 Apr 2020 17:04:18 +0000 (17:04 +0000)]
Improved reading of pseudofiles.

6 years agoShell: introduced scripts arguments support.
Dmitry Volyntsev [Fri, 17 Apr 2020 17:03:59 +0000 (17:03 +0000)]
Shell: introduced scripts arguments support.

6 years agoFixed String.prototype.replace() when function returns non-string.
Dmitry Volyntsev [Tue, 14 Apr 2020 12:43:09 +0000 (12:43 +0000)]
Fixed String.prototype.replace() when function returns non-string.

This closes #303 issue on Github.

6 years agoFixed RegExp() constructor with empty pattern and non-empty flags.
Dmitry Volyntsev [Tue, 14 Apr 2020 12:42:05 +0000 (12:42 +0000)]
Fixed RegExp() constructor with empty pattern and non-empty flags.

6 years agoModules: added js_import directive.
Dmitry Volyntsev [Tue, 14 Apr 2020 12:18:25 +0000 (12:18 +0000)]
Modules: added js_import directive.

6 years agoAdded "lineNumber" and "fileName" to SyntaxError.
Dmitry Volyntsev [Sun, 12 Apr 2020 12:56:25 +0000 (12:56 +0000)]
Added "lineNumber" and "fileName" to SyntaxError.

6 years agoIntroduced njs_vm_opt_init().
Dmitry Volyntsev [Sun, 12 Apr 2020 10:01:40 +0000 (10:01 +0000)]
Introduced njs_vm_opt_init().

6 years agoFixed potential heap-buffer-overflow in njs_vm_value().
Dmitry Volyntsev [Fri, 10 Apr 2020 11:15:12 +0000 (11:15 +0000)]
Fixed potential heap-buffer-overflow in njs_vm_value().

The issue was introduced in 7ccb8b32cc02.

6 years agoLinking global variables and global object properties.
Dmitry Volyntsev [Wed, 8 Apr 2020 13:15:02 +0000 (13:15 +0000)]
Linking global variables and global object properties.

6 years agoAdded API for working with arrays.
Dmitry Volyntsev [Fri, 3 Apr 2020 16:10:00 +0000 (16:10 +0000)]
Added API for working with arrays.

6 years agoFixed building unit tests by SunC 5.15.
Dmitry Volyntsev [Fri, 3 Apr 2020 16:06:55 +0000 (16:06 +0000)]
Fixed building unit tests by SunC 5.15.

Fixed warning "initializer will be sign-extended".

6 years agoImproved njs_object_length() and friends prototypes.
Dmitry Volyntsev [Thu, 26 Mar 2020 14:12:16 +0000 (17:12 +0300)]
Improved njs_object_length() and friends prototypes.

While object length is always non-negative it is simpler to work with
signed value to avoid too many typecasts.

6 years agoFixed instructions jump offset output.
Dmitry Volyntsev [Mon, 23 Mar 2020 16:58:50 +0000 (19:58 +0300)]
Fixed instructions jump offset output.

Previously jump offsets were rendered as unsigned integers whereas jump
offsets can be negative.

6 years agoFixed "PROP NEXT" instruction.
Dmitry Volyntsev [Mon, 23 Mar 2020 16:52:02 +0000 (19:52 +0300)]
Fixed "PROP NEXT" instruction.

The proper way to access array's elements is "start" field whereas
"data" is an allocation field.  While currently they are numerically
indentical it may change in the future.

6 years agoLexer: fixed handling of no-newline at the end of the script.
Dmitry Volyntsev [Mon, 23 Mar 2020 14:15:46 +0000 (17:15 +0300)]
Lexer: fixed handling of no-newline at the end of the script.

6 years agoRemoved outdated commentary after ccfa84cea2b3.
Dmitry Volyntsev [Fri, 20 Mar 2020 14:33:10 +0000 (17:33 +0300)]
Removed outdated commentary after ccfa84cea2b3.

6 years agoHTTP: returning undefined value when "responseBody" is unavailable.
Dmitry Volyntsev [Fri, 20 Mar 2020 14:33:10 +0000 (17:33 +0300)]
HTTP: returning undefined value when "responseBody" is unavailable.

Missed in b758915e2406.

6 years agoRefactored externals.
Dmitry Volyntsev [Fri, 20 Mar 2020 14:33:06 +0000 (17:33 +0300)]
Refactored externals.

This closes #16 issue on Github.

6 years agoStream: fixed typo in the log message introduced in bbec3cdb747b.
Dmitry Volyntsev [Wed, 18 Mar 2020 15:29:17 +0000 (18:29 +0300)]
Stream: fixed typo in the log message introduced in bbec3cdb747b.

6 years agoSimplifed object enumeration.
Dmitry Volyntsev [Wed, 18 Mar 2020 11:50:46 +0000 (14:50 +0300)]
Simplifed object enumeration.

6 years agoAdded benchmark tests for externals.
Dmitry Volyntsev [Tue, 17 Mar 2020 15:33:25 +0000 (18:33 +0300)]
Added benchmark tests for externals.

6 years agoFixed makefile dependency issue introduced in eb9258cfcf40.
Dmitry Volyntsev [Mon, 16 Mar 2020 12:49:51 +0000 (15:49 +0300)]
Fixed makefile dependency issue introduced in eb9258cfcf40.

6 years agoRemoved unused typedef.
Dmitry Volyntsev [Thu, 5 Mar 2020 13:05:40 +0000 (16:05 +0300)]
Removed unused typedef.

6 years agoAdded externals backtrace test.
Dmitry Volyntsev [Thu, 5 Mar 2020 12:24:54 +0000 (15:24 +0300)]
Added externals backtrace test.

6 years agoSharing external initialization between unit and interactive tests.
Dmitry Volyntsev [Thu, 5 Mar 2020 12:24:52 +0000 (15:24 +0300)]
Sharing external initialization between unit and interactive tests.

6 years agoFixed NULL-pointer dereference in "__proto__" property handler.
Alexander Borisov [Wed, 4 Mar 2020 14:12:55 +0000 (17:12 +0300)]
Fixed NULL-pointer dereference in "__proto__" property handler.

This closes #293 issue on GitHub.

6 years agoFixed compilation with gcc.
Dmitry Volyntsev [Tue, 3 Mar 2020 17:14:48 +0000 (20:14 +0300)]
Fixed compilation with gcc.

6 years agoFixed integer constant is too large compilation error by gcc 4.4.
Dmitry Volyntsev [Tue, 3 Mar 2020 16:00:54 +0000 (19:00 +0300)]
Fixed integer constant is too large compilation error by gcc 4.4.

6 years agoVersion bump.
Dmitry Volyntsev [Tue, 3 Mar 2020 15:57:15 +0000 (18:57 +0300)]
Version bump.

6 years agoAdded tag 0.3.9 for changeset fc4eeaaf0dfe
Dmitry Volyntsev [Tue, 3 Mar 2020 14:18:06 +0000 (17:18 +0300)]
Added tag 0.3.9 for changeset fc4eeaaf0dfe

6 years agoVersion 0.3.9. 0.3.9
Dmitry Volyntsev [Tue, 3 Mar 2020 14:17:08 +0000 (17:17 +0300)]
Version 0.3.9.

6 years agoHTTP: introduced detached subrequest mode in r.subrequest().
Dmitry Volyntsev [Mon, 2 Mar 2020 18:11:37 +0000 (21:11 +0300)]
HTTP: introduced detached subrequest mode in r.subrequest().

If "options.detached" boolean flag is true the created subrequest is
a detached subrequest. Responses to detached subrequest are ignored.
Unlike ordinary subrequests, a detached subrequest can be created
inside a variable handler. The detached flag and callback argument are
mutually exclusive.

6 years agoFixed integer-overflow in Date() constructor.
Dmitry Volyntsev [Fri, 28 Feb 2020 16:39:13 +0000 (19:39 +0300)]
Fixed integer-overflow in Date() constructor.

Found by UndefinedBehaviorSanitizer.

6 years agoFixed njs_date_string().
Dmitry Volyntsev [Fri, 28 Feb 2020 15:56:24 +0000 (18:56 +0300)]
Fixed njs_date_string().

This closes #292 issue on Github.

6 years agoFixed non-native module importing.
hongzhidao [Thu, 30 Jan 2020 13:14:30 +0000 (21:14 +0800)]
Fixed non-native module importing.

Previously, string from "import statement" was used as a key in a hash
to keep track of already loaded modules. This works fine for built-in
modules. It can cause an issue when different modules from different
paths but with identical names are loaded. This patch avoids the issue
by using a full path to a file as a key.

This closes #282 issue on GitHub.

6 years agoFixed heap-buffer-overflow in lexer introduced in 87d05fb35ff9.
Alexander Borisov [Thu, 27 Feb 2020 11:30:14 +0000 (14:30 +0300)]
Fixed heap-buffer-overflow in lexer introduced in 87d05fb35ff9.

6 years agoFixed Unicode Escaping in JSON.stringify() according to spec.
Dmitry Volyntsev [Wed, 26 Feb 2020 14:48:46 +0000 (17:48 +0300)]
Fixed Unicode Escaping in JSON.stringify() according to spec.

Lowecase hexadecimal number are required.

6 years agoFixed JSON.stringify() with Number() and String() objects.
Alexander Borisov [Tue, 25 Feb 2020 13:03:20 +0000 (16:03 +0300)]
Fixed JSON.stringify() with Number() and String() objects.

According to the specification.

6 years agoImproved fields and typedefs naming in parser.
Alexander Borisov [Wed, 26 Feb 2020 13:22:12 +0000 (16:22 +0300)]
Improved fields and typedefs naming in parser.

njs_token_t -> njs_token_type_t
node->token -> node->token_type
lexer->prev_token -> lexer->prev_type

6 years agoLexer refactoring.
Alexander Borisov [Wed, 26 Feb 2020 13:22:10 +0000 (16:22 +0300)]
Lexer refactoring.

6 years agoFixed handling of space argument in JSON.stringify().
Alexander Borisov [Wed, 26 Feb 2020 09:41:51 +0000 (12:41 +0300)]
Fixed handling of space argument in JSON.stringify().

This closes #294 issue on GitHub.

6 years agoFixed Number.prototype.toPrecision().
Dmitry Volyntsev [Wed, 19 Feb 2020 14:21:32 +0000 (17:21 +0300)]
Fixed Number.prototype.toPrecision().

This closes #290 issue on Github.

6 years agoAdded fs.symlink(), fs.unlink(), fs.realpath() and friends.
Artem S. Povalyukhin [Mon, 10 Feb 2020 22:48:24 +0000 (01:48 +0300)]
Added fs.symlink(), fs.unlink(), fs.realpath() and friends.

6 years agoFixed encodeURI() and decodeURI() according to the spec.
Dmitry Volyntsev [Tue, 18 Feb 2020 15:55:50 +0000 (18:55 +0300)]
Fixed encodeURI() and decodeURI() according to the spec.

6 years agoFixed njs_json_append_string().
Dmitry Volyntsev [Tue, 18 Feb 2020 15:42:37 +0000 (18:42 +0300)]
Fixed njs_json_append_string().

6 years agoDetecting memory error in njs_chb_*() functions.
Dmitry Volyntsev [Tue, 18 Feb 2020 15:41:38 +0000 (18:41 +0300)]
Detecting memory error in njs_chb_*() functions.

6 years agoFixed potential integer-overflow in String.prototype.replace().
Dmitry Volyntsev [Mon, 17 Feb 2020 13:18:40 +0000 (16:18 +0300)]
Fixed potential integer-overflow in String.prototype.replace().

6 years agoSimplified code using magic arguments introduced in 6df48738a043.
Dmitry Volyntsev [Mon, 17 Feb 2020 13:18:38 +0000 (16:18 +0300)]
Simplified code using magic arguments introduced in 6df48738a043.

This reduces code duplication and the binary size.

6 years agoStyle: removing excessive commentaries.
Dmitry Volyntsev [Mon, 17 Feb 2020 13:18:18 +0000 (16:18 +0300)]
Style: removing excessive commentaries.

6 years agoIntroduced ToLength() according to ES6.
Dmitry Volyntsev [Mon, 17 Feb 2020 13:13:43 +0000 (16:13 +0300)]
Introduced ToLength() according to ES6.

Since ES6, according to the spec maximum length value is 2**53 - 1 not
2**32 - 1, so uint64_t data type is required.

6 years agoFixed Object.getOwnPropertySymbols().
Alexander Borisov [Thu, 13 Feb 2020 13:25:37 +0000 (16:25 +0300)]
Fixed Object.getOwnPropertySymbols().

This closes #291 issue on GitHub.

6 years agoFiltering out integer indices in njs_object_completions().
Dmitry Volyntsev [Mon, 10 Feb 2020 14:39:41 +0000 (17:39 +0300)]
Filtering out integer indices in njs_object_completions().

This closes #285 issue on Github.

6 years agoImproved Array object allocation after ccfa84cea2b3.
Dmitry Volyntsev [Mon, 10 Feb 2020 14:09:53 +0000 (17:09 +0300)]
Improved Array object allocation after ccfa84cea2b3.

Sometimes flat array alignment is desired, even if its "length" exceeds
32768. This patch introduces additional argument for njs_array_alloc()
which enforced flat allocation when it is set.

6 years agoIntroduced fs.access and friends.
Artem S. Povalyukhin [Sun, 26 Jan 2020 18:56:23 +0000 (21:56 +0300)]
Introduced fs.access and friends.

6 years agoIntroduced fs.promises API.
Artem S. Povalyukhin [Sat, 25 Jan 2020 18:55:50 +0000 (21:55 +0300)]
Introduced fs.promises API.

6 years agoMoving modules_hash to njs_vm_shared_t.
Dmitry Volyntsev [Thu, 6 Feb 2020 17:23:12 +0000 (20:23 +0300)]
Moving modules_hash to njs_vm_shared_t.

As it is shared between VM instances.

6 years agoRemoved dead code in njs_json_parse_iterator() after ccfa84cea2b3.
Dmitry Volyntsev [Wed, 5 Feb 2020 14:30:20 +0000 (17:30 +0300)]
Removed dead code in njs_json_parse_iterator() after ccfa84cea2b3.

6 years agoFixed njs_key_string_get() usage.
Dmitry Volyntsev [Wed, 5 Feb 2020 12:54:56 +0000 (15:54 +0300)]
Fixed njs_key_string_get() usage.

njs_key_string_get() converts Symbol instances to strings,
while Symbols should never be converted to strings implicitly.
The function is expected to be used only while generating Error
messages.

Found by Clang static analyzer.

6 years agoRemoved dead store assignment after ccfa84cea2b3.
Dmitry Volyntsev [Wed, 5 Feb 2020 12:26:18 +0000 (15:26 +0300)]
Removed dead store assignment after ccfa84cea2b3.

Found by Clang static analyzer.

6 years agoIntroduced memory-efficient arrays.
Dmitry Volyntsev [Tue, 4 Feb 2020 17:35:02 +0000 (20:35 +0300)]
Introduced memory-efficient arrays.

1) If "length" of ordinary array exceeds 32768 it is converted to
to array-like object.

2) Array.prototype.concat() is rewritten according to the spec.
3) Array.prototype.slice() is rewritten according to the spec.

6 years agoAdded fast path in [[Get]] and [[Set]] for arrays and typed-arrays.
Dmitry Volyntsev [Tue, 4 Feb 2020 17:35:00 +0000 (20:35 +0300)]
Added fast path in [[Get]] and [[Set]] for arrays and typed-arrays.

6 years agoFixed callback invocations in "fs" module.
Artem S. Povalyukhin [Mon, 20 Jan 2020 10:24:09 +0000 (13:24 +0300)]
Fixed callback invocations in "fs" module.

This closes #200 issue on Github.

6 years agoFixed match of native function is backtraces.
Dmitry Volyntsev [Wed, 22 Jan 2020 12:29:47 +0000 (15:29 +0300)]
Fixed match of native function is backtraces.

Since 6df48738a043 native methods are not uniquely identifiable
by a function pointer as several method may share common
C function and differ only in magic argument.

6 years agoFixed typo introduced in 1abb97e9d9dc.
Dmitry Volyntsev [Wed, 22 Jan 2020 12:29:44 +0000 (15:29 +0300)]
Fixed typo introduced in 1abb97e9d9dc.

6 years agoVersion bump.
Dmitry Volyntsev [Tue, 21 Jan 2020 14:37:37 +0000 (17:37 +0300)]
Version bump.

6 years agoAdded tag 0.3.8 for changeset 1abb97e9d9dc
Dmitry Volyntsev [Tue, 21 Jan 2020 13:30:20 +0000 (16:30 +0300)]
Added tag 0.3.8 for changeset 1abb97e9d9dc

6 years agoVersion 0.3.8. 0.3.8
Dmitry Volyntsev [Tue, 21 Jan 2020 13:06:20 +0000 (16:06 +0300)]
Version 0.3.8.

6 years agoFixed %TypedArray%.prototype.fill().
Dmitry Volyntsev [Tue, 21 Jan 2020 13:03:30 +0000 (16:03 +0300)]
Fixed %TypedArray%.prototype.fill().

For subarrays starting from non-zero offset.

6 years agoAdded %TypedArray%.prototype.subarray().
Dmitry Volyntsev [Tue, 21 Jan 2020 13:01:48 +0000 (16:01 +0300)]
Added %TypedArray%.prototype.subarray().

6 years agoFixed Function constructor according to the spec.
Dmitry Volyntsev [Tue, 21 Jan 2020 13:01:45 +0000 (16:01 +0300)]
Fixed Function constructor according to the spec.

"this" value should point to the global object.

6 years agoIntroduced njs_fs_path_arg().
Artem S. Povalyukhin [Fri, 17 Jan 2020 07:04:28 +0000 (10:04 +0300)]
Introduced njs_fs_path_arg().

6 years agoFixed use-of-uninitialized-value for the global this object.
Dmitry Volyntsev [Thu, 16 Jan 2020 18:29:43 +0000 (21:29 +0300)]
Fixed use-of-uninitialized-value for the global this object.

Found by MemorySanitizer.

6 years agoFixed format specifier in typed-array constructor.
Dmitry Volyntsev [Thu, 16 Jan 2020 16:18:41 +0000 (19:18 +0300)]
Fixed format specifier in typed-array constructor.

6 years agoFixed memory-leak introduced in b840b7af946e.
Dmitry Volyntsev [Thu, 16 Jan 2020 16:18:41 +0000 (19:18 +0300)]
Fixed memory-leak introduced in b840b7af946e.

6 years agoHTTP: introduced promise support in r.subrequest().
Dmitry Volyntsev [Thu, 16 Jan 2020 16:18:39 +0000 (19:18 +0300)]
HTTP: introduced promise support in r.subrequest().

If callback is not provided r.subrequest() returns an ordinary
Promise object that resolves to subrequest response object.

6 years agoAdded support for typed-arrays in String.bytesFrom().
Dmitry Volyntsev [Thu, 16 Jan 2020 12:14:38 +0000 (15:14 +0300)]
Added support for typed-arrays in String.bytesFrom().

6 years agoIntroduced "global" and "globalThis" aliases to the global object.
Dmitry Volyntsev [Tue, 14 Jan 2020 13:52:42 +0000 (16:52 +0300)]
Introduced "global" and "globalThis" aliases to the global object.

6 years agoRefactored njs_benchmark.
Dmitry Volyntsev [Mon, 13 Jan 2020 18:35:15 +0000 (21:35 +0300)]
Refactored njs_benchmark.

6 years agoRemoved dead store assignments.
Dmitry Volyntsev [Thu, 9 Jan 2020 12:55:05 +0000 (15:55 +0300)]
Removed dead store assignments.

Found by Clang static analyzer.

6 years agoFixed integer overflow in njs_typed_array_constructor().
Dmitry Volyntsev [Thu, 9 Jan 2020 12:54:52 +0000 (15:54 +0300)]
Fixed integer overflow in njs_typed_array_constructor().

Found by Coverity (CID 1457371).

6 years agoRemoved dead code in njs_typed_array_get() after 1c3c593cc3fd.
Dmitry Volyntsev [Thu, 9 Jan 2020 12:54:16 +0000 (15:54 +0300)]
Removed dead code in njs_typed_array_get() after 1c3c593cc3fd.

Found by Coverity (CID 1457372).

6 years agoFixed typo introduced in 61bf7a31e685.
Alexander Borisov [Thu, 9 Jan 2020 12:21:08 +0000 (15:21 +0300)]
Fixed typo introduced in 61bf7a31e685.

Found by Coverity (CIDs 14573701457369).

6 years agoFixed "length" may be uninitialized in njs_typed_array_constructor().
Dmitry Volyntsev [Fri, 27 Dec 2019 16:17:26 +0000 (19:17 +0300)]
Fixed "length" may be uninitialized in njs_typed_array_constructor().

Found by Clang static analyzer.

6 years agoFixed njs_vm_handle_events().
Alexander Borisov [Thu, 26 Dec 2019 12:31:54 +0000 (15:31 +0300)]
Fixed njs_vm_handle_events().

Fixed typo introduced in 61bf7a31e685. Event loop is expected to process two
queues: posted events and promise events according to the spec. The "do while"
loop was introduced to handle possible promise events which may appear as
a result of posted events processing. The loop termination condition should
check for emptyness of promise events queue, because posted events can only be
created outside the loop (externally).

6 years agoShell: stopping events handling for uncaught exception in file mode.
Dmitry Volyntsev [Thu, 26 Dec 2019 11:53:52 +0000 (14:53 +0300)]
Shell: stopping events handling for uncaught exception in file mode.

This closes #269 issue on Github.

6 years agoFixed import segfault.
hongzhidao [Fri, 13 Dec 2019 04:47:37 +0000 (12:47 +0800)]
Fixed import segfault.

This closes #274 issue on Github.

6 years agoIntroduced TypedArray objects.
Dmitry Volyntsev [Wed, 25 Dec 2019 12:59:01 +0000 (15:59 +0300)]
Introduced TypedArray objects.

Added the global constructors:
  Uint8Array, Int8Array, Uint8ClampedArray, Uint16Array, Int16Array,
  Uint32Array, Int32Array, Float32Array, Float64Array.

Implemented:
    - TypedArray(),
    - TypedArray(length),
    - TypedArray(buffer, [start, [end]]),
    - TypedArray(object),
    - TypedArray(typedarray),
    - TypedArray.BYTES_PER_ELEMENT.

    - %TypedArray%.prototype.constructor
    - get %TypedArray%.prototype.buffer
    - get %TypedArray%.prototype.byteLength
    - get %TypedArray%.prototype.byteOffset
    - get %TypedArray%.prototype.length
    - %TypedArray%.prototype[@@toStringTag]
    - %TypedArray%.prototype.set(array [, start])
    - %TypedArray%.prototype.slice([start, [end]])
    - %TypedArray%.prototype.toString()
    - %TypedArray%.prototype.join(separator)
    - %TypedArray%.prototype.fill().

In collaboration with Tiago Natel de Moura.

This closes #264 issue on Github.

6 years agoShell: fixed output of large values for last evaluated expression.
Dmitry Volyntsev [Tue, 17 Dec 2019 15:22:50 +0000 (18:22 +0300)]
Shell: fixed output of large values for last evaluated expression.

6 years agoIntroduced the Promise object.
Alexander Borisov [Tue, 17 Dec 2019 07:35:11 +0000 (10:35 +0300)]
Introduced the Promise object.

Implemented according to the specification without: Promise.all(),
Promise.allSettled(), Promise.race().

This closes #39 issue on GitHub.