Mercurial > hg > nginx-site
view xml/en/docs/njs/changes.xml @ 2410:392e11db3260
Development guide: added the "Common Pitfalls" section.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Tue, 23 Jul 2019 19:07:55 +0300 |
parents | dbf68c949522 |
children | 3b7223f9aac8 |
line wrap: on
line source
<?xml version="1.0"?> <!-- Copyright (C) Nginx, Inc. --> <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> <article name="Changes" link="/en/docs/njs/changes.html" lang="en" rev="21" toc="no"> <section id="njs0.3.3" name="Changes with 0.3.3"> <para> Release Date: 25 June 2019 </para> <para> nginx modules: <list type="bullet"> <listitem> <para> Improvement: getting of special response headers in <link doc="reference.xml" id="r_headers_out"><literal>r.headersOut{}</literal></link>. </para> </listitem> <listitem> <para> Improvement: working with unknown methods in <link doc="reference.xml" id="subrequest"><literal>r.subrequest()</literal></link>. </para> </listitem> <listitem> <para> Improvement: added support for null as a second argument of <link doc="reference.xml" id="subrequest"><literal>r.subrequest()</literal></link>. </para> </listitem> <listitem> <para> Bugfix: fixed processing empty output chain in stream body filter. </para> </listitem> </list> </para> <para> Core: <list type="bullet"> <listitem> <para> Feature: added runtime support for property getter/setter. Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin. </para> </listitem> <listitem> <para> Feature: added <link doc="reference.xml" id="global_process"><literal>process</literal></link> global object. </para> </listitem> <listitem> <para> Feature: writable most of built-in properties and methods. </para> </listitem> <listitem> <para> Feature: added generic implementation of <literal>Array.prototype.fill()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed integer-overflow in <link doc="reference.xml" id="string_concat"><literal>String.prototype.concat()</literal></link>. </para> </listitem> <listitem> <para> Bugfix: fixed setting of object properties. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Array.prototype.toString()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Date.prototype.toJSON()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed overwriting “constructor” property of built-in prototypes. </para> </listitem> <listitem> <para> Bugfix: fixed processing of invalid surrogate pairs in strings. </para> </listitem> <listitem> <para> Bugfix: fixed processing of invalid surrogate pairs in JSON strings. </para> </listitem> <listitem> <para> Bugfix: fixed heap-buffer-overflow in <link doc="reference.xml" id="string_touppercase"><literal>toUpperCase()</literal></link> and <link doc="reference.xml" id="string_touppercase"><literal>toLowerCase()</literal></link>. </para> </listitem> <listitem> <para> Bugfix: fixed escaping lone closing square brackets in <literal>RegExp()</literal> constructor. </para> </listitem> <listitem> <para> Bugfix: fixed handling zero byte characters inside RegExp pattern strings. </para> </listitem> <listitem> <para> Bugfix: fixed <link doc="reference.xml" id="string_tobytes"><literal>String.prototype.toBytes()</literal></link> for ASCII strings. </para> </listitem> <listitem> <para> Bugfix: fixed truth value of JSON numbers in <link doc="reference.xml" id="core_json_parse"><literal>JSON.parse()</literal></link>. </para> </listitem> <listitem> <para> Bugfix: fixed use-of-uninitialized-value in <literal>njs_string_replace_join()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>parseInt('-0')</literal>. Thanks to Artem S. Povalyukhin. </para> </listitem> </list> </para> </section> <section id="njs0.3.2" name="Changes with 0.3.2"> <para> Release Date: 21 May 2019 </para> <para> Core: <list type="bullet"> <listitem> <para> Feature: added support for template literals. Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin. </para> </listitem> <listitem> <para> Feature: executing command from command line arguments. </para> </listitem> <listitem> <para> Feature: added support for RegExp <literal>groups</literal> object (ES9). </para> </listitem> <listitem> <para> Feature: added block scoped function definitions support. </para> </listitem> <listitem> <para> Feature: added support for building with GNU Readline library. </para> </listitem> <listitem> <para> Feature: made configurable <literal>length</literal>, <literal>name</literal>, and most of built-in methods. </para> </listitem> <listitem> <para> Feature: made all constructor properties configurable. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Regexp.prototype.exec()</literal> for Unicode-only regexps. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>njs_vm_value_dump()</literal> for empty string values. </para> </listitem> <listitem> <para> Bugfix: fixed RegExp constructor for regexp value arguments. </para> </listitem> <listitem> <para> Bugfix: fixed walking over prototypes chain during iteration over an object. </para> </listitem> <listitem> <para> Bugfix: fixed overflow in <literal>Array.prototype.concat()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed length calculation for UTF-8 string with escape characters. </para> </listitem> <listitem> <para> Bugfix: fixed parsing surrogate pair presents as UTF-16 escape sequences. </para> </listitem> <listitem> <para> Bugfix: fixed processing the “*” quantifier for <literal>String.prototype.match()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Date()</literal> constructor with one argument. </para> </listitem> <listitem> <para> Bugfix: fixed arrays expansion. </para> </listitem> <listitem> <para> Bugfix: fixed heap-buffer-overflow in <literal>String.prototype.replace()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed heap-buffer-overflow in <literal>String.prototype.lastIndexOf()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed regexp literals parsing with escaped backslash and backslash in square brackets. </para> </listitem> <listitem> <para> Bugfix: fixed regexp literals with lone closing brackets. </para> </listitem> <listitem> <para> Bugfix: fixed uninitialized-memory-access in <literal>Object.defineProperties()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed processing the “*” quantifier for <literal>String.prototype.replace()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Array.prototype.slice()</literal> for UTF8-invalid byte strings. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>String.prototype.split()</literal> for UTF8-invalid byte strings. </para> </listitem> <listitem> <para> Bugfix: fixed handling of empty block statements. </para> </listitem> </list> </para> </section> <section id="njs0.3.1" name="Changes with 0.3.1"> <para> Release Date: 16 April 2019 </para> <para> Core: <list type="bullet"> <listitem> <para> Feature: added arrow functions support. Thanks to 洪志道 (Hong Zhi Dao) and Artem S. Povalyukhin. </para> </listitem> <listitem> <para> Feature: added <literal>Object.getOwnPropertyNames()</literal>. Thanks to Artem S. Povalyukhin. </para> </listitem> <listitem> <para> Feature: added <literal>Object.getOwnPropertyDescriptors()</literal>. Thanks to Artem S. Povalyukhin. </para> </listitem> <listitem> <para> Feature: making <literal>__proto__</literal> accessor descriptor of <literal>Object</literal> instances mutable. </para> </listitem> <listitem> <para> Feature: added shebang support in CLI. </para> </listitem> <listitem> <para> Feature: added support for module mode execution in CLI. In module mode global, this is unavailable. </para> </listitem> <listitem> <para> Bugfix: fixed editline detection. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Function.prototype.bind()</literal>. Thanks to 洪志道 (Hong Zhi Dao). </para> </listitem> <listitem> <para> Bugfix: fixed checking of duplication of parameters for functions. Thanks to 洪志道 (Hong Zhi Dao). </para> </listitem> <listitem> <para> Bugfix: fixed function declaration with the same name as a variable. Thanks to 洪志道 (Hong Zhi Dao). </para> </listitem> <listitem> <para> Improvement: code related to parsing of objects, variables and functions is refactored. Thanks to 洪志道 (Hong Zhi Dao). </para> </listitem> <listitem> <para> Improvement: large-value output improved in <literal>console.log()</literal>. </para> </listitem> <listitem> <para> Improvement: string output improved in <literal>console.log()</literal> in a compliant way (without escaping and quotes). </para> </listitem> <listitem> <para> Improvement: using ES6 version of <literal>ToInt32()</literal>, <literal>ToUint32()</literal>, <literal>ToLength()</literal>. </para> </listitem> </list> </para> </section> <section id="njs0.3.0" name="Changes with 0.3.0"> <para> Release Date: 26 March 2019 </para> <para> nginx modules: <list type="bullet"> <listitem> <para> Feature: added the <literal>js_path</literal> directive for <link doc="../http/ngx_http_js_module.xml" id="js_path">http</link> and <link doc="../stream/ngx_stream_js_module.xml" id="js_path">stream</link>. </para> </listitem> <listitem> <para> Change: returning undefined value instead of empty strings for absent properties in the following objects: <link doc="reference.xml" id="r_args"><literal>r.args{}</literal></link>, <link doc="reference.xml" id="r_headers_in"><literal>r.headersIn{}</literal></link>, <link doc="reference.xml" id="r_headers_out"><literal>r.headersOut{}</literal></link>, <link doc="reference.xml" id="r_variables"><literal>r.variables{}</literal></link>, <link doc="reference.xml" id="s_variables"><literal>s.variables{}</literal></link>. </para> </listitem> <listitem> <para> Change: returning undefined value instead of throwing an exception for <link doc="reference.xml" id="r_request_body"><literal>r.requestBody</literal></link> when request body is unavailable. </para> </listitem> <listitem> <para> Bugfix: fixed crash while iterating over <link doc="reference.xml" id="r_args"><literal>r.args{}</literal></link> when a value is absent in a key-value pair. </para> </listitem> </list> </para> <para> Core: <list type="bullet"> <listitem> <para> Feature: added initial ES6 modules support. Default import and default export statements are supported. Thanks to 洪志道 (Hong Zhi Dao). </para> </listitem> <listitem> <para> Feature: added <literal>Object.prototype.propertyIsEnumerable()</literal>. </para> </listitem> <listitem> <para> Feature: reporting file name and function name in disassembler output. </para> </listitem> <listitem> <para> Bugfix: fixed function redeclarations in interactive shell. Thanks to 洪志道 (Hong Zhi Dao). </para> </listitem> <listitem> <para> Bugfix: fixed RegExp literals parsing. </para> </listitem> <listitem> <para> Bugfix: fixed setting length of UTF8 string in <link doc="reference.xml" id="readfilesync"><literal>fs.readFileSync()</literal></link>. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>nxt_file_dirname()</literal> for paths with no dir component. </para> </listitem> </list> </para> </section> <section id="njs0.2.8" name="Changes with 0.2.8"> <para> Release Date: 26 February 2019 </para> <para> nginx modules: <list type="bullet"> <listitem> <para> Change: properties of HTTP request deprecated in <link id="njs0.2.2">0.2.2</link> are removed. </para> </listitem> <listitem> <para> Feature: added support for delete operation in <link doc="reference.xml" id="r_headers_out"><literal>r.headersOut{}</literal></link>. </para> </listitem> <listitem> <para> Feature: added support for setting nginx variables. </para> </listitem> <listitem> <para> Bugfix: fixed <link doc="reference.xml" id="subrequest"><literal>r.subrequest()</literal></link> for empty body value. </para> </listitem> <listitem> <para> Improvement: setting special response headers in <link doc="reference.xml" id="r_headers_out"><literal>r.headersOut{}</literal></link>. </para> </listitem> </list> </para> <para> Core: <list type="bullet"> <listitem> <para> Feature: added labels support. </para> </listitem> <listitem> <para> Feature: added <literal>setImmediate()</literal> method. </para> </listitem> <listitem> <para> Feature: added support for shorthand property names for Object literals. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Function.prototype.bind()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed parsing of string literals containing newline characters. </para> </listitem> <listitem> <para> Bugfix: fixed line number in reporting variable reference errors. </para> </listitem> <listitem> <para> Bugfix: fixed creation of long UTF8 strings. </para> </listitem> <listitem> <para> Bugfix: fixed setting special response headers in <link doc="reference.xml" id="string_split"><literal>String.prototype.split()</literal></link> for Unicode strings. </para> </listitem> <listitem> <para> Bugfix: fixed heap-buffer-overflow in <link doc="reference.xml" id="string_split"><literal>String.prototype.split()</literal></link>. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Array.prototype.fill()</literal>. Thanks to Artem S. Povalyukhin. </para> </listitem> <listitem> <para> Improvement: code related to function invocation is refactored. Thanks to 洪志道 (Hong Zhi Dao). </para> </listitem> <listitem> <para> Improvement: code related to variables is refactored. Thanks to 洪志道 (Hong Zhi Dao). </para> </listitem> <listitem> <para> Improvement: parser is refactored. Thanks to 洪志道 (Hong Zhi Dao). </para> </listitem> <listitem> <para> Improvement: reporting filenames in exceptions. </para> </listitem> </list> </para> </section> <section id="njs0.2.7" name="Changes with 0.2.7"> <para> Release Date: 25 December 2018 </para> <para> Core: <list type="bullet"> <listitem> <para> Feature: rest parameters syntax (destructuring is not supported). Thanks to Alexander Pyshchev. </para> </listitem> <listitem> <para> Feature: added <link doc="reference.xml" id="object_entries"><literal>Object.entries()</literal></link> method. </para> </listitem> <listitem> <para> Feature: added <link doc="reference.xml" id="object_values"><literal>Object.values()</literal></link> method. </para> </listitem> <listitem> <para> Improvement: code generator refactored and simplified. </para> </listitem> <listitem> <para> Bugfix: fixed automatic semicolon insertion. </para> </listitem> <listitem> <para> Bugfix: fixed assignment expression from compound assignment. </para> </listitem> <listitem> <para> Bugfix: fixed comparison of Byte and UTF8 strings. </para> </listitem> <listitem> <para> Bugfix: fixed type of iteration variable in for-in with array values. </para> </listitem> <listitem> <para> Bugfix: fixed building on platforms without librt. </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs have been fixed. </para> </listitem> </list> </para> </section> <section id="njs0.2.6" name="Changes with 0.2.6"> <para> Release Date: 27 November 2018 </para> <para> Core: <list type="bullet"> <listitem> <para> Feature: making built-in prototypes mutable. </para> </listitem> <listitem> <para> Feature: making global object mutable. </para> </listitem> <listitem> <para> Feature: <literal>console.time()</literal> and <literal>console.timeEnd()</literal> methods. </para> </listitem> <listitem> <para> Feature: allowing variables and functions to be redeclared. </para> </listitem> <listitem> <para> Feature: extending <literal>Object.defineProperty()</literal> spec conformance. </para> </listitem> <listitem> <para> Feature: introduced quiet mode for CLI to handle simple expressions from stdin. </para> </listitem> <listitem> <para> Feature: introduced compact form of backtraces to handle stack overflows. </para> </listitem> <listitem> <para> Improvement: improved wording for various exceptions. </para> </listitem> <listitem> <para> Bugfix: fixed closure values handling. </para> </listitem> <listitem> <para> Bugfix: fixed equality operator for various value types. </para> </listitem> <listitem> <para> Bugfix: fixed handling of “this” keyword in various scopes. </para> </listitem> <listitem> <para> Bugfix: fixed handling non-object values in <literal>Object.keys()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed parsing of throw statement inside <literal>if</literal> statement. </para> </listitem> <listitem> <para> Bugfix: fixed parsing of newline after throw statement. </para> </listitem> <listitem> <para> Bugfix: fixed parsing of statements in if statement without newline. </para> </listitem> <listitem> <para> Bugfix: fixed size <literal>uint32_t</literal> overflow in <literal>njs_array_expand()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>typeof</literal> operator for <literal>object_value</literal> type. </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs have been fixed. </para> </listitem> </list> </para> </section> <section id="njs0.2.5" name="Changes with 0.2.5"> <para> Release Date: 30 October 2018 </para> <para> nginx modules: <list type="bullet"> <listitem> <para> Bugfix: fixed counting pending events in stream module. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>s.off()</literal> in stream module. </para> </listitem> <listitem> <para> Bugfix: fixed processing of data chunks in <literal>js_filter</literal> in stream module. </para> </listitem> <listitem> <para> Bugfix: fixed http <literal>status</literal> and <literal>contentType</literal> getter in http module. </para> </listitem> <listitem> <para> Bugfix: fixed http response and parent getters in http module. </para> </listitem> </list> </para> <para> Core: <list type="bullet"> <listitem> <para> Feature: arguments object support. </para> </listitem> <listitem> <para> Feature: non-integer fractions support. </para> </listitem> <listitem> <para> Improvement: handling non-array values in <literal>Array.prototype.slice()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Array.prototype.length</literal> setter </para> </listitem> <listitem> <para> Bugfix: fixed <literal>njs_array_alloc()</literal> for length > 2**31. </para> </listitem> <listitem> <para> Bugfix: handling int overflow in <literal>njs_array_alloc()</literal> on 32bit archs. </para> </listitem> <listitem> <para> Bugfix: fixed code size mismatch error message. </para> </listitem> <listitem> <para> Bugfix: fixed delete operator in a loop. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Object.getOwnPropertyDescriptor()</literal> for complex object (inherited from <literal>Array</literal> and <literal>string</literal> values). </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Object.prototype.hasOwnProperty()</literal> for non-object properties </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs have been fixed. </para> </listitem> </list> </para> </section> <section id="njs0.2.4" name="Changes with 0.2.4"> <para> Release Date: 18 September 2018 </para> <para> nginx modules: <list type="bullet"> <listitem> <para> Change: stream module handlers refactored. </para> <para> New methods and properties: <link doc="reference.xml" id="s_on">s.on()</link>, <link doc="reference.xml" id="s_off">s.off()</link>, <link doc="reference.xml" id="s_allow">s.allow()</link>, <link doc="reference.xml" id="s_done">s.done()</link>, <link doc="reference.xml" id="s_decline">s.decline()</link>, <link doc="reference.xml" id="s_deny">s.deny()</link>. </para> <para> Removed properties of the <link doc="reference.xml" id="stream">Stream</link> object: <literal>s.OK</literal>, <literal>s.ABORT</literal>, <literal>s.AGAIN</literal>, <literal>s.DECLINED</literal>, <literal>s.ERROR</literal> (replaced with <link doc="reference.xml" id="s_allow">s.allow()</link>, <link doc="reference.xml" id="s_done">s.done()</link>, <link doc="reference.xml" id="s_deny">s.deny()</link>). </para> <para> <literal>s.buffer</literal> (for reading replaced with data argument of the corresponding callback, for writing use <link doc="reference.xml" id="s_send">s.send()</link>). </para> <para> <literal>s.fromUpstream</literal> (replaced with a callback for a corresponding event). </para> <para> <literal>s.eof</literal> (replaced with <literal></literal> <link doc="reference.xml" id="s_on_callback_last">flags.last</link>). </para> </listitem> </list> </para> <para> Core: <list type="bullet"> <listitem> <para> Feature: added <literal>Function.prototype.length</literal>. </para> </listitem> <listitem> <para> Feature: introduced sandboxing mode. </para> </listitem> <listitem> <para> Improvement: added exception strings where appropriate. </para> </listitem> <listitem> <para> Improvement: improved wording for primitive type conversion exception. </para> </listitem> <listitem> <para> Bugfix: throwing <literal>TypeError</literal> for attempts to change frozen properties. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Object.defineProperty()</literal> for existing properties. </para> </listitem> <listitem> <para> Bugfix: respecting the enumerable attribute while iterating by for in. </para> </listitem> <listitem> <para> Bugfix: respecting writable attribute for property handlers. </para> </listitem> <listitem> <para> Bugfix: fixed exception handling in arguments of a function. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Object.prototype.toString</literal> for different value types. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Object()</literal> constructor for object types arguments. </para> </listitem> <listitem> <para> Bugfix: fixed comparison of objects and strings. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>String.slice()</literal> for undefined arguments. </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs have been fixed. </para> </listitem> </list> </para> </section> <section id="njs0.2.3" name="Changes with 0.2.3"> <para> Release Date: 31 July 2018 </para> <para> nginx modules: <list type="bullet"> <listitem> <para> Bugfix: making a subrequest from a <literal>Reply</literal> object caused a segmentation fault. </para> </listitem> <listitem> <para> Bugfix: getting the parent property of the main <link doc="reference.xml" id="http">HTTP Request</link> object caused a segmentation fault. </para> </listitem> </list> </para> <para> Core: <list type="bullet"> <listitem> <para> Feature: added the pretty string representation for values. </para> </listitem> <listitem> <para> Feature: correctly printing floating point numbers. </para> </listitem> <listitem> <para> Feature: correctly parsing floating point numbers. </para> </listitem> <listitem> <para> Feature: <link doc="reference.xml" id="string_bytesfrom">String.bytesFrom()</link> method (decoding <literal>hex</literal>, <literal>base64</literal>, <literal>base64url</literal> into a byte string). </para> </listitem> <listitem> <para> Feature: <link doc="reference.xml" id="string_padstart">String.padStart()</link> and <link doc="reference.xml" id="string_padend">String.padEnd()</link> methods. </para> </listitem> <listitem> <para> Feature: added support of binary literals. </para> </listitem> <listitem> <para> Improvement: added information about illegal token in number parsing. </para> </listitem> <listitem> <para> Improvement: allowed uppercased <literal>O</literal> in octal literal values. </para> </listitem> <listitem> <para> Improvement: added support for multiple arguments in <literal>console.log()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed applying <literal>call()</literal> to methods of external values. </para> </listitem> <listitem> <para> Bugfix: fixed addition operator applied to an object. </para> </listitem> <listitem> <para> Bugfix: fixed exception handling in <literal>njs_vm_value_to_ext_string()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>Number()</literal> with boolean, null and undefined arguments. </para> </listitem> <listitem> <para> Bugfix: fixed error handling of setting non-numeric <literal>Array.length</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed autocompletion for global objects. </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs have been fixed. </para> </listitem> </list> </para> </section> <section id="njs0.2.2" name="Changes with 0.2.2"> <para> Release Date: 19 June 2018 </para> <para> nginx modules: <list type="bullet"> <listitem> <para> Change: merged HTTP <literal>Response</literal> and <literal>Reply</literal> into <link doc="reference.xml" id="http">HTTP Request</link>. New members of <literal>Request</literal>: <list type="bullet"> <listitem> <para> <literal>req.status</literal> (<literal>res.status</literal>) </para> </listitem> <listitem> <para> <literal>req.parent</literal> (<literal>reply.parent</literal>) </para> </listitem> <listitem> <para> <literal>req.requestBody</literal> (<literal>req.body</literal>) </para> </listitem> <listitem> <para> <literal>req.responseBody</literal> (<literal>reply.body</literal>) </para> </listitem> <listitem> <para> <literal>req.headersIn</literal> (<literal>req.headers</literal>) </para> </listitem> <listitem> <para> <literal>req.headersOut</literal> (<literal>res.headers</literal>) </para> </listitem> <listitem> <para> <literal>req.sendHeader()</literal> (<literal>res.sendHeader()</literal>) </para> </listitem> <listitem> <para> <literal>req.send()</literal> (<literal>res.send()</literal>) </para> </listitem> <listitem> <para> <literal>req.finish()</literal> (<literal>res.finish()</literal>) </para> </listitem> <listitem> <para> <literal>req.return()</literal> (<literal>res.return()</literal>) </para> </listitem> </list> Deprecated members of <literal>Request</literal>: <list type="bullet"> <listitem> <para> <literal>req.body</literal> (use <literal>req.requestBody</literal> or <literal>req.responseBody</literal>) </para> </listitem> <listitem> <para> <literal>req.headers</literal> (use <literal>req.headersIn</literal> or <literal>req.headersOut</literal>) </para> </listitem> <listitem> <para> <literal>req.response</literal> </para> </listitem> </list> Deprecated members of <literal>Response</literal>: <list type="bullet"> <listitem> <para> <literal>res.contentLength</literal> (use <link doc="reference.xml" id="r_headers_out"><literal>req.headersOut</literal></link><literal>['Content-Length']</literal>) </para> </listitem> <listitem> <para> <literal>res.contentType</literal> (use <link doc="reference.xml" id="r_headers_out"><literal>req.headersOut</literal></link><literal>['Content-Type']</literal>) </para> </listitem> </list> The deprecated properties will be removed in <link id="njs0.2.8">next</link> releases. </para> </listitem> <listitem> <para> Feature: HTTP <link doc="reference.xml" id="r_internal_redirect">internalRedirect()</link> method. </para> </listitem> </list> </para> <para> Core: <list type="bullet"> <listitem> <para> Bugfix: fixed heap-buffer-overflow in <literal>crypto.createHmac()</literal>. </para> </listitem> </list> </para> </section> <section id="njs0.2.1" name="Changes with 0.2.1"> <para> Release Date: 31 May 2018 </para> <para> nginx modules: <list type="bullet"> <listitem> <para> Feature: HTTP request body getter. </para> </listitem> <listitem> <para> Improvement: moved njs vm to the <literal>main</literal> configuration. </para> </listitem> <listitem> <para> Improvement: improved logging for <link doc="../http/ngx_http_js_module.xml" id="js_set"/> and <link doc="../http/ngx_http_js_module.xml" id="js_content"/> directives. </para> </listitem> <listitem> <para> Improvement: setting status code to 500 by default in the <link doc="../http/ngx_http_js_module.xml" id="js_content"/> handler </para> </listitem> <listitem> <para> Improvement: added the debug for the returned status code in <link doc="../http/ngx_http_js_module.xml" id="js_content"/> handler </para> </listitem> <listitem> <para> Bugfix: fixed error logging in <link doc="../http/ngx_http_js_module.xml" id="js_include"/>. </para> </listitem> </list> </para> <para> Core: <list type="bullet"> <listitem> <para> Feature: added array length setter. </para> </listitem> <listitem> <para> Improvement: public header <literal>cleanup. njscript.h</literal> is renamed to <literal>njs.h</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed crypto <literal>update()</literal> method after <literal>digest()</literal> is called. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>crypto.createHmac()</literal> for keys with size <= alg size and > 64. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>JSON.stringify()</literal> for arrays with empty cells. </para> </listitem> <listitem> <para> Bugfix: fixed exception type for unsupported types in <literal>JSON.stringify()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed handling of undefined arguments of functions. </para> </listitem> <listitem> <para> Bugfix: fixed handling of missing <literal>arg</literal> of <literal>Object.getOwnPropertyDescriptor()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed handling of properties in <literal>Object.getOwnPropertyDescriptor()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed the writeable flag of <literal>Array.length</literal> property. </para> </listitem> <listitem> <para> Bugfix: fixed return value type of <literal>clearTimeout()</literal>. </para> </listitem> <listitem> <para> Bugfix: fixed <literal>njs_vm_external_bind()</literal>. </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs have been fixed. </para> </listitem> </list> </para> </section> <section id="njs0.2.0" name="Changes with 0.2.0"> <para> Release Date: 3 Apr 2018 </para> <para> <list type="bullet"> <listitem> <para> Feature: reporting njs version by CLI. </para> </listitem> <listitem> <para> Feature: textual description for type converting exceptions. </para> </listitem> <listitem> Feature: <literal>setTimeout()</literal> and <literal>clearTimeout()</literal> methods. </listitem> <listitem> <para> Feature: Byte string to <literal>hex</literal>, <literal>base64</literal>, <literal>base64url</literal> encodings. </para> </listitem> <listitem> <para> Feature: <link url="https://nodejs.org/api/crypto.html#crypto_class_hash">Node.js style</link> <literal>Crypto</literal> methods. </para> </listitem> <listitem> <para> Feature: HTTP and stream <literal>warn()</literal> and <literal>error()</literal> methods. </para> </listitem> <listitem> <para> Feature: HTTP <literal>subrequest()</literal> method. </para> </listitem> <listitem> <para> Feature: HTTP <literal>return()</literal> method. </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs have been fixed in the core and interactive shell. </para> </listitem> </list> </para> </section> <section id="njs0.1.15" name="Changes with 0.1.15"> <para> Release Date: 20 Nov 2017 </para> <para> <list type="bullet"> <listitem> <para> Feature: <literal>Error</literal>, <literal>EvalError</literal>, <literal>InternalError</literal>, <literal>RangeError</literal>, <literal>ReferenceError</literal>, <literal>SyntaxError</literal>, <literal>TypeError</literal>, <literal>URIError</literal> objects. </para> </listitem> <listitem> <para> Feature: octal literals support. </para> </listitem> <listitem> <para> Feature: <link url="https://nodejs.org/api/fs.html#fs_file_system">Node.js style</link> <literal>File system</literal> access methods: <literal>fs.readFile()</literal>, <literal>fs.readFileSync()</literal>, <literal>fs.appendFile()</literal>, <literal>fs.appendFileSync()</literal>, <literal>fs.writeFile()</literal>, <literal>fs.writeFileSync()</literal>. </para> </listitem> <listitem> <para> Feature: nginx modules print backtrace on exception. </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs have been fixed. </para> </listitem> </list> </para> </section> <section id="njs0.1.14" name="Changes with 0.1.14"> <para> Release Date: 09 Oct 2017 </para> <para> <list type="bullet"> <listitem> <para> Feature: JSON object. </para> </listitem> <listitem> <para> Feature: object level completions in interactive shell. </para> </listitem> <listitem> <para> Feature: various configure improvements. </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs have been fixed in the core and interactive shell. </para> </listitem> </list> </para> </section> <section id="njs0.1.13" name="Changes with 0.1.13"> <para> Release Date: 31 Aug 2017 </para> <para> <list type="bullet"> <listitem> <para> Feature: <literal>console.log()</literal> and <literal>console.help()</literal> methods in interactive shell. </para> </listitem> <listitem> <para> Feature: interactive shell prints backtrace on exception. </para> </listitem> <listitem> <para> Feature: interactive shell by default if <literal>libedit</literal> is available. </para> </listitem> <listitem> <para> Bugfix: processing of large files from <literal>stdin</literal> in command line mode. </para> </listitem> <listitem> <para> Bugfix: improved <literal>editline</literal> detection. </para> </listitem> </list> </para> </section> <section id="njs0.1.12" name="Changes with 0.1.12"> <para> Release Date: 08 Aug 2017 </para> <para> <list type="bullet"> <listitem> <para> Feature: Interactive shell. </para> </listitem> <listitem> <para> Bugfix: in <literal>Object.isSealed()</literal>. </para> </listitem> </list> </para> </section> <section id="njs0.1.11" name="Changes with 0.1.11"> <para> Release Date: 27 Jun 2017 </para> <para> <list type="bullet"> <listitem> <para> Feature: <literal>Object.keys()</literal>, <literal>Object.prototype.hasOwnProperty()</literal> methods. </para> </listitem> <listitem> <para> Feature: <literal>Object.defineProperty()</literal>, <literal>Object.defineProperties()</literal>, <literal>Object.getOwnPropertyDescriptor()</literal> methods. </para> </listitem> <listitem> <para> Feature: <literal>Object.getPrototypeOf()</literal>, <literal>Object.prototype.isPrototypeOf()</literal> methods. </para> </listitem> <listitem> <para> Feature: <literal>Object.preventExtensions()</literal>, <literal>Object.isExtensible()</literal>, <literal>Object.freeze()</literal>, <literal>Object.isFrozen()</literal>, <literal>Object.seal()</literal>, <literal>Object.isSealed()</literal> methods. </para> </listitem> <listitem> <para> Feature: scientific notation (<literal>3.35e10</literal>) literals support. </para> </listitem> <listitem> <para> Feature: hexadecimal (<literal>0x1123</literal>) literals support. </para> </listitem> <listitem> <para> Bugfix: processing of large array indexes. </para> </listitem> <listitem> <para> Bugfix: in <literal>parseInt()</literal> and <literal>Date.parse()</literal>. </para> </listitem> </list> </para> </section> <section id="njs0.1.10" name="Changes with 0.1.10"> <para> Release Date: 04 Apr 2017 </para> <para> <list type="bullet"> <listitem> <para> Feature: nested functions and function closures. </para> </listitem> <listitem> <para> Feature: <literal>Array.of()</literal>, <literal>Array.prototype.fill()</literal>, <literal>Array.prototype.find()</literal>, <literal>Array.prototype.findIndex()</literal> methods. </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs and segmentation faults have been fixed. </para> </listitem> </list> </para> </section> <section id="njs0.1.9" name="Changes with 0.1.9"> <para> Release Date: 01 Feb 2017 </para> <para> <list type="bullet"> <listitem> <para> Bugfix: global variables were not initialized when njs was used in nginx. </para> </listitem> </list> </para> </section> <section id="njs0.1.8" name="Changes with 0.1.8"> <para> Release Date: 24 Jan 2017 </para> <para> <list type="bullet"> <listitem> <para> Change: the <literal>strict</literal> mode is enforced, variables must be explicitly declared. </para> </listitem> <listitem> <para> Feature: <literal>for</literal> and <literal>for-in</literal> loops support variable declaration. </para> </listitem> <listitem> <para> Bugfix: global and function scopes have been fixed. </para> </listitem> <listitem> <para> Bugfix: now <literal>for-in</literal> loop does not discard the last value of property variable. </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs and segmentation faults have been fixed. </para> </listitem> </list> </para> </section> <section id="njs0.1.7" name="Changes with 0.1.7"> <para> Release Date: 27 Dec 2016 </para> <para> <list type="bullet"> <listitem> <para> Change: the <link doc="../http/ngx_http_js_module.xml" id="js_include"/> directive has been disabled at server and location levels. </para> </listitem> <listitem> <para> Feature: exponentiation operators. </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs and segmentation faults have been fixed. </para> </listitem> </list> </para> </section> <section id="njs0.1.6" name="Changes with 0.1.6"> <para> Release Date: 13 Dec 2016 </para> <para> <list type="bullet"> <listitem> <para> Change: the <link doc="../http/ngx_http_js_module.xml" id="js_set"/> directive has been disabled at server and location levels. </para> </listitem> <listitem> <para> Feature: ES6 <literal>Math</literal> methods. </para> </listitem> <listitem> <para> Bugfix: miscellaneous bugs and segmentation faults have been fixed. </para> </listitem> </list> </para> </section> </article>