Changes
Changes with njs 0.9.3
Release Date: 07 October 2025
nginx modules:
-
Bugfix: fixed heap-use-after-free while module loading.
-
Bugfix: fixed heap-use-after-free in
js_sethandler used in log phase. The issue was introduced in 04f6dfb (0.9.2).
Changes with njs 0.9.2
Release Date: 23 September 2025
nginx modules:
-
Feature: added HTTP keepalive support for
ngx.fetch()API. -
Improvement: added configure time check when the
js_importdirective is not specified for http or stream. -
Bugfix: fixed merging of
js_pathdirectives for http and stream. -
Bugfix: fixed building when the ngx_http_ssl_module and ngx_stream_ssl_module modules are unavailable.
Core:
-
Change: increased the default stack size to 160k for njs VM.
-
Feature: added
njs.on('exit')API for the qjs engine. -
Improvement: optimized memory consumption while streaming in qjs.
-
Bugfix: fixed building qjs engine with clang 19.
-
Bugfix: fixed building with GCC 15 and O3 optimization level.
Changes with njs 0.9.1
Release Date: 10 Jul 2025
nginx modules:
-
Feature: added state file for a shared dictionary.
-
Bugfix: fixed handling of Content-Length header when a body is provided in Fetch API.
-
Bugfix: fixed qjs engine after bellard/quickjs@458c34d2.
-
Bugfix: fixed NULL pointer dereference when processing
If-MatchandIf-Unmodified-Sinceheaders.
Core:
-
Feature: added ECDH support for WebCrypto.
-
Improvement: reduced memory consumption by the object hash. The new hash uses 42% less memory per element.
-
Improvement: reduced memory consumption for concatenation of numbers and strings.
-
Improvement: reduced memory consumption of
String.prototype.concat()with scalar values. -
Bugfix: fixed segfault in
njs_property_query(). The issue was introduced in b28e50b1 (0.9.0). -
Bugfix: fixed Function constructor template injection.
-
Bugfix: fixed GCC compilation with O3 optimization level.
-
Bugfix: fixed
constant is too largefor 'long' warning on MIPS-mabi=n32. -
Bugfix: fixed compilation with GCC 4.1.
-
Bugfix: fixed
%TypedArray%.from()with the buffer is detached by the mapper. -
Bugfix: fixed
%TypedArray%.prototype.slice()with overlapping buffers. -
Bugfix: fixed handling of detached buffers for typed arrays.
-
Bugfix: fixed frame saving for async functions with closures.
-
Bugfix: fixed RegExp compilation of patterns with escaped '[' characters.
Changes with njs 0.9.0
Release Date: 06 May 2025
Core:
-
Feature: refactored handling of built-in strings, symbols, and small integers. Performance improvements (arewefastyet/benchmarks/v8-v7 benchmark):
-
Richards: +57% (631 → 989)
-
Crypto: +7% (1445 → 1551)
-
RayTrace: +37% (562 → 772)
-
NavierStokes: +20% (2062 → 2465)
-
Overall score: +29% (1014 → 1307)
-
-
Bugfix: fixed handling of undefined values of a captured group in
RegExp.prototype[Symbol.split](). -
Bugfix: fixed
GCC 15build error with-Wunterminated-string-initialization.
Changes with njs 0.8.10
Release Date: 08 April 2025
nginx modules:
-
Feature: reading
r.requestTextorr.requestBufferfrom a temporary file. Previously, an exception was thrown when accessingr.requestTextorr.requestBufferif the size of the client request body exceededclient_body_buffer_size. -
Improvement: improved reporting of unhandled promise rejections.
-
Bugfix: fixed name corruption in variables and headers processing.
-
Bugfix: fixed
incr()method of a shared dictionary with an empty init argument for the QuickJS engine. -
Bugfix: accepting response headers with underscore characters in Fetch API.
Core:
-
Change: fixed
serializeToString(). Previously,serializeToString()wasexclusiveC14n()which returned a string instead of Buffer. According to the published documentation, it should bec14n(). -
Feature: added
TextEncoderandTextDecoderfor the QuickJS engine. -
Feature: added
querystringmodule for the QuickJS engine. -
Feature: added support for the
QuickJS-NGlibrary. -
Bugfix: fixed
Buffer.concat()with a single argument in QuickJS. -
Bugfix: added missed syntax error for
awaitin template literal. -
Bugfix: fixed non-NULL terminated strings formatting in exceptions for the QuickJS engine.
-
Bugfix: fixed compatibility with recent change in QuickJS and
QuickJS-NG.
Changes with njs 0.8.9
Release Date: 14 January 2025
nginx modules:
-
Bugfix: removed extra VM creation per server. Previously, when
js_importwas declared in http or stream blocks, an extra copy of the VM instance was created for each server block. This was not needed and consumed a lot of memory for configurations with many server blocks. This issue was introduced in 0.8.6 and was partially fixed for location blocks only in 0.8.7.
Core:
Changes with njs 0.8.8
Release Date: 10 December 2024
nginx modules:
-
Feature: implemented shared dictionary for the QuickJS engine.
-
Improvement: js_preload_object is refactored.
-
Bugfix: fixed limit rated output.
-
Bugfix: optimized use of SSL contexts for the js_fetch_trusted_certificate directive.
Core:
-
Feature: implemented process object for the QuickJS engine.
-
Feature: implemented the process.kill() method.
-
Bugfix: fixed XML tests with libxml2 2.13 and later.
-
Bugfix: fixed promise resolving when Promise is inherited.
-
Bugfix: fixed absolute scope in cloned VMs.
Changes with njs 0.8.7
Release Date: 22 October 2024
nginx modules:
-
Bugfix: eliminated unnecessary VM creation. Previously, njs consumed memory proportionally to the number of nginx locations. The issue was introduced in 0.8.6.
-
Improvement: added strict syntax validation for js_body_filter.
-
Improvement: improved error messages for module loading failures.
Core:
-
Feature: implemented
fs.readlinkSync(). -
Improvement: implemented lazy stack symbolization.
-
Bugfix: fixed heap-buffer-overflow in
Buffer.prototype.indexOf(). The issue was introduced in 0.8.6. -
Bugfix: fixed
Buffer.prototype.lastIndexOf()when `from` is provided.
Changes with njs 0.8.6
Release Date: 02 October 2024
nginx modules:
-
Feature: introduced the QuickJS engine.
-
Feature: added optional
nocacheflag for thejs_setdirective for http and stream. Thanks to Thomas P. -
Feature: exposed capture group variables in the HTTP module. Thanks to Thomas P.
Core:
-
Feature: added
Buffermodule for the QuickJS engine. -
Bugfix: fixed handling of empty labelled statement in a function.
-
Bugfix: fixed
Functionconstructor handling when called without arguments. -
Bugfix: fixed
Buffer.prototype.writeInt8()and friends. -
Bugfix: fixed
Buffer.prototype.writeFloat()and friends. -
Bugfix: fixed
Buffer.prototype.lastIndexOf(). -
Bugfix: fixed
Buffer.prototype.write(). -
Bugfix: fixed maybe-uninitialized warnings in error creation.
-
Bugfix: fixed
ctx.codepointinitialization in UTF-8 decoding. -
Bugfix: fixed
lengthinitialization inArray.prototype.pop(). -
Bugfix: fixed handling of
encodearg infs.readdir()andfs.realpath().
Changes with njs 0.8.5
Release Date: 25 June 2024
nginx modules:
-
Change: bytes invalid in UTF-8 encoding are converted into the replacement character in:
-
r.variables.var,r.requestText,r.responseText,s.variables.var, -
the
dataargument of thes.on()callback withuploadordownloadevent types, -
the
dataargument of thejs_body_filterdirective.
When working with binary data, use:
-
r.rawVariables.var,r.requestBuffer,r.responseBuffer,s.rawVariables.var, -
the
upstreamordownstreamevent type fors.on(), -
buffer_type=bufferforjs_body_filter.
-
-
Feature: added
timeoutargument foradd(),set(), andincr()methods of a shared dictionary. -
Bugfix: fixed checking for duplicate
js_setvariables. -
Bugfix: fixed request
Hostheader when the port is non-standard. -
Bugfix: fixed handling of a zero-length request body in
ngx.fetch()andr.subrequest(). -
Bugfix: fixed heap-buffer-overflow in
Headers.get(). -
Bugfix: fixed
r.subrequest()error handling.
Core:
-
Feature: added
zlibmodule forQuickJSengine. -
Bugfix: fixed
zlib.inflate(). -
Bugfix: fixed
String.prototype.replaceAll()with a zero-length argument. -
Bugfix: fixed
retvalhandling after an exception inArray.prototype.toSpliced(),Array.prototype.toReversed(),Array.prototype.toSorted(). -
Bugfix: fixed
RegExp.prototype[@@replace]()with replacements containing$',$`and strings with Unicode characters. -
Bugfix: fixed a one-byte overread in
decodeURI()anddecodeURIComponent(). -
Bugfix: fixed tracking of argument scope.
-
Bugfix: fixed integer overflow in
Date.parse().
Changes with njs 0.8.4
Release Date: 16 April 2024
nginx modules:
-
Feature: the
Serverheader for outgoing header can be set. -
Improvement: validating URI and args arguments in
r.subrequest(). -
Improvement: checking for duplicate js_set variables.
-
Bugfix: fixed
clear()method of a shared dictionary without a timeout introduced in 0.8.3. -
Bugfix: fixed
r.send()method of a shared dictionary without a timeout withBufferargument.
Core:
-
Feature: added
QuickJSengine support in CLI. -
Bugfix: fixed
atob()with non-paddedbase64strings.
Changes with njs 0.8.3
Release Date: 07 February 2024
nginx modules:
-
Bugfix: fixed
Headers.set(). -
Bugfix: fixed js_set with
Buffervalues. -
Bugfix: fixed
clear()method of a shared dictionary when a timeout is not specified. -
Bugfix: fixed stub_status statistics when js_periodic is enabled.
Core:
-
Bugfix: fixed building with libxml2 2.12 and later.
-
Bugfix: fixed
Dateconstructor for overflows and withNaNvalues. -
Bugfix: fixed underflow in
querystring.parse(). -
Bugfix: fixed potential buffer overread in
String.prototype.match(). -
Bugfix: fixed parsing of
for-inloops. -
Bugfix: fixed parsing of hexadecimal, octal, and binary literals with no digits.
Changes with njs 0.8.2
Release Date: 24 October 2023
nginx modules:
-
Feature: introduced console object. The following methods were introduced:
error(),info(),log(),time(),timeEnd(),warn(). -
Bugfix: fixed
HEADresponse handling with large Content-Length in Fetch API. -
Bugfix: fixed
items()method for a shared dictionary. -
Bugfix: fixed
delete()method for a shared dictionary.
Core:
-
Feature: extended
fsmodule. Addedfs.existsSync(). -
Bugfix: fixed
xmlmodule. Broken XML exception handling inxml.parse()method was fixed. -
Bugfix: fixed
Regexp.prototype.exec()with global regexp and Unicode input.
Changes with njs 0.8.1
Release Date: 12 September 2023
nginx modules:
-
Feature: introduced the
js_periodicdirective for http and stream that allows specifying a JS handler to run at regular intervals. -
Feature: implemented
items()method of a shared dictionary. The method returns all the non-expired key-value pairs. -
Bugfix: fixed
size()andkeys()methods of a shared dictionary. -
Bugfix: fixed erroneous exception in
r.internalRedirect()introduced in 0.8.0.
Core:
-
Bugfix: fixed incorrect order of keys in
Object.getOwnPropertyNames().
Changes with njs 0.8.0
Release Date: 06 July 2023
nginx modules:
-
Change: removed special treatment of forbidden headers in Fetch API introduced in 0.7.10.
-
Change: removed deprecated since 0.5.0
r.requestBodyandr.responseBodyinhttpmodule. -
Change: throwing an exception in
r.internalRedirect()while filtering inhttpmodule. -
Feature: introduced more global
nginxproperties:ngx.build,ngx.conf_file_path,ngx.error_log_path,ngx.prefix,ngx.version,ngx.version_number, andngx.worker_id. -
Feature: introduced the
js_shared_dict_zonedirective for http and stream that allows declaring a dictionary shared between worker processes. -
Feature: introduced global
nginx.sharedmethods and properties for working with shared dictionaries. -
Improvement: added compile-time options to disable njs modules. For example, to disable libxslt-related code:
NJS_LIBXSLT=NO ./configure .. --add-module=/path/to/njs/module
-
Bugfix: fixed
r.statussetter when filtering inhttpmodule. -
Bugfix: fixed setting of Location header in
httpmodule.
Core:
-
Change: native methods are provided with
retvalargument. This change breaks compatibility with C extension for njs requiring the modification of the code. -
Change: non-compliant deprecated String methods were removed. The following methods were removed:
String.bytesFrom(),String.prototype.fromBytes(),String.prototype.fromUTF8(),String.prototype.toBytes(),String.prototype.toUTF8(),String.prototype.toString(.encoding) -
Change: removed support for building with GNU readline.
-
Feature: added ES13-compliant
Arraymethods:Array.from(),Array.prototype.toSorted(),Array.prototype.toSpliced(),Array.prototype.toReversed(). -
Feature: added ES13-compliant
TypedArraymethods:%TypedArray%.prototype.toSorted(),%TypedArray%.prototype.toSpliced(),%TypedArray%.prototype.toReversed(). -
Feature: added
CryptoKeyproperties in WebCrypto API. The following properties were added:algorithm,extractable,type,usages. -
Bugfix: fixed
retvalofсrypto.getRandomValues(). -
Bugfix: fixed evaluation of computed property names with function expressions.
-
Bugfix: fixed implicit name for a function expression declared in arrays.
-
Bugfix: fixed parsing of
for-inloops. -
Bugfix: fixed
Date.parse()with ISO-8601 format and UTC time offset.
Changes with njs 0.7.12
Release Date: 10 April 2023
nginx modules:
-
Bugfix: fixed
Headers()constructor in Fetch API.
Core:
-
Feature: added
Hash.copy()method in crypto module. -
Feature: added zlib module.
-
Improvement: added support for
export {name as default}statement. -
Bugfix: fixed
Numberconstructor according to the spec.
Changes with njs 0.7.11
Release Date: 09 March 2023
nginx modules:
Core:
-
Feature: added XMLNode API to modify XML documents.
-
Change: removed
XML_PARSE_DTDVALIDduring parsing of an XML document due to security implications. The issue was introduced in 0.7.10. WhenXML_PARSE_DTDVALIDis enabled, libxml2 parses and executes external entities present inside an XML document. -
Bugfix: fixed the detection of
awaitin arguments. -
Bugfix: fixed
Error()instance dumping when "name" prop is not primitive. -
Bugfix: fixed array instance with a
getterproperty dumping. -
Bugfix: fixed
njs_object_property()withNJS_WHITEOUTproperties. -
Bugfix: fixed
funcinstance dumping with "name" as getter. -
Bugfix: fixed attaching of a stack to an error object.
-
Bugfix: fixed
String.prototype.replace()with replacement containing "$'", "$`".
Changes with njs 0.7.10
Release Date: 07 February 2023
nginx modules:
-
Feature: added
Request,Response, andHeadersctors in Fetch API. -
Bugfix: fixed nginx logger callback for calls in the master process.
Core:
-
Feature: added signal support in CLI.
-
Feature: added
xmlmodule for working with XML documents. -
Feature: extended support for symmetric and asymmetric keys in WebCrypto. Most notably
JWKformat forimportKey()was added. -
Feature: extended support for symmetric and asymmetric keys in WebCrypto API. Most notably
JWKformat forimportKey()was added.generateKey()andexportKey()were also implemented. -
Feature: added
String.prototype.replaceAll(). -
Bugfix: fixed
for(expr1;conditional syntax error handling. -
Bugfix:
Object.values()andObject.entries()with external objects. -
Bugfix: fixed
RegExp.prototype[@@replace]().
Changes with njs 0.7.9
Release Date: 17 November 2022
nginx modules:
-
Bugfix: fixed
FetchResponse prototype reinitialization. When at least onejs_importdirective was declared in both HTTP and Stream,ngx.fetch()returned inapproriate response in Stream. The bug was introduced in 0.7.7.
Core:
-
Bugfix: fixed
String.prototype.replace(re)ifre.exec()returns non-flat array. -
Bugfix: fixed
Array.prototype.fill()whenstartobject changesthis. -
Bugfix: fixed description for
fs.mkdir()andfs.rmdir()methods. -
Bugfix: fixed
%TypedArray%.prototype.set(s)whenselement changesthis. -
Bugfix: fixed
Array.prototype.splice(s,d)whendresizesthisduring eval. -
Bugfix: fixed
for-inloop with left and right hand side expressions.
Changes with njs 0.7.8
Release Date: 25 October 2022
nginx modules:
-
Feature: added js_preload_object directive.
-
Feature: added
ngx.conf_prefixproperty. -
Feature: added
s.sendUpstream()ands.sendDownstream()in stream module. -
Feature: added support for
HEADmethod in Fetch API. -
Improvement: improved
asynccallback support fors.send()in stream module.
Core:
-
Feature: added
nameinstance property for a function object. -
Feature: added
njs.memoryStatsobject. -
Bugfix: fixed
String.prototype.trimEnd()with unicode string. -
Bugfix: fixed
Object.freeze()with fast arrays. -
Bugfix: fixed
Object.defineProperty()with fast arrays. -
Bugfix: fixed
asynctoken as a property name of an object. -
Bugfix: fixed property set instruction when key modifies base binding.
-
Bugfix: fixed complex assignments.
-
Bugfix: fixed handling of unhandled promise rejection.
-
Bugfix: fixed process.env when duplicate environ variables are present.
-
Bugfix: fixed double declaration detection in modules.
-
Bugfix: fixed bound function calls according to the spec.
-
Bugfix: fixed break label for
ifstatement. -
Bugfix: fixed labeled empty statements.
Changes with njs 0.7.7
Release Date: 30 August 2022
nginx modules:
-
Feature: the number of nginx configuration contexts where js directives can be specified is extended.
-
HTTP: the js_import, js_path, js_set, and js_var directives are allowed in
serverandlocationcontexts. The js_content, js_body_filter and js_header_filter are allowed in if context. -
Stream: the js_import, js_path, js_set, and js_var are allowed in
servercontext.
-
-
Feature: added
r.internalproperty. -
Bugfix: fixed reading response body in Fetch API.
-
Bugfix: fixed js_fetch_timeout in stream.
-
Bugfix: fixed socket leak with
0fetch timeout.
Core:
-
Feature: extended
fsmodule. Addedfs.openSync(),fs.promises.open(),fs.fstatSync(),fs.readSync(),fs.writeSync().The following properties of
FileHandleare implemented:fd,read(),stat(),write(),close(). -
Bugfix: fixed
parseInt(),parseFloat(),Symbol.for()with no arguments.
Changes with njs 0.7.6
Release Date: 19 July 2022
nginx modules:
-
Feature: improved
r.args{}object. Added support for multiple arguments with the same key. Added case sensitivity for keys. Keys and values are percent-decoded now. -
Bugfix: fixed
r.headersOut{}setter for special headers.
Core:
-
Feature: added
Symbol.for()andSymbol.keyfor(). -
Bugfix: fixed large non-decimal literals.
-
Bugfix: fixed Unicode argument trimming in
parseInt(). -
Bugfix: fixed
breakinstruction intry-catchblock. -
Bugfix: fixed
asyncfunction declaration in CLI.
Changes with njs 0.7.5
Release Date: 21 June 2022
nginx modules:
-
Change: adapting to changes in nginx header structures.
-
Bugfix: fixed
r.headersOut{}special getters when value is absent. -
Change: returning undefined value instead of an empty string for
Content-Typewhen the header is absent.
Core:
-
Bugfix: fixed catching of the exception thrown from an awaited function.
-
Bugfix: fixed function value initialization.
-
Bugfix: fixed interpreter when await fails.
-
Bugfix: fixed typed-array constructor when source array is changed while iterating.
-
Bugfix:fixed
String.prototype.replace()with byte strings. -
Bugfix: fixed template literal from producing byte-strings.
-
Bugfix: fixed array iterator with sparse arrays.
-
Bugfix: fixed memory free while converting a flat array to a slow array.
-
Bugfix: properly handling
NJS_DECLINEinpromisenative functions. -
Bugfix: fixed working with an array-like object in
Promise.all()and friends.
Changes with njs 0.7.4
Release Date: 24 May 2022
nginx modules:
-
Feature: added extended directives for configuring Fetch API. The following directives were added for http and stream:
-
Change:
r.internalRedirect()now accepts escaped URIs. -
Bugfix: fixed Response parsing with more than 8 headers in Fetch API.
Core:
-
Feature: added
njs.version_numberproperty. -
Feature: added compatibility with BoringSSL for WebCrypto API.
-
Bugfix: fixed
Array.prototype.sort()when arr size is changed in a comparator. -
Bugfix: fixed
Array.prototype.slice()with slowthisargument. -
Bugfix: fixed aggregation methods of
Promisector with array-like object. -
Bugfix: fixed
String.prototype.lastIndexOf()with Unicode string asthis. -
Bugfix: fixed
JSON.parse()whenreviverfunction is provided. -
Bugfix: fixed
Object.defineProperty()when a recursive descriptor is provided. -
Bugfix: fixed
Array.prototype.fill()for typed-arrays. -
Bugfix: making function expression binding immutable according to the specs.
-
Bugfix: fixed redefinition of special props in
Object.defineProperty().
Changes with njs 0.7.3
Release Date: 12 April 2022
Core:
-
Feature: added support of module resolution callback. This feature allows the host environment to control how imported modules are loaded.
-
Bugfix: fixed backtraces while traversing imported user modules.
-
Bugfix: fixed
Array.prototype.concat()whenthisis a slow array. -
Bugfix: fixed frame allocation from an awaited frame.
-
Bugfix: fixed allocation of large array literals.
-
Bugfix: fixed interpreter when
toStringconversion fails.
Changes with njs 0.7.2
Release Date: 25 January 2022
Core:
-
Bugfix: fixed
Array.prototype.join()when array is changed while iterating. -
Bugfix: fixed
Array.prototype.slice()when array is changed while iterating. -
Bugfix: fixed
Array.prototype.concat()when array is changed while iterating. -
Bugfix: fixed
Array.prototype.reverse()when array is changed while iterating. -
Bugfix: fixed
Buffer.concat()with subarrays. Thanks to Sylvain Etienne. -
Bugfix: fixed type confusion bug while resolving promises.
-
Bugfix: fixed
Function.prototype.apply()with large array arguments. -
Bugfix: fixed recursive
asyncfunction calls. -
Bugfix: fixed function redeclaration. The bug was introduced in 0.7.0.
Changes with njs 0.7.1
Release Date: 28 December 2021
nginx modules:
-
Change: the js_include directive deprecated since 0.4.0 was removed.
-
Change: PCRE/PCRE2-specific code was moved to the modules. This ensures that njs uses the same RegExp library as nginx.
Core:
-
Bugfix: fixed
decodeURI()anddecodeURIComponent()with invalid byte strings. The bug was introduced in 0.4.3. -
Bugfix: fixed heap-use-after-free in
awaitframe. The bug was introduced in 0.7.0. -
Bugfix: fixed WebCrypto
sign()andverify()methods with OpenSSL 3.0. -
Bugfix: fixed exception throwing when RegExp match fails. The bug was introduced in 0.1.15.
-
Bugfix: fixed catching of exception thrown in
tryblock ofasyncfunction. The bug was introduced in 0.7.0. -
Bugfix: fixed execution of
asyncfunction in synchronous context. The bug was introduced in 0.7.0. -
Bugfix: fixed function redeclaration in CLI when interactive mode is on. The bug was introduced in 0.6.2.
-
Bugfix: fixed
typeofoperator withDataViewobject. -
Bugfix: eliminated information leak in
Buffer.from().
Changes with njs 0.7.0
Release Date: 19 October 2021
nginx modules:
Core:
-
Feature: introduced
Async/Awaitimplementation. -
Feature: added WebCrypto API implementation.
-
Bugfix: fixed copying of closures for declared functions. The bug was introduced in 0.6.0.
-
Bugfix: fixed unhandled
promiserejection in handle events. -
Bugfix: fixed Response.headers getter in Fetch API.
Changes with njs 0.6.2
Release Date: 31 August 2021
nginx modules:
-
Bugfix: fixed CPU hog when
js_filteris registered in both directions.
Core:
-
Feature: introduced
AggregateErrorimplementation. -
Feature: added remaining
Promiseconstructor methods. The following methods were added:Promise.all(),Promise.allSettled(),Promise.any(),Promise.race(). -
Improvement: removed recursion from code generator.
-
Bugfix: fixed rest parameter parsing without binding identifier.
-
Bugfix: fixed resolve/reject callback for
Promise.prototype.finally(). -
Bugfix: fixed
%TypedArray%.prototype.join()with detached buffer. -
Bugfix: fixed memory leak in interactive shell.
Changes with njs 0.6.1
Release Date: 29 June 2021
-
Bugfix: fixed
RegExpBuiltinExec()with UTF-8 only regexps. The bug was introduced in 0.4.2. -
Bugfix: fixed parsing of export default declaration with non-assignment expressions. Thanks to Artem S. Povalyukhin.
Changes with njs 0.6.0
Release Date: 15 June 2021
Core:
-
Feature: added
letandconstdeclaration support. -
Feature: added
RegExp.prototype[Symbol.split]. -
Feature: added sticky flag support for RegExp.
-
Bugfix: fixed heap-buffer-overflow in
String.prototype.lastIndexOf(). -
Bugfix: fixed
RegExp.prototype.test()according to the specification. -
Bugfix: fixed
String.prototype.split()according to the specification. -
Bugfix: fixed use-of-uninitialized-value while tracking rejected promises.
-
Bugfix: fixed
njs.dump()for objects with circular references.
Changes with njs 0.5.3
Release Date: 30 March 2021
nginx modules:
Changes with njs 0.5.2
Release Date: 09 March 2021
nginx modules:
-
Feature: added the
js_body_filterdirective. -
Feature: introduced the
s.statusproperty for Stream Session object.
Core:
-
Feature: added
njs.on(exit) callback support. -
Bugfix: fixed property descriptor reuse for not extensible objects. Thanks to Artem S. Povalyukhin.
-
Bugfix: fixed
Object.freeze()and friends according to the specification. Thanks to Artem S. Povalyukhin. -
Bugfix: fixed
Function()in CLI mode. -
Bugfix: fixed
for-initeration of typed array values. Thanks to Artem S. Povalyukhin.
Changes with njs 0.5.1
Release Date: 16 February 2021
nginx modules:
-
Feature: introduced
ngx.fetch()method implementing Fetch API.The following properties and methods of
Responseobject are implemented:arrayBuffer(),bodyUsed,json(),headers,ok,redirect,status,statusText,text(),type,url.Notable limitations: only the
http://scheme is supported, redirects are not handled.In collaboration with 洪志道 (Hong Zhi Dao).
-
Feature: added the
js_header_filterdirective. -
Bugfix: fixed processing buffered data in body filter in stream module.
Core:
-
Bugfix: fixed safe mode bypass in
Functionconstructor. -
Bugfix: fixed
Date.prototype.toISOString()with invalid date values.
Changes with njs 0.5.0
Release Date: 01 December 2020
nginx modules:
-
Feature: introduced global
ngxobject.The following methods were added:
The following properties were added:
-
ngx.INFO,ngx.WARN,ngx.ERR.
-
-
Feature: added support for
Bufferobject where string is expected. -
Feature: added Buffer version of existing properties.
The following properties were added:
-
r.requestBuffer(r.requestBody),r.responseBuffer(r.responseBody),r.rawVariables(r.variables),s.rawVariables(s.variables).
The following events were added in the stream module:
-
upstream(upload),downstream(download).
-
-
Improvement: added aliases to existing properties.
The following properties were added:
-
Improvement: throwing an exception in
r.internalRedirect()for a subrequest. -
Bugfix: fixed promise
r.subrequest()witherror_pageredirect. -
Bugfix: fixed
promiseevents handling.
Core:
-
Feature: added
TypeScriptdefinitions for built-in modules. Thanks to Jakub Jirutka. -
Feature: tracking unhandled
promiserejection. -
Feature: added initial iterator support. Thanks to Artem S. Povalyukhin.
-
Improvement:
TypeScriptdefinitions are refactored. Thanks to Jakub Jirutka. -
Improvement: added forgotten support for
Object.prototype.valueOf()inBuffer.from(). -
Bugfix: fixed heap-use-after-free in
JSON.parse(). -
Bugfix: fixed heap-use-after-free in
JSON.stringify(). -
Bugfix: fixed
JSON.stringify()for arrays resizable via getters. -
Bugfix: fixed heap-buffer-overflow for
RegExp.prototype[Symbol.replace]. -
Bugfix: fixed returned value for
Buffer.prototype.write*functions. -
Bugfix: fixed
querystring.stringify(). Thanks to Artem S. Povalyukhin. -
Bugfix: fixed the catch handler for
Promise.prototype.finally(). -
Bugfix: fixed
querystring.parse().
Changes with njs 0.4.4
Release Date: 29 September 2020
nginx modules:
-
Bugfix: fixed location merge.
-
Bugfix: fixed
r.httpVersionfor HTTP/2.
Core:
-
Feature: added support for numeric separators (ES12).
-
Feature: added remaining methods for
%TypedArray%.prototype. The following methods were added:every(),filter(),find(),findIndex(),forEach(),includes(),indexOf(),lastIndexOf(),map(),reduce(),reduceRight(),reverse(),some(). -
Feature: added
%TypedArray%remaining methods. The following methods were added:from(),of(). -
Feature: added
DataViewobject. -
Feature: added
Bufferobject implementation. -
Feature: added support for
ArrayBufferinTextDecoder.prototype.decode() -
Feature: added support for
Bufferobject incryptomethods. -
Feature: added support for
Bufferobject infsmethods. -
Change:
Hash.prototype.digest()andHmac.prototype.digest()now return aBufferinstance instead of a byte string when encoding is not provided. -
Change:
fs.readFile()and friends now return aBufferinstance instead of a byte string when encoding is not provided. -
Bugfix: fixed function
prototypeproperty handler while setting. -
Bugfix: fixed function
constructorproperty handler while setting. -
Bugfix: fixed
String.prototype.indexOf()for byte strings. -
Bugfix: fixed
RegExpBuiltinExec()with a global flag and byte strings. -
Bugfix: fixed
RegExp.prototype[Symbol.replace]the when replacement value is a function. -
Bugfix: fixed
TextDecoder.prototype.decode()with non-zeroTypedArrayoffset.
Changes with njs 0.4.3
Release Date: 11 August 2020
Core:
-
Feature: added
Query Stringmodule. -
Feature: improved
fs.mkdir()to support recursive directory creation. Thanks to Artem S. Povalyukhin. -
Feature: improved
fs.rmdir()to support recursive directory removal. Thanks to Artem S. Povalyukhin. -
Feature: introduced UTF-8 decoder according to WHATWG encoding spec.
-
Feature: added
TextDecoder()andTextEncoder()implementation. -
Bugfix: fixed parsing return statement without semicolon.
-
Bugfix: fixed
njs_number_to_int32()for big-endian platforms. -
Bugfix: fixed unit test on big-endian platforms.
-
Bugfix: fixed regexp-literals parsing with "
=" characters. -
Bugfix: fixed pre/post increment/decrement in assignment operations.
Changes with njs 0.4.2
Release Date: 07 July 2020
Core:
-
Feature: added
RegExp.prototype[Symbol.replace]. -
Feature: introduced line level backtrace.
-
Feature: added
%TypedArray%.prototype.sort(). -
Feature: extended
fsmodule. Addedmkdir(),readdir(),rmdir(), and friends. -
Improvement: parser refactoring.
-
Bugfix: fixed TypedScript API description for HTTP headers.
-
Bugfix: fixed TypedScript API description for
NjsByteStringtype. -
Bugfix: fixed
String.prototype.repeat()according to the specification. -
Bugfix: fixed
String.prototype.replace()according to the specification. -
Bugfix: fixed parsing of flags for regexp literals.
-
Bugfix: fixed index generation for global objects in generator.
-
Bugfix: fixed
%TypedArray%.prototype.copyWithin()with nonzero byte offset. -
Bugfix: fixed
Array.prototype.splice()for sparse arrays. -
Bugfix: fixed
Array.prototype.reverse()for sparse arrays. -
Bugfix: fixed
Array.prototype.sort()for sparse arrays.
Changes with njs 0.4.1
Release Date: 19 May 2020
nginx modules:
-
Feature: added support for multi-value headers in
r.headersIn{}. -
Feature: introduced
raw headersAPI:r.rawHeadersIn[]andr.rawHeadersOut[]. -
Feature: added TypeScript API description.
Core:
-
Bugfix: fixed
Array.prototype.slice()for sparse arrays.
Changes with njs 0.4.0
Release Date: 23 April 2020
nginx modules:
-
Feature: added support for multi-value headers in
r.headersOut{}. -
Improvement: improved iteration over
r.headersOut{}with special headers. -
Improvement: improved iteration over
r.headersOut{}with duplicates. -
Change:
r.responseBodyproperty handler now returnsundefinedinstead of throwing an exception if the response body is not available.
Core:
-
Feature: added script arguments support in CLI.
-
Feature: converting externals values to native js objects.
-
Bugfix: fixed NULL-pointer dereference in
__proto__property handler. -
Bugfix: fixed handling of no-newline at the end of the script.
-
Bugfix: fixed
RegExp()constructor with empty pattern and non-empty flags. -
Bugfix: fixed
String.prototype.replace()when function returns non-string. -
Bugfix: fixed reading of pseudofiles in
fs.
Changes with njs 0.3.9
Release Date: 03 March 2020
nginx modules:
-
Feature: added detached mode for
r.subrequest(). Responses to detached subrequests are ignored. Unlike ordinary subrequests, a detached subrequest can be created inside a variable handler.
Core:
-
Feature: added
promisesAPI forfsmodule. Thanks to Artem S. Povalyukhin. -
Feature: extended
fsmodule. Addedaccess(),symlink(),unlink(),realpath(), and friends. Thanks to Artem S. Povalyukhin. -
Improvement: introduced memory-efficient ordinary arrays.
-
Improvement: lexer refactoring.
-
Bugfix: fixed matching of native functions in backtraces.
-
Bugfix: fixed callback invocations in
fsmodule. Thanks to Artem S. Povalyukhin. -
Bugfix: fixed
Object.getOwnPropertySymbols(). -
Bugfix: fixed heap-buffer-overflow in
njs_json_append_string(). -
Bugfix: fixed
encodeURI()anddecodeURI()according to the specification. -
Bugfix: fixed
Number.prototype.toPrecision(). -
Bugfix: fixed handling of space argument in
JSON.stringify(). -
Bugfix: fixed
JSON.stringify()withNumber()andString()objects. -
Bugfix: fixed Unicode Escaping in
JSON.stringify()according to specification. -
Bugfix: fixed non-native module importing. Thanks to 洪志道 (Hong Zhi Dao).
-
Bugfix: fixed
njs.dump()with theDate()instance in a container.
Changes with njs 0.3.8
Release Date: 21 January 2020
nginx modules:
-
Feature: added
Promisesupport forr.subrequest(). If a callback is not provided,r.subrequest()returns an ordinaryPromiseobject that resolves to a subrequest response object. -
Change:
r.parentproperty handler now returnsundefinedinstead of throwing an exception if a parent object is not available.
Core:
-
Feature: added
Promisesupport. Implemented according to the specification without:Promise.all(),Promise.allSettled(),Promise.race(). -
Feature: added initial Typed-arrays support. Thanks to Tiago Natel de Moura.
-
Feature: added
ArrayBuffersupport. Thanks to Tiago Natel de Moura. -
Feature: added initial
Symbolsupport. Thanks to Artem S. Povalyukhin. -
Feature: added externals support for
JSON.stringify(). -
Feature: added
Object.is(). Thanks to Artem S. Povalyukhin. -
Feature: added
Object.setPrototypeOf(). Thanks to Artem S. Povalyukhin. -
Feature: introduced nullish coalescing operator.
-
Bugfix: fixed
Object.getPrototypeOf()according to the specification. -
Bugfix: fixed
Object.prototype.valueOf()according to the specification. -
Bugfix: fixed
JSON.stringify()with unprintable values and replacer function. -
Bugfix: fixed operator
inaccording to the specification. -
Bugfix: fixed
Object.defineProperties()according to the specification. -
Bugfix: fixed
Object.create()according to the specification. Thanks to Artem S. Povalyukhin. -
Bugfix: fixed
Number.prototype.toString(radix)when fast-math is enabled. -
Bugfix: fixed
RegExp()instance properties. -
Bugfix: fixed import segfault. Thanks to 洪志道 (Hong Zhi Dao).
Changes with njs 0.3.7
Release Date: 19 November 2019
nginx modules:
-
Improvement: refactored iteration over external objects.
Core:
-
Feature: added
Object.assign(). -
Feature: added
Array.prototype.copyWithin(). -
Feature: added support for labels in
console.time(). -
Change: removed
console.help()from CLI. -
Improvement: moved constructors and top-level objects to global object.
-
Improvement: arguments validation for configure script.
-
Improvement: refactored JSON methods.
-
Bugfix: fixed heap-buffer-overflow in
njs_array_reverse_iterator()function. The following functions were affected:Array.prototype.lastIndexOf(),Array.prototype.reduceRight(). -
Bugfix: fixed
[[Prototype]]slot ofNativeErrors. -
Bugfix: fixed
NativeError.prototype.messageproperties. -
Bugfix: added conversion of
thisvalue to object inArray.prototype functions. -
Bugfix: fixed iterator for
Array.prototype.find()andArray.prototype.findIndex()functions. -
Bugfix: fixed
Array.prototype.includes()andArray.prototype.join()withundefinedargument. -
Bugfix: fixed
constructorproperty ofHashandHmacobjects. -
Bugfix: fixed
__proto__property of getters and setters. -
Bugfix: fixed
Dateobject string formatting. -
Bugfix: fixed handling of
NaNand-0arguments inMath.min()andMath.max(). -
Bugfix: fixed
Math.round()according to the specification. -
Bugfix: reimplemented
boundfunctions according to the specification.
Changes with njs 0.3.6
Release Date: 22 October 2019
nginx modules:
-
Improvement: getting special headers from
r.headersIn{}.
Core:
-
Feature: added new
Function()support. -
Feature: added
Number.prototype.toFixed(). -
Feature: added
Number.prototype.toPrecision(). -
Feature: added
Number.prototype.toExponential(). -
Improvement: making
prototypeproperty of function instances writable. -
Improvement: limiting recursion depth while compiling.
-
Improvement: moving global functions to the global object.
-
Bugfix: fixed prototype mutation for object literals.
-
Bugfix: fixed heap-buffer-overflow while parsing regexp literals.
-
Bugfix: fixed integer-overflow while parsing exponent of number literals.
-
Bugfix: fixed
parseFloat(). -
Bugfix: fixed
Array.prototypefunctions according to the specification. The following functions were fixed:every,includes,indexOf,filter,find,findIndex,forEach,lastIndexOf,map,pop,push,reduce,reduceRight,shift,some,unshift. -
Bugfix: fixed handing of accessor descriptors in
Object.freeze(). -
Bugfix: fixed
String.prototype.replace()when first argument is not a string. -
Bugfix: fixed stack-use-after-scope in
Array.prototype.map(). -
Bugfix:
Date.prototype.toUTCString()format was aligned to ES9. -
Bugfix: fixed buffer overflow in
Number.prototype.toString(radix). -
Bugfix: fixed
Regexp.prototype.test()for regexps with backreferences. -
Bugfix: fixed
Array.prototype.map()for objects with nonexistent values. -
Bugfix: fixed
Array.prototype.pop()andshift()for sparse objects. -
Bugfix: fixed
Date.UTC()according to the specification. -
Bugfix: fixed
Date()constructor according to the specification. -
Bugfix: fixed type of
Date.prototype. Thanks to Artem S. Povalyukhin. -
Bugfix: fixed
Date.prototype.setTime(). Thanks to Artem S. Povalyukhin. -
Bugfix: fixed default number of arguments expected by built-in functions.
-
Bugfix: fixed
callerandargumentsproperties of a function instance. Thanks to Artem S. Povalyukhin.
Changes with njs 0.3.5
Release Date: 15 August 2019
Core:
-
Bugfix: fixed module importing using
require(). The bug was introduced in 0.3.4. -
Bugfix: fixed
[[SetPrototypeOf]].
Changes with njs 0.3.4
Release Date: 13 August 2019
Core:
-
Feature: added
Objectshorthand methods and computed property names. Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin. -
Feature: added getter/setter literal support. Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin.
-
Feature: added
fs.renameSync(). -
Feature: added
String.prototype.trimEnd()andString.prototype.trimStart(). -
Improvement: added memory-sanitizer support.
-
Improvement: Unicode case tables updated to version 12.1.
-
Improvement: added UTF8 validation for string literals.
-
Bugfix: fixed reading files with zero size in
fs.readFileSync(). -
Bugfix: extended the list of space separators in
String.prototype.trim(). -
Bugfix: fixed using of uninitialized value in
String.prototype.padStart(). -
Bugfix: fixed
String.prototype.replace()for0ドルand$&replacement string. -
Bugfix: fixed
String.prototype.replace()for byte strings with regex argument. -
Bugfix: fixed global match in
String.prototype.replace()with regexp argument. -
Bugfix: fixed
Array.prototype.slice()for primitive types. -
Bugfix: fixed heap-buffer-overflow while importing module.
-
Bugfix: fixed UTF-8 character escaping.
-
Bugfix: fixed
Object.values()andObject.entries()for shared objects. -
Bugfix: fixed uninitialized memory access in
String.prototype.match(). -
Bugfix: fixed
String.prototype.match()for byte strings with regex argument. -
Bugfix: fixed
Array.prototype.lastIndexOf()with undefined arguments. -
Bugfix: fixed
String.prototype.substring()with empty substring. -
Bugfix: fixed invalid memory access in
String.prototype.substring(). -
Bugfix: fixed
String.fromCharCode()for code points more than65535andNaN. -
Bugfix: fixed
String.prototype.toLowerCase()andString.prototype.toUpperCase(). -
Bugfix: fixed
Error()constructor with no arguments. -
Bugfix: fixed
inoperator for values with accessor descriptors. -
Bugfix: fixed
Object.defineProperty()for non-boolean descriptor props. -
Bugfix: fixed
Error.prototype.toString()with UTF8 string properties. -
Bugfix: fixed
Error.prototype.toString()with non-string values fornameandmessage.
Changes with njs 0.3.3
Release Date: 25 June 2019
nginx modules:
-
Improvement: getting of special response headers in
r.headersOut{}. -
Improvement: working with unknown methods in
r.subrequest(). -
Improvement: added support for null as a second argument of
r.subrequest(). -
Bugfix: fixed processing empty output chain in stream body filter.
Core:
-
Feature: added runtime support for property getter/setter. Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin.
-
Feature: added
processglobal object. -
Feature: writable most of built-in properties and methods.
-
Feature: added generic implementation of
Array.prototype.fill(). -
Bugfix: fixed integer-overflow in
String.prototype.concat(). -
Bugfix: fixed setting of object properties.
-
Bugfix: fixed
Array.prototype.toString(). -
Bugfix: fixed
Date.prototype.toJSON(). -
Bugfix: fixed overwriting "constructor" property of built-in prototypes.
-
Bugfix: fixed processing of invalid surrogate pairs in strings.
-
Bugfix: fixed processing of invalid surrogate pairs in JSON strings.
-
Bugfix: fixed heap-buffer-overflow in
toUpperCase()andtoLowerCase(). -
Bugfix: fixed escaping lone closing square brackets in
RegExp()constructor. -
Bugfix: fixed handling zero byte characters inside RegExp pattern strings.
-
Bugfix: fixed
String.prototype.toBytes()for ASCII strings. -
Bugfix: fixed truth value of JSON numbers in
JSON.parse(). -
Bugfix: fixed use-of-uninitialized-value in
njs_string_replace_join(). -
Bugfix: fixed
parseInt('-0'). Thanks to Artem S. Povalyukhin.
Changes with njs 0.3.2
Release Date: 21 May 2019
Core:
-
Feature: added support for template literals. Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin.
-
Feature: executing command from command line arguments.
-
Feature: added support for RegExp
groupsobject (ES9). -
Feature: added block scoped function definitions support.
-
Feature: added support for building with GNU Readline library.
-
Feature: made configurable
length,name, and most of built-in methods. -
Feature: made all constructor properties configurable.
-
Bugfix: fixed
Regexp.prototype.exec()for Unicode-only regexps. -
Bugfix: fixed
njs_vm_value_dump()for empty string values. -
Bugfix: fixed RegExp constructor for regexp value arguments.
-
Bugfix: fixed walking over prototypes chain during iteration over an object.
-
Bugfix: fixed overflow in
Array.prototype.concat(). -
Bugfix: fixed length calculation for UTF-8 string with escape characters.
-
Bugfix: fixed parsing surrogate pair presents as UTF-16 escape sequences.
-
Bugfix: fixed processing the "*" quantifier for
String.prototype.match(). -
Bugfix: fixed
Date()constructor with one argument. -
Bugfix: fixed arrays expansion.
-
Bugfix: fixed heap-buffer-overflow in
String.prototype.replace(). -
Bugfix: fixed heap-buffer-overflow in
String.prototype.lastIndexOf(). -
Bugfix: fixed regexp literals parsing with escaped backslash and backslash in square brackets.
-
Bugfix: fixed regexp literals with lone closing brackets.
-
Bugfix: fixed uninitialized-memory-access in
Object.defineProperties(). -
Bugfix: fixed processing the "*" quantifier for
String.prototype.replace(). -
Bugfix: fixed
Array.prototype.slice()for UTF8-invalid byte strings. -
Bugfix: fixed
String.prototype.split()for UTF8-invalid byte strings. -
Bugfix: fixed handling of empty block statements.
Changes with njs 0.3.1
Release Date: 16 April 2019
Core:
-
Feature: added arrow functions support. Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin.
-
Feature: added
Object.getOwnPropertyNames(). Thanks to Artem S. Povalyukhin. -
Feature: added
Object.getOwnPropertyDescriptors(). Thanks to Artem S. Povalyukhin. -
Feature: making
__proto__accessor descriptor ofObjectinstances mutable. -
Feature: added shebang support in CLI.
-
Feature: added support for module mode execution in CLI. In module mode global, this is unavailable.
-
Bugfix: fixed editline detection.
-
Bugfix: fixed
Function.prototype.bind(). Thanks to 洪志道 (Hong Zhi Dao). -
Bugfix: fixed checking of duplication of parameters for functions. Thanks to 洪志道 (Hong Zhi Dao).
-
Bugfix: fixed function declaration with the same name as a variable. Thanks to 洪志道 (Hong Zhi Dao).
-
Improvement: code related to parsing of objects, variables and functions is refactored. Thanks to 洪志道 (Hong Zhi Dao).
-
Improvement: large-value output improved in
console.log(). -
Improvement: string output improved in
console.log()in a compliant way (without escaping and quotes). -
Improvement: using ES6 version of
ToInt32(),ToUint32(),ToLength().
Changes with njs 0.3.0
Release Date: 26 March 2019
nginx modules:
-
Change: returning undefined value instead of empty strings for absent properties in the following objects:
r.args{},r.headersIn{},r.headersOut{},r.variables{},s.variables{}. -
Change: returning undefined value instead of throwing an exception for
r.requestBodywhen request body is unavailable. -
Bugfix: fixed crash while iterating over
r.args{}when a value is absent in a key-value pair.
Core:
-
Feature: added initial ES6 modules support. Default import and default export statements are supported. Thanks to 洪志道 (Hong Zhi Dao).
-
Feature: added
Object.prototype.propertyIsEnumerable(). -
Feature: reporting file name and function name in disassembler output.
-
Bugfix: fixed function redeclarations in interactive shell. Thanks to 洪志道 (Hong Zhi Dao).
-
Bugfix: fixed RegExp literals parsing.
-
Bugfix: fixed setting length of UTF8 string in
fs.readFileSync(). -
Bugfix: fixed
nxt_file_dirname()for paths with no dir component.
Changes with njs 0.2.8
Release Date: 26 February 2019
nginx modules:
-
Change: properties of HTTP request deprecated in 0.2.2 are removed.
-
Feature: added support for delete operation in
r.headersOut{}. -
Feature: added support for setting nginx variables.
-
Bugfix: fixed
r.subrequest()for empty body value. -
Improvement: setting special response headers in
r.headersOut{}.
Core:
-
Feature: added labels support.
-
Feature: added
setImmediate()method. -
Feature: added support for shorthand property names for Object literals.
-
Bugfix: fixed
Function.prototype.bind(). -
Bugfix: fixed parsing of string literals containing newline characters.
-
Bugfix: fixed line number in reporting variable reference errors.
-
Bugfix: fixed creation of long UTF8 strings.
-
Bugfix: fixed setting special response headers in
String.prototype.split()for Unicode strings. -
Bugfix: fixed heap-buffer-overflow in
String.prototype.split(). -
Bugfix: fixed
Array.prototype.fill(). Thanks to Artem S. Povalyukhin. -
Improvement: code related to function invocation is refactored. Thanks to 洪志道 (Hong Zhi Dao).
-
Improvement: code related to variables is refactored. Thanks to 洪志道 (Hong Zhi Dao).
-
Improvement: parser is refactored. Thanks to 洪志道 (Hong Zhi Dao).
-
Improvement: reporting filenames in exceptions.
Changes with njs 0.2.7
Release Date: 25 December 2018
Core:
-
Feature: rest parameters syntax (destructuring is not supported). Thanks to Alexander Pyshchev.
-
Feature: added
Object.entries()method. -
Feature: added
Object.values()method. -
Improvement: code generator refactored and simplified.
-
Bugfix: fixed automatic semicolon insertion.
-
Bugfix: fixed assignment expression from compound assignment.
-
Bugfix: fixed comparison of Byte and UTF8 strings.
-
Bugfix: fixed type of iteration variable in
for-inwith array values. -
Bugfix: fixed building on platforms without librt.
-
Bugfix: miscellaneous bugs have been fixed.
Changes with njs 0.2.6
Release Date: 27 November 2018
Core:
-
Feature: making built-in prototypes mutable.
-
Feature: making global object mutable.
-
Feature:
console.time()andconsole.timeEnd()methods. -
Feature: allowing variables and functions to be redeclared.
-
Feature: extending
Object.defineProperty()spec conformance. -
Feature: introduced quiet mode for CLI to handle simple expressions from stdin.
-
Feature: introduced compact form of backtraces to handle stack overflows.
-
Improvement: improved wording for various exceptions.
-
Bugfix: fixed closure values handling.
-
Bugfix: fixed equality operator for various value types.
-
Bugfix: fixed handling of
thiskeyword in various scopes. -
Bugfix: fixed handling non-object values in
Object.keys(). -
Bugfix: fixed parsing of throw statement inside
ifstatement. -
Bugfix: fixed parsing of newline after throw statement.
-
Bugfix: fixed parsing of statements in if statement without newline.
-
Bugfix: fixed size
uint32_toverflow innjs_array_expand(). -
Bugfix: fixed
typeofoperator forobject_valuetype. -
Bugfix: miscellaneous bugs have been fixed.
Changes with njs 0.2.5
Release Date: 30 October 2018
nginx modules:
-
Bugfix: fixed counting pending events in stream module.
-
Bugfix: fixed
s.off()in stream module. -
Bugfix: fixed processing of data chunks in
js_filterin stream module. -
Bugfix: fixed http
statusandcontentTypegetter in http module. -
Bugfix: fixed http response and parent getters in http module.
Core:
-
Feature: arguments object support.
-
Feature: non-integer fractions support.
-
Improvement: handling non-array values in
Array.prototype.slice(). -
Bugfix: fixed
Array.prototype.lengthsetter -
Bugfix: fixed
njs_array_alloc()for length > 2**31. -
Bugfix: handling int overflow in
njs_array_alloc()on 32bit archs. -
Bugfix: fixed code size mismatch error message.
-
Bugfix: fixed delete operator in a loop.
-
Bugfix: fixed
Object.getOwnPropertyDescriptor()for complex object (inherited fromArrayandstringvalues). -
Bugfix: fixed
Object.prototype.hasOwnProperty()for non-object properties -
Bugfix: miscellaneous bugs have been fixed.
Changes with njs 0.2.4
Release Date: 18 September 2018
nginx modules:
-
Change: stream module handlers refactored.
New methods and properties:
s.on(),s.off(),s.allow(),s.done(),s.decline(),s.deny().Removed properties of the Stream object:
s.OK,s.ABORT,s.AGAIN,s.DECLINED,s.ERROR(replaced withs.allow(),s.done(),s.deny()).s.buffer(for reading replaced with data argument of the corresponding callback, for writing uses.send()).s.fromUpstream(replaced with a callback for a corresponding event).s.eof(replaced withflags.last).
Core:
-
Feature: added
Function.prototype.length. -
Feature: introduced sandboxing mode.
-
Improvement: added exception strings where appropriate.
-
Improvement: improved wording for primitive type conversion exception.
-
Bugfix: throwing
TypeErrorfor attempts to change frozen properties. -
Bugfix: fixed
Object.defineProperty()for existing properties. -
Bugfix: respecting the enumerable attribute while iterating by for in.
-
Bugfix: respecting writable attribute for property handlers.
-
Bugfix: fixed exception handling in arguments of a function.
-
Bugfix: fixed
Object.prototype.toStringfor different value types. -
Bugfix: fixed
Object()constructor for object types arguments. -
Bugfix: fixed comparison of objects and strings.
-
Bugfix: fixed
String.slice()for undefined arguments. -
Bugfix: miscellaneous bugs have been fixed.
Changes with njs 0.2.3
Release Date: 31 July 2018
nginx modules:
-
Bugfix: making a subrequest from a
Replyobject caused a segmentation fault. -
Bugfix: getting the parent property of the main HTTP Request object caused a segmentation fault.
Core:
-
Feature: added the pretty string representation for values.
-
Feature: correctly printing floating point numbers.
-
Feature: correctly parsing floating point numbers.
-
Feature:
String.bytesFrom()method (decodinghex,base64,base64urlinto a byte string). -
Feature:
String.padStart()andString.padEnd()methods. -
Feature: added support of binary literals.
-
Improvement: added information about illegal token in number parsing.
-
Improvement: allowed uppercased
Oin octal literal values. -
Improvement: added support for multiple arguments in
console.log(). -
Bugfix: fixed applying
call()to methods of external values. -
Bugfix: fixed addition operator applied to an object.
-
Bugfix: fixed exception handling in
njs_vm_value_to_ext_string(). -
Bugfix: fixed
Number()with boolean, null and undefined arguments. -
Bugfix: fixed error handling of setting non-numeric
Array.length. -
Bugfix: fixed autocompletion for global objects.
-
Bugfix: miscellaneous bugs have been fixed.
Changes with njs 0.2.2
Release Date: 19 June 2018
nginx modules:
-
Change: merged HTTP
ResponseandReplyinto HTTP Request. New members ofRequest:-
req.status(res.status) -
req.parent(reply.parent) -
req.requestBody(req.body) -
req.responseBody(reply.body) -
req.headersIn(req.headers) -
req.headersOut(res.headers) -
req.sendHeader()(res.sendHeader()) -
req.send()(res.send()) -
req.finish()(res.finish()) -
req.return()(res.return())
Deprecated members of
Request:-
req.body(usereq.requestBodyorreq.responseBody) -
req.headers(usereq.headersInorreq.headersOut) -
req.response
Deprecated members of
Response:-
res.contentLength(usereq.headersOut['Content-Length']) -
res.contentType(usereq.headersOut['Content-Type'])
The deprecated properties will be removed in next releases.
-
-
Feature: HTTP internalRedirect() method.
Core:
-
Bugfix: fixed heap-buffer-overflow in
crypto.createHmac().
Changes with njs 0.2.1
Release Date: 31 May 2018
nginx modules:
-
Feature: HTTP request body getter.
-
Improvement: moved njs vm to the
mainconfiguration. -
Improvement: improved logging for js_set and js_content directives.
-
Improvement: setting status code to 500 by default in the js_content handler
-
Improvement: added the debug for the returned status code in js_content handler
-
Bugfix: fixed error logging in js_include.
Core:
-
Feature: added array length setter.
-
Improvement: public header
cleanup. njscript.his renamed tonjs.h. -
Bugfix: fixed crypto
update()method afterdigest()is called. -
Bugfix: fixed
crypto.createHmac()for keys with size <= alg size and > 64. -
Bugfix: fixed
JSON.stringify()for arrays with empty cells. -
Bugfix: fixed exception type for unsupported types in
JSON.stringify(). -
Bugfix: fixed handling of undefined arguments of functions.
-
Bugfix: fixed handling of missing
argofObject.getOwnPropertyDescriptor(). -
Bugfix: fixed handling of properties in
Object.getOwnPropertyDescriptor(). -
Bugfix: fixed the writeable flag of
Array.lengthproperty. -
Bugfix: fixed return value type of
clearTimeout(). -
Bugfix: fixed
njs_vm_external_bind(). -
Bugfix: miscellaneous bugs have been fixed.
Changes with njs 0.2.0
Release Date: 03 April 2018
-
Feature: reporting njs version by CLI.
-
Feature: textual description for type converting exceptions.
-
Feature:
setTimeout()andclearTimeout()methods. -
Feature: Byte string to
hex,base64,base64urlencodings. -
Feature: Node.js style
Cryptomethods. -
Feature: HTTP and stream
warn()anderror()methods. -
Feature: HTTP
subrequest()method. -
Feature: HTTP
return()method. -
Bugfix: miscellaneous bugs have been fixed in the core and interactive shell.
Changes with njs 0.1.15
Release Date: 20 November 2017
-
Feature:
Error,EvalError,InternalError,RangeError,ReferenceError,SyntaxError,TypeError,URIErrorobjects. -
Feature: octal literals support.
-
Feature: Node.js style
File systemaccess methods:fs.readFile(),fs.readFileSync(),fs.appendFile(),fs.appendFileSync(),fs.writeFile(),fs.writeFileSync(). -
Feature: nginx modules print backtrace on exception.
-
Bugfix: miscellaneous bugs have been fixed.
Changes with njs 0.1.14
Release Date: 09 October 2017
-
Feature: JSON object.
-
Feature: object level completions in interactive shell.
-
Feature: various configure improvements.
-
Bugfix: miscellaneous bugs have been fixed in the core and interactive shell.
Changes with njs 0.1.13
Release Date: 31 August 2017
-
Feature:
console.log()andconsole.help()methods in interactive shell. -
Feature: interactive shell prints backtrace on exception.
-
Feature: interactive shell by default if
libeditis available. -
Bugfix: processing of large files from
stdinin command line mode. -
Bugfix: improved
editlinedetection.
Changes with njs 0.1.12
Release Date: 08 August 2017
-
Feature: Interactive shell.
-
Bugfix: in
Object.isSealed().
Changes with njs 0.1.11
Release Date: 27 June 2017
-
Feature:
Object.keys(),Object.prototype.hasOwnProperty()methods. -
Feature:
Object.defineProperty(),Object.defineProperties(),Object.getOwnPropertyDescriptor()methods. -
Feature:
Object.getPrototypeOf(),Object.prototype.isPrototypeOf()methods. -
Feature:
Object.preventExtensions(),Object.isExtensible(),Object.freeze(),Object.isFrozen(),Object.seal(),Object.isSealed()methods. -
Feature: scientific notation (
3.35e10) literals support. -
Feature: hexadecimal (
0x1123) literals support. -
Bugfix: processing of large array indexes.
-
Bugfix: in
parseInt()andDate.parse().
Changes with njs 0.1.10
Release Date: 04 April 2017
-
Feature: nested functions and function closures.
-
Feature:
Array.of(),Array.prototype.fill(),Array.prototype.find(),Array.prototype.findIndex()methods. -
Bugfix: miscellaneous bugs and segmentation faults have been fixed.
Changes with njs 0.1.9
Release Date: 01 February 2017
-
Bugfix: global variables were not initialized when njs was used in nginx.
Changes with njs 0.1.8
Release Date: 24 January 2017
-
Change: the
strictmode is enforced, variables must be explicitly declared. -
Feature:
forandfor-inloops support variable declaration. -
Bugfix: global and function scopes have been fixed.
-
Bugfix: now
for-inloop does not discard the last value of property variable. -
Bugfix: miscellaneous bugs and segmentation faults have been fixed.
Changes with njs 0.1.7
Release Date: 27 December 2016
-
Change: the js_include directive has been disabled at server and location levels.
-
Feature: exponentiation operators.
-
Bugfix: miscellaneous bugs and segmentation faults have been fixed.
Changes with njs 0.1.6
Release Date: 13 December 2016
-
Change: the js_set directive has been disabled at server and location levels.
-
Feature: ES6
Mathmethods. -
Bugfix: miscellaneous bugs and segmentation faults have been fixed.