Skip to content

Latest commit

 

History

History
1331 lines (910 loc) · 51.3 KB

RELEASES.rst

File metadata and controls

1331 lines (910 loc) · 51.3 KB

Duktape releases

Released

0.1.0 (2013-02-14)

  • Initial alpha release
  • Core features work: compiler, executor, regexps, garbage collection
  • Most built-ins incomplete or missing

0.2.0 (2013-02-27)

  • Built-ins implemented: Boolean, Date, JSON
  • Date built-in has initial, minimal local time / locale support
  • Initial internal documentation: regexp, datetime, json

0.3.0 (2013-03-16)

  • Built-ins implemented: global object, Object, String

0.4.0 (2013-03-31)

  • Built-ins: Array, Number, completing built-ins

0.5.0 (2013-05-17)

  • Built-in number conversion primitives
  • Cleanup built-ins, improve test cases for built-ins

0.6.0 (2013-09-21)

  • First round of public API cleanup, and add basic API documentation
  • First version of duktape.org website

0.7.0 (2013-10-30)

  • Traceback support improved
  • Clean up and document error object properties
  • Add prototype objects for buffer and pointer values, and make them object coercible
  • Proper support for big, little, and "middle endian" environments
  • Single file combined source distributable
  • Portability and bug fixes

0.8.0 (2013-12-18)

  • Remove DUK_PROFILE model, explicit DUK_OPT_xxx feature options added for tuning the build (see web docs)
  • Register shuffling added to compiler which mostly eliminates constant and temporary register limits
  • Reduce code footprint, make built-in data 'const' so that it compiles into the 'text' section
  • Augment errors created when a built-in error constructor is called as a normal function (e.g. "var e = Error('test')")
  • Enforce string/buffer length limits to avoid corner cases with strings and buffers close to size_t limit
  • Ecmascript E5.1 test cases and fixes
  • Mark-and-sweep stringtable leak fixed, affected mostly builds without reference counting
  • Run a few mark-and-sweep passes in duk_destroy_heap() to give finalizers a chance to run in most (but not all) cases
  • Coroutine yield fixes
  • Portability and bug fixes

0.9.0 (2014-02-02)

  • Added duk_gc() API call to force GC, implemented duk_map_string() and duk_decode_string()
  • Added extended JSON format variants JSONX and JSONC; NULL pointer values string now coerce to "null" instead of e.g. "(nil)" to match JSONX format
  • Added input line number to compiler error messages (e.g. SyntaxErrors)
  • Added support for function declarations outside function or program top level (also known as "function statements"), with V8-like semantics
  • Renamed __duk__ to Duktape for more consistency with Ecmascript conventions
  • Removed somewhat useless Duktape.build property and added Duktape.env
  • Replaced Duktape.addr() and Duktape.refc() with Duktape.info() which gives more internal info
  • Merged Duktape.setFinalizer() and Duktape.getFinalizer() into a single Duktape.fin() call
  • Some compatibility properties available for now (e.g. __duk__), but these will be removed after this release
  • Removed array size limit for very large array joins
  • Improve Unicode handling of Greek final sigma
  • Make mark-and-sweep interval relative to current heap size (measured as combined object and string count)
  • Add DUK_OPT_NO_VOLUNTARY_GC to disable voluntary mark-and-sweep entirely; this is useful in timing sensitive applications like games
  • Preliminary internal support for periodic bytecode executor interrupts which can be used to implement executor step limits, profiling, and debugging
  • More feature options for build tuning
  • More self tests to detect obscure compiler bugs, two's complement arithmetic, etc (enable with DUK_OPT_SELF_TESTS)
  • Fixed several compile warnings, fixed warnings generated by GCC -Wextra
  • Fixed some incorrect assertions (with no underlying bug)
  • Fixed a coroutine termination bug which caused assertion errors and occasional segfaults when an uncaught error terminated a thread with a catch point active
  • Fixed a tail call bug: the current activation was not closed which caused variable lookups to fail if an inner function accessed variables in the surrounding activation
  • Fixed a few bound constructor bugs
  • Fixed handling of "get" and "set": they were handled as reserved words which prevented valid statements like "var set = 1;"
  • Fixed a switch-case bug where code was accepted before the first case/default clause
  • Fixed a switch-case bug where successive case clauses with no code in-between was not handled correctly
  • Fixed a for statement control flow bug when the third clause of the for statement was empty and a continue was used
  • Fixed error lineNumber bug triggered when there was more than 127 source lines between successive compiled statements
  • Fixed some line terminator handling issues
  • Fixed relational operator ToPrimitive() coercion order, for some operators coercion order was reversed
  • Fixed 'with' statement in strict mode (did not throw SyntaxError)
  • Fixed strictness handling of an indirect eval call from a strict function (eval incorrectly inherited strict mode)
  • Several test262 and underscore.js test case fixes (other than above)
  • Windows compatibility for both WIN32 and WIN64, tested with MinGW (x86), MINGW-w64 (x64), VS2010 Express (x32), VS2013 Express (x32 and x64)
  • Portability fixes for non-C99 platforms (like MSVC in VS2010)
  • Drop 'full distributable' build, which is replaced by the public GitHub repo; simplify Makefiles etc accordingly (this change is not visible in the source distributable)

0.10.0 (2014-04-13)

  • Avoid "out of regs" for large expressions by adding more comprehensive register shuffling and indirect variants of several bytecode opcodes
  • Change error handler model: error handlers are now set explicitly to Duktape.errcreate and Duktape.errthrow, and can interact with both error creation and error throwing
  • Incompatible API change: errhandler_index argument has been removed from all protected API calls as unnecessary
  • Add duk_push_heap_stash(), duk_push_global_stash(), and duk_push_thread_stash() to provide C code with stashes for storing values invisible to Ecmascript code
  • Add duk_safe_to_string() and duk_safe_to_lstring() to make it easier to write result printing in C
  • Add protected variants of eval/compile: duk_peval(), duk_peval_string(), duk_peval_file(), duk_pcompile(), duk_pcompile_string(), duk_pcompile_file()
  • duk_pcall_prop() now catches invalid stack index errors and property lookup errors which happen before the actual call
  • Add duk_put_function_list() and duk_put_number_list() to make it easier to define modules from C code
  • Add Duktape.compact(), Duktape.line(), and Duktape.act()
  • Add a "use duk notail" directive which indicates that an Ecmascript function should never be tail called
  • Add a barebones built-in logging framework with both Ecmascript and C APIs and easy customization
  • Add a message argument to fatal handler function callback, simplify internal fatal error and panic handling
  • Compact function templates and instances to reduce memory footprint
  • Execute finalizers for all objects, even reachable ones, when a heap is freed to allow native resources to be freed reliably
  • "new Object()" now promotes plain buffer and pointer values to Buffer and Pointer objects
  • Buffer values now have virtual numeric index properties and a virtual 'length' property, so that you can do x = buf[123], buf[123] = x and buf.length
  • Buffer data areas no longer have an automatic NUL terminator to avoid rounding user-requested allocation sizes upwards unnecessarily
  • Buffer constructor behavior changes: number argument creates a buffer of a certain size; optional second argument indicates whether a buffer should be dynamic or fixed
  • Change Array.prototype.splice() behavior so that if 2nd argument (deleteCount) is not given, splice to end of array instead of treating like deleteCount was zero: the new behavior is non-standard but is the real world behavior used by V8, Rhino, Spidermonkey, etc
  • Add an automatic 'length' property to Duktape/C functions
  • Add a feature option to provide a 'caller' property for non-strict functions, with behavior similar to the (non-standard) behavior in e.g. V8 and Rhino
  • Add a feature option to disable automatic zeroing of data areas of buffer values
  • Improve self tests to include byte order validation
  • Allow the global eval() function to be called from C code (causes an indirect eval); this was at least an issue with a bound eval() call
  • Fix O(depth^2) inner function parsing issue, inner functions are now only parsed once and deeply nested inner functions are no longer a performance issue
  • On platforms requiring a specific alignment, use an alternate object property table memory layout to reduce memory footprint
  • Wrap remaining platform calls through macro wrappers to allow easier targeted fixes if necessary
  • Fix a regexp bug: non-capturing groups inside quantifier expressions were matched incorrectly
  • Fix a regexp bug: capture groups were not reset to 'undefined' when a quantified with capture groups was re-matched by a quantifier
  • Fix a tail call bug which caused assertion failures when a tail call was made from inside a switch-case
  • Fix a with statement bug which caused assertion failures when a break or continue jumped out of the with statement
  • Fix a try-catch-finally broken assertion when finally block had finished (ENDFIN opcode)
  • Portability fixes for Crossbridge (Flash), NetBSD (endianness detection and a few Math.pow() fixes), OpenBSD (endianness detection), QNX (endianness and other fixes)
  • Warning fixes for non-default feature options and a few exotic compilers
  • Duktape can now be compiled with Emscripten and executed with e.g. V8, "Dukweb" provides an example where Duktape runs on a web page, with Duktape and the browser Javascript environment interacting

0.11.0 (2014-07-11)

  • Add a built-in module loader (i.e. a require() function) based on CommonJS modules v1.1.1; user must always provide a module search function (Duktape.modSearch)
  • Add Object.setPrototypeOf() and Object.prototype.__proto__, both borrowed from ES6 draft, to improve internal prototype handling
  • Add proxy objects borrowed from ES6 draft to allow property virtualization, subset limited to the following traps: has, get, set, deleteProperty, enumerate, ownKeys
  • Add property name as a non-standard setter/getter argument to make it possible to share a single setter/getter pair for multiple properties
  • Allow non-standard dollar escape inside character classes (previously they were already allowed elsewhere), to support non-standard regexps like /[\$]/
  • Add debug API calls to dump the stack top and values in the current context, see e.g. duk_dump_context_stdout
  • Add convenience API calls: duk_push_uint(), duk_get_global_string()
  • Add more variants for eval/compile (such as duk_eval_lstring() and duk_compile_lstring()) and avoid interning the source code when compiling from a user provided string (useful in low memory environments)
  • Add duk_copy() API call, essentially shorthand for duk_dup() + duk_replace()
  • Align duk_to_fixed_buffer() arguments and return value with duk_to_buffer() (this is an API incompatible change); add duk_to_dynamic_buffer()
  • Implement the DUK_COMPILE_FUNCTION flag for duk_compile()
  • Remove Duktape.line() as redundant to Duktape.act()
  • Serialize negative zero as '-0' in JSONX and JSONC
  • Public API C typing wrapped behind typedefs to allow porting to more exotic platforms, e.g. platforms where "int" is a 16-bit type; API docs updated to describe how type wrapping affects calling code (see new section "C types")
  • Internal C typing wrapped throughout to allow porting to more exotic platforms, e.g. platforms where "int" is a 16-bit type
  • Rename some feature options (DUK_OPT_xxx) for consistency, please check any options you use against the up-to-date options list
  • Rename Duktape.errcreate and Duktape.errthrow to Duktape.errCreate and Duktape.errThrow for naming consistency
  • Rename Duktape's custom JSONX format to avoid confusion with JSONx (XML encoding for JSON); new names are JX and JC ('jx' and 'jc' in APIs, DUK_OPT_NO_JX and DUK_OPT_NO_JC in feature options)
  • Compact the automatic function .prototype property, which previously had 1 unused property slot
  • Use 'anon' instead of 'empty' for the function name in toString() coercion of an anonymous function, matching traceback behavior
  • The expressions !0 and !1 are now constant folded by the compiler as they're often found in minified code; also !true and !false are constant folded
  • Remove the 256 character limitation for duk_log(), log messages can now be arbitrarily long but short messages (<= 256) are still formatted efficiently using a stack buffer
  • Improve non-C99 build: type detection should now work on (some) 64-bit platforms too, and non-debug build should now generate much fewer (or no) warnings; this also improves C++ build
  • Add support for X32 ABI (gcc -mx32 option)
  • Move platform and feature detection into duktape.h, also for internal types, which allows type wrappers to be applied to the public API
  • Add a safety limit for compiled bytecode byte size and maximum line number used to ensure pc-to-line internal data structure limits are not exceeded
  • Fix a number conversion related incorrect assertion triggered by the test262 test suite
  • Fix JSON.parse() handling for '__proto__' named own property, which should be parsed as a normal property of that name instead of changing the object's prototype
  • Fix a duk_push_sprintf() bug: for long formatted strings Duktape would reuse a va_list without copying it, which lead to memory unsafe behavior
  • Fix a 'delete' bug: if delete target was a string and key was 'length' or a valid character index, value stack was left in an inconsistent state in non-strict mode (caused an assertion failure)
  • Fix a rare math optimization issue in the Date built-in, which caused a corner case test (test-bi-date-canceling.js) to fail on e.g. 64-bit Ubuntu, gcc 4.8.1, -m32, and no -std=c99
  • Fix a few corner case pointer wrapping bugs in duk_set_top() and a few other value stack index handling functions
  • Portability fix for avoiding potentially non-portable signed integer constants internally (e.g. use 0x7fffffffL - 1L instead of -0x80000000L); this fixed a concrete problem with at least VS2010 + x64
  • Portability fix for avoiding direct function pointers to built-in functions (especially math functions) because they may be implemented as inline functions or macros on some platforms or polyfill headers
  • Portability fixes for MSVC, avoid secure CRT warnings to work better with Windows Store apps
  • Portability fixes for VS2010, avoid ending up with a packed value representation on x64 when standard integer headers are not available (also added a self test to catch such cases)
  • Reduce warnings generated by /Wp64 option of VS2010 when compiling for x86; the remainings warnings are harmless and cannot be completely removed, see guide documentation for more information
  • Portability fix for DUK_OPT_SEGFAULT_ON_PANIC when C99 types are not available
  • Portability fixes for uclibc, use a replacement for e.g. fpclassify() because it is broken in some uclibc versions still in use (affected at least some mixed endian ARM environments)
  • Portability fixes for newer Emscripten version, Dukweb.js now works with Firefox
  • A few polyfills for non-standard but still commonly used features are provided in the distributable polyfills/ directory
  • AUTHORS.txt is now included in the distributable, and both LICENSE.txt and AUTHORS.txt are embedded into duktape.c and duktape.h to ensure they're automatically included when used in another project

0.12.0 (2014-09-26)

  • Beta release for stabilization: feature freeze until 1.0.0 release, most work will be testing, bug fixes, and documentation
  • Remove undocumented duk_xmove(), add duk_xmove_top() and duk_xcopy_top() (duk_xcopy_top() provides the same semantics as the earlier undocumented duk_xmove())
  • Change strictness behavior for Duktape API calls: all API calls now have Ecmascript strict semantics, even when a call is made with an empty call stack outside of any Duktape/C function
  • Change strictness handling of duk_eval() and variants so that all code is evaluated in non-strict mode by default (unless the code itself contains a "use strict" directive); without this change the strictness would depend on whether a Duktape/C function call was active or not
  • Change Array.prototype.concat() and Array.prototype.map() behavior so that trailing non-existent elements are counted towards the result array length; this behavior seems to be non-standard but is the real world behavior used by V8, Rhino, and Spidermonkey at least
  • Add API call duk_set_global_object() which allows the global object of a context to be replaced; this is useful as an initial mechanism for proper sandboxing of Ecmascript code
  • Add API calls duk_get_prototype() and duk_set_prototype() for getting and setting an object's "internal prototype" from C code
  • Add API calls duk_get_finalizer() and duk_set_finalizer() for getting and setting an object's finalizer from C code
  • Add API calls for function "magic" which allows a 16-bit signed integer to be associated (cheaply) with a Duktape/C function
  • Treat any strings whose byte representation begins with 0xFF as internal, so that user code can use hidden internal properties like Duktape does internally; such properties are not enumerated or returned by e.g. getOwnPropertyNames()
  • Fix the object property allocation resizing algorithm to avoid unbounded memory usage with some insert/delete sequences (see test-bug-object-prop-alloc-unbounded.js)
  • Use an equivalent year (matching leap-year-ness and weekday of Jan 1) for local tzoffset calculations outside the [1971,2037] year range to improve local time handling
  • Use gmtime() + localtime() on Unix (instead of gmtime() twice) for local tzoffset, fixing some DST cases
  • Improve parsing of a local time (new Date(2012, 1, 2, 3, 4, 5)) using an iterative algorithm to get a more accurate tzoffset/DST estimate
  • Apply E5.1 Section 15.3.5.4 TypeError throwing also when the property value is a bound strict function, previously the special "caller" property behavior was only applied when "caller" value was a non-bound strict mode function
  • Reject deletion of plain buffer indexed elements (previously this behavior was implemented only for Buffer objects), i.e. delete returns false (in non-strict functions) or throws a TypeError (in strict functions)
  • Reject empty throw statement ('throw;') and reject a newline which occurs between a 'throw' and its argument
  • Disable internal interrupt mechanism in anticipation of 1.0 release since there will be no API to use it
  • Fix value stack reserve handling for function calls: a function call (Ecmascript or Duktape/C) might reduce the valstack "checked size" which was previously requested by user code (for more detail, see API test case test-dev-valstack-checked-size-call.c)
  • Fix finalizer handling for Proxy objects: if a Proxy object was reachable at heap destruction and the target object had a finalizer, the finalizer would also be executed for the Proxy object
  • Fix a few Date bugs for large out-of-range years which caused some assert failures and incorrect behavior when year was out of Ecmascript range (e.g. year 870e6 and year -200e6)
  • Minor compile warnings fixes for non-default options (e.g. when reference counting is disabled)
  • Make objects and functions defined by included polyfills non-enumerable so that they don't enumerate e.g. in a for-in loop
  • A few more polyfills

1.0.0 (2014-10-26)

  • Feature complete baseline release
  • Add convenience API call: duk_put_global_string()
  • Rename duk_is_fixed() to duk_is_fixed_buffer() and duk_is_dynamic() to duk_is_dynamic_buffer() for consistency with other API calls
  • Rename Duktape internal keys to start with an uppercase character (e.g. "\xFFValue") so that user internal keys which begin with a lowercase character (e.g. "\xFFptr") won't conflict by default
  • Add OS and compiler strings to Duktape.env
  • Make error 'tracedata' an internal property for better sandboxing
  • Rename members of struct duk_memory_functions to have a "_func" suffix, to avoid conflicting with standard library names (which is problematic if the standard names are #defines)
  • Add DUK_OPT_DLL_BUILD, which should be enabled for both Duktape and application build when Duktape is built as a DLL; on Windows it makes Duktape use __declspec(dllexport) and __declspec(dllimport) for public API symbols
  • Rename RELEASES.txt, AUTHORS.txt, and README.txt files to .rst suffix for better automatic formatting
  • Fix a mark-and-sweep finalizer bug which could cause memory safety issues when finalizer execution was disabled for a mark-and-sweep round
  • Fix a mark-and-sweep zero-size realloc() bug which could happen when an initial zero-size realloc() failed (this shouldn't normally happen but was triggered by GC torture testing)
  • Fix an assertion failure when using labelled block statements; some labelled block statements still cause an internal error ("INVALID opcode 0") but don't cause assert failures
  • Fix an assertion failure when using a try-catch in a function with a lot of constants (more than 511 string or non-integer constants); a compile error happens now instead to prevent unsafe behavior
  • Fix duk_dump_context_stderr() which incorrectly dumped to stdout
  • Fix require() resolution of relative module identifiers, which was off by one component (GH-48)
  • Fix DUK_INVALID_INDEX define value, it used INT_MIN directly
  • Fix return value of Duktape.gc() to return true (instead of false) for a successful mark-and-sweep
  • Fix duk_peval_file(), duk_peval_file_noresult() and duk_pcompile_file() to avoid throwing an error for a missing file
  • Fix compile error for DUK_OPT_NO_FILE_IO
  • Regexp internal limit errors changed from Error to RangeError
  • Change command line example to be "barebones" by default, with readline enabled via DUK_CMDLINE_FANCY
  • Use variadic macros for VS2005+

1.0.1 (2014-10-31)

  • Fix compile error for DUK_OPT_NO_PC2LINE
  • Fix fileName for functions defined in a module loaded using require(), previously fileName would always be duk_bi_global.c which is misleading (GH-58)

1.0.2 (2014-11-08)

  • Quick fix for C++ compilation issue caused by Duktape using both static declaration and a static define which is not allowed in C++; the quick fix is to avoid "static" entirely with C++ (GH-63)

1.1.0 (2015-01-09)

  • Main release goal: improved low memory support to allow Duktape to run better on devices with 128kB (or even 96kB) system memory; with the changes in this release, Duktape initial RAM usage is reduced from about 46kB to 22kB for a 32-bit target when all low memory features are enabled
  • Add lightfunc (DUK_TYPE_LIGHTFUNC) primitive type, representing a Duktape/C function with a plain tagged value without any heap allocations
  • Add duk_push_c_lightfunc() and duk_is_lightfunc() API calls to push user lightfuncs on the value stack and to check if a value is a lightfunc
  • Add feature option DUK_OPT_LIGHTFUNC_BUILTINS which causes Duktape to use lightfuncs for almost all built-in functions, saving around 14kB of Duktape heap on 32-bit platforms
  • Add multiple feature options to use 16-bit fields and pointer compression for reducing memory usage on low memory systems, see doc/low-memory.rst for detailed discussion
  • Add DUK_OPT_EXTERNAL_STRINGS to enable support for external strings which are like dynamic buffers: a fixed size string header is allocated from the Duktape heap, but the data is behind a pointer
  • Add DUK_OPT_EXTSTR_INTERN_CHECK and DUK_OPT_EXTSTR_FREE (used with DUK_OPT_EXTERNAL_STRINGS) to allow string data to be held outside the Duktape heap, which is useful in low memory environments; see doc/low-memory.rst for detailed discussion
  • Add DUK_OPT_STRTAB_CHAIN and DUK_OPT_STRTAB_CHAIN_SIZE=nnn which enable an alternate string table algorithm intended for low memory environments; the algorithm uses separate chaining with arrays, making allocation behavior easier to handle using a pool allocator, see doc/low-memory.rst
  • Add duk_def_prop() which allows creation of accessor (getter/setter) properties and other custom properties from C code (instead of using Object.defineProperty() from Ecmascript code)
  • Add duk_is_error() API call to check if a value inherits from Error
  • Add duk_get_error_code() API call to check if a value inherits from Error, and if so, map its error class to DUK_ERR_xxx codes so that checking for built-in errors is more convenient
  • Add duk_get_heapptr(), duk_require_heapptr(), and duk_push_heapptr() to get borrowed void pointer references to Duktape heap objects (objects, strings, buffers)
  • Add vararg variants duk_error_va(), duk_push_error_object_va(), and duk_log_va()
  • Add DUK_GIT_DESCRIBE macro to the C API (with no Ecmascript equivalent) to allow application code to e.g. log more detailed version information relevant for non-official snapshot builds
  • Add feature option DUK_OPT_NO_STRICT_DECL to disable support for "use strict" declarations which may be useful with legacy code bases
  • Add DUK_OPT_SETJMP, DUK_OPT_UNDERSCORE_SETJMP, and DUK_OPT_SIGSETJMP to force an alternative provider for long control transfers; _setjmp() or sigsetjmp() (with savesigs set to 0) can be a lot faster than setjmp() if the platform's setjmp() implementation saves the signal mask (GH-55)
  • Default to _setjmp for long control transfers on OSX/iPhone (when __APPLE__ is defined) (GH-55)
  • Add SuperH detection support
  • Change JSON.stringify() to escape U+2028 and U+2029 by default to make the output a valid Javascript string, so that it can be embedded in a web page or parsed with eval (GH-68)
  • Change JSON.parse() to include a byte offset with a syntax error to help pinpoint JSON errors
  • Make Function.prototype.name writable so that application code can set a 'name' property on Duktape/C functions (GH-79)
  • Change buffer maximum size check to compare against allocated size (including spare) instead of requested size (without spare), this has a practical impact only when using 16-bit buffer size field
  • Use deep C stack for dukweb.js to remove some compiler recursion limit limitations (GH-67)
  • Add an example allocator with alloc/realloc/free logging, which is useful when optimizing e.g. pool sizes for low memory targets
  • Add an example allocator with memory wiping, red zones for invalid writes, and forced address change on realloc, which can be used for detecting memory safety issues on platforms where valgrind is not available
  • Add an example allocator with a hybrid model where a fixed set of small pools are used to reduce allocator churn, but the allocator falls back to malloc, realloc, and free for larger allocation sizes or when there are no free pool entries
  • Add an SPDX 1.2 license into the distributable
  • Fix INVALID opcode error for some labelled non-iteration statements (GH-85)
  • Fix a few missing "volatile" attributes in the bytecode executor which affected setjmp handling in clang (especially for _setjmp and sigsetjmp), also fix a few setjmp clobber warnings in executor
  • Fix compile error for DUK_OPT_NO_PC2LINE
  • Better fix for C++ compilation issue caused by Duktape using both static declaration and a static define which is not allowed in C++ (GH-63)
  • Fix compiler specific behavior when assigning a string to a buffer index (e.g. buf[3] = 'x'), now NaN coerces consistently to zero (this was the behavior on most compilers but e.g. on Linux MIPS NaN coerced to 255)
  • Fix fileName for functions defined in a module loaded using require(), previously fileName would always be duk_bi_global.c which is misleading (GH-58)
  • Fix object literal getter/setter definition to avoid creating a binding for the function (property) name, so that a setter/getter can access an outside variable with the same name as the get/set property (see test-bug-getset-func-name.js for details)
  • Fix JSON.parse() syntax error for explicitly positive exponents (e.g. '1.5e+2') (GH-93)
  • Fix duk_push_error_object() return value for platforms where variadic macros are not available
  • Don't fail compilation if SIZE_MAX is < 0xffffffffUL, to allow compilation on platforms where SIZE_MAX is (apparently) incorrectly defined
  • Fix several compile warnings with gcc 4.9.2 (GH-91)
  • Fix MinGW and Cygwin GCC compile warning "visibility attribute not supported in this configuration; ignored" when using separate sources
  • Fix MSVC const difference warning
  • Fix <inttypes.h> issue for older C++ compilers by defining __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS before including stdint.h and inttypes.h
  • Fix various warnings and errors detected in option matrix testing

1.1.1 (2015-02-17)

  • Fix Unicode handling of CJK ideographs and Hangul which were incorrectly not accepted in identifier names (GH-103)
  • Fix function parsing bug where the left curly brace opening the function body was not checked and Duktape would accept e.g. "function () [}" (GH-106)
  • Fix compiler register limit bug where an Ecmascript function with [65536,262143] VM registers would be compiled into incorrect bytecode instead of being rejected with an internal error (GH-111)
  • Fix compiler shuffle register handling by doing a pass 3 compile if necessary, fixing "CSPROPI target is not a number" error (GH-115)
  • Fix value stack setup bug which caused a segfault with large number of arguments (GH-107)

1.1.2 (2015-03-17)

  • Fix assignment evaluation order issue which affected expressions like "a[i] = b[i++]" (GH-118)
  • Fix incorrect parsing of zero escape in regexp class ("[0]") (GH-122)
  • Fix tail call issue in return comma expression when a function call in the comma expression was followed by a constant value or a register bound variable, e.g. 'return 0, (function { return 1; })(), 2;' would return 1 instead of 2 (GH-131)
  • Fix for-in statement shuffle bug which caused enumeration to fail in large functions which enable register shuffling (GH-132)
  • Fix shuffle handling issue for PUTPROP opcode, discovered by shuffle torture tests (GH-135)

1.1.3 (2015-04-03)

  • Fix Duktape.act() lineNumber bug, PC used for lineNumber was off-by-one which sometimes resulted in incorrect linenumbers (GH-143)
  • Fix incorrect switch-case matching when default clause is the first clause in a switch statement (GH-155)
  • Fix a few compiler warnings (GH-141)

1.2.0 (2015-04-05)

  • Main release goals: debugger support and performance improvements
  • Add first iteration of experimental debugger support which is based on a narrow debug API and a standard debug protocol; Duktape also provides an example debug client with a web UI, and a JSON debug proxy
  • Add support "fastints", i.e. for using integer arithmetic when possible in a transparent manner (improves performance for some workloads on soft float and some hard float platforms)
  • Add DUK_OPT_EXEC_TIMEOUT_CHECK(), an experimental bytecode execution timeout mechanism to safely bail out if script execution takes too long; this protects against accidental errors but is not (yet) intended to protect against deliberately malicious code
  • Internal performance improvement: direct refcount manipulation from macros instead of doing a helper function call
  • Internal performance improvement: hex encode/decode optimizations
  • Internal performance improvement: shorter internal chain for API push functions like duk_push_undefined()
  • Performance improvement: array write fast path when writing to "dense" Array instances using a numeric index
  • Add internal type tag to Duktape.info() result for non-heap-allocated types (useful for some testing)
  • Accept 32-bit codepoints in String.fromCharCode() to better support non-BMP strings (GH-120)
  • Make RegExp compiler/executor C stack limit higher on mainstream platforms (GH-157)
  • Add source code fileName/lineNumber to errors thrown during compilation (GH-140)
  • Improve MIPS32/MIPS64 detection, architecture strings in Duktape.env also updated ("mips32" or "mips64") (GH-102)
  • Add iPhone/iOS strings to Duktape.env
  • Add support for TI-Nspire (using Ndless, see GH-113)
  • Fix Unicode handling of CJK ideographs and Hangul which were incorrectly not accepted in identifier names (GH-103)
  • Fix function parsing bug where the left curly brace opening the function body was not checked and Duktape would accept e.g. "function () [}" (GH-106)
  • Fix compiler register limit bug where an Ecmascript function with [65536,262143] VM registers would be compiled into incorrect bytecode instead of being rejected with an internal error (GH-111)
  • Fix buffer assignment to allow negative values: buf[3] = -1 now yields 0xFF (in Duktape 1.1 yields 0x00 because negative values are capped to 0)
  • Fix compiler shuffle register handling by doing a pass 3 compile if necessary, fixing "CSPROPI target is not a number" error (GH-115)
  • Fix value stack setup bug which caused a segfault with large number of arguments (GH-107)
  • Fix incorrect parsing of zero escape in regexp class ("[0]") (GH-122)
  • Fix assignment evaluation order issue which affected expressions like "a[i] = b[i++]" (GH-118)
  • Fix tail call issue in return comma expression when a function call in the comma expression was followed by a constant value or a register bound variable, e.g. 'return 0, (function { return 1; })(), 2;' would return 1 instead of 2 (GH-131)
  • Fix for-in statement shuffle bug which caused enumeration to fail in large functions which enable register shuffling (GH-132)
  • Fix shuffle handling issue for PUTPROP opcode, discovered by shuffle torture tests (GH-135)
  • Fix a potential crash risk in Duktape.info() caused by a live pointer being used across a possible realloc
  • Fix Duktape.act() lineNumber bug, PC used for lineNumber was off-by-one which sometimes resulted in incorrect linenumbers (GH-143)
  • Fix incorrect switch-case matching when default clause is the first clause in a switch statement (GH-155)
  • Fix a few compiler warnings (GH-141)

1.2.1 (2015-04-08)

  • Fix duk_push_nan() NaN normalization bug which caused segfaults when using MSVC on x86 and potentially on other 32-bit platforms (GH-168)

1.2.2 (2015-06-02)

  • Fix harmless MSVC warnings when using DUK_OPT_FASTINT on x86 (GH-172)
  • Fix compile error from array fast path when using low memory options (GH-174)
  • Fix harmless MSVC warnings for size_t casts on x64 (GH-177)
  • Fix potential NULL pointer dereference in duk_is_dynamic_buffer() and duk_is_fixed_buffer() when index is outside of value stack (GH-206)

1.2.3 (2015-08-09)

  • Fix bytecode execution timeout regression which caused timeouts to fail after the first execution timeout had been triggered (GH-212)
  • Fix a few pointer compression issues (DUK_OPT_HEAPPTR16 / DUK_USE_HEAPPTR16) on 64-bit platforms (GH-228)
  • Fix JX parsing bug which caused strings like "1Infinity" to be parsed as negative infinity instead of causing a SyntaxError (GH-247)
  • Fix accidental ToString(this) coercion in Error.prototype.fileName and Error.prototype.lineNumber which was an issue if you replaced Error.prototype.toString with a function that accessed the 'lineNumber' or 'fileName' property of the error (GH-254)

1.2.4 (2015-09-06)

  • Fix a try-finally finalizer side effect issue by scrubbing TRYCATCH catch registers before executing the try code block (GH-287)
  • Fix missing activation lookup from call handling after an Arguments object was created, this could in theory lead to memory unsafe behavior (GH-305)
  • Avoid including <windows.h> for application build (GH-312)

1.2.5 (2015-11-23)

  • Fix duk_is_primitive() return value for invalid index, was incorrectly 1 (GH-337)
  • Fix assignment expression handling of the right-hand-side value when that value is a register-bound variable which is used and mutated in the rest of the expression (GH-381)
  • Remove octal autodetection in parseInt(), also fixes incorrect octal autodetection in e.g. "parseInt('00e1', 16)" (GH-413, GH-414)
  • Fix a bug in number conversion resolving a few (but not all) corner case rounding issues (GH-264)
  • Fix a segfault (and assertion error) caused by compiler intermediate value handling bug; the bug was triggered when a temporary register was required by the compiler, but an existing "intermediate value" referred to a const instead of a register value (GH-449)

1.3.0 (2015-09-12)

  • Introduce an external duk_config.h header which provides all platform and configuration specific defines; this makes it easier to adapt Duktape to custom platforms (GH-64)
  • Add support for Node.js Buffer API (GH-152)
  • Add support for Khronos/ES6 TypedArray API (subset of ES6 API) (GH-151)
  • Add duk_push_external_buffer(), duk_is_external_buffer(), and duk_config_buffer() which provide support for external buffers, i.e. buffer values which point to a user memory area allocated outside of Duktape heap (for example, an externally allocated frame buffer) (GH-153)
  • Add duk_push_buffer_object() which allows pushing of all buffer object and buffer view types (GH-190)
  • Add duk_get_buffer_data() and duk_require_buffer_data() API calls which accept both plain buffer and buffer object values (GH-190)
  • Add duk_steal_buffer() API call which allows user code to steal the current allocation of a dynamic buffer which is useful for some buffer manipulation algorithms (GH-129)
  • Add support for module.exports in the module loader framework (GH-201)
  • Change Duktape.modLoaded[] module cache to track the "module" object instead of the "exports" value to better support module.exports and circular dependencies
  • Change debugger breakpoint behavior to trigger only if the exact breakpoint line is reached to avoid unintuitive breakpoint behavior when breakpoints are in conditional blocks which are skipped entirely (GH-263)
  • Improve Emscripten compatibility as a result of TypedArray support: Emscripten fastcomp can now be used and Duktape can run more complex Emscripten-compiled programs (e.g. Lua or Duktape itself)
  • Internal performance improvement: add a fast path for JSON.stringify(), active when no replacer and no indent used; fast path is not enabled by default because it makes some non-portable type assumptions (GH-204)
  • Minor change to plain buffer and Duktape.Buffer write coercion for consistency with Node.js Buffer and TypeArray, e.g. -Infinity now coerces to 0x00 rather than 0xFF
  • Add support for an external date/time provider to make porting the Date built-in to exotic platforms easier
  • Add duk_dump_function() and duk_load_function() API calls which provide bytecode dump/load support (GH-27)
  • Add duk_pnew() API call (GH-124)
  • Add duk_instanceof() API call (GH-148)
  • Add Proxy object support to 'instanceof' operator (without support for 'getPrototypeOf' trap) (GH-182)
  • Add explicit 'this' binding for C eval calls so that strict eval code also gets 'this' bound to the global object (GH-164)
  • Change typing of "duk_context" from "void" to "struct duk_hthread" which should improve compiler warnings/errors when accidentally passing an invalid "ctx" pointer to a Duktape API call (GH-178)
  • Add internal assertions for validating the "ctx" pointer beyond just a NULL check (GH-178)
  • Add platform detection support for AmigaOS on PowerPC (GH-269)
  • Internal performance improvement: improve bytecode opcode dispatch performance (GH-265, GH-294)
  • Internal performance improvement: improve bytecode executor constant lookups (GH-295)
  • Internal performance improvement: improve lexer tokenization (GH-207)
  • Internal performance improvement: add several fast paths to JSON parse and stringify; remove explicit end-of-input check from JSON parsing relying on (guaranteed) NUL termination instead (GH-139, GH-209)
  • Internal performance improvements from removing dynamic buffer spare: small improvements to lexer, compiler bytecode emission, JSON parse() and stringify(), duk_map_string(), global object escape(), unescape() and variants, regexp compilation, string case conversion, and a few other places (GH-209)
  • Sizeof(duk_hbuffer_dynamic) reduced from 16 to 12 bytes for low memory builds which employ heap compression (GH-209)
  • Increase try-catch register limit (from 511 to 262143) to fix try-catch out-of-register issues for most code (GH-145)
  • Remove DUK_OPT_DEEP_C_STACK (and DUK_USE_DEEP_C_STACK) in favor of explicit DUK_USE_xxx config options for native recursion limits; C stacks are assumed to be deep by default for all targets including OSX/iPhone (GH-165, GH-226)
  • Make Proxy internal _Target and _Handler properties immutable (non-writable and non-configurable) (GH-237)
  • Remove internal support for dynamic buffer spare; improves performance a bit, reduces duk_hbuffer_dynamic footprint for both normal and low memory header (GH-209)
  • Incompatible change to debugger DumpHeap command format: dynamic buffer alloc size is no long sent because it was removed from the internal data structure (GH-209)
  • Add example debug transport with local dvalue encoding and decoding, also provides a C example for encoding and decoding dvalues (GH-251)
  • Provide at least 10 callstack entries for error handling (Duktape.errCreate) when callstack limit is reached (GH-191)
  • Fix a try-finally finalizer side effect issue by scrubbing TRYCATCH catch registers before executing the try code block (GH-287)
  • Fix missing activation lookup from call handling after an Arguments object was created, this could in theory lead to memory unsafe behavior (GH-305)
  • Fix debugger GetCallStack line number handling for callstack entries below the callstack top (GH-281)
  • Fix debugger breakpoint/pause check when a function call is caused by a side effect like a property getter call (GH-303)
  • Fix object environment handling to allow Proxy object as a binding target, so that a Proxy can be used in a with statement or as the duk_set_global_object() argument (GH-221)
  • Fix accidental ToString(this) coercion in Error.prototype.fileName and Error.prototype.lineNumber which was an issue if you replaced Error.prototype.toString with a function that accessed the 'lineNumber' or 'fileName' property of the error (GH-254)
  • Fix bytecode execution timeout regression which caused timeouts to fail after the first execution timeout had been triggered (GH-212)
  • Fix some corner cases in execution timeout handling which caused some timeouts to be missed (GH-214)
  • Fix potential NULL pointer dereference in duk_is_dynamic_buffer() and duk_is_fixed_buffer() when index is outside of value stack (GH-206)
  • Fix duk_push_nan() NaN normalization bug which caused segfaults when using MSVC on x86 and potentially on other 32-bit platforms (GH-168)
  • Fix JX parsing bug which caused strings like "1Infinity" to be parsed as negative infinity instead of causing a SyntaxError (GH-247)
  • Fix duk_is_primitive() return value for invalid index, was incorrectly 1 (GH-337)
  • Fix compile error from array fast path when using low memory options (GH-174)
  • Fix a few pointer compression issues (DUK_OPT_HEAPPTR16 / DUK_USE_HEAPPTR16) on 64-bit platforms (GH-228)
  • Fix a bug in number conversion resolving a few (but not all) corner case rounding issues (GH-264)
  • Fix IAR Compiler compilation error caused by volatiles in argument list (GH-318)
  • Fix harmless MSVC warnings when using DUK_OPT_FASTINT on x86 (GH-172)
  • Fix harmless MSVC warnings for size_t casts on x64 (GH-177)
  • Avoid including <windows.h> for application build (GH-312)

1.3.1 (2015-11-27)

  • Fix assignment expression handling of the right-hand-side value when that value is a register-bound variable which is used and mutated in the rest of the expression (GH-381)
  • Fix nested property assignment handling (GH-427, GH-428)
  • Fix property access expression handling when a variable holding the base value is mutated by other parts of the expression, in both LHS and RHS positions (GH-429)
  • Remove octal autodetection in parseInt(), also fixes incorrect octal autodetection in e.g. "parseInt('00e1', 16)" (GH-413, GH-414)
  • Fix a segfault (and assertion error) caused by compiler intermediate value handling bug; the bug was triggered when a temporary register was required by the compiler, but an existing "intermediate value" referred to a const instead of a register value (GH-449)

Planned

1.4.0 (XXXX-XX-XX)

  • Add minimal support for "const" declarations with non-standard semantics, intended mainly for minimal compatibility with existing code using "const" (GH-360)
  • Add a human readable summary of object/key for rejected property operations and function calls to make error messages more useful for expressions like "null.foo = 123" and "null()" (GH-210, GH-405, GH-417)
  • Add a debugger Throw notify for errors about to be thrown, and an option to automatically pause before an uncaught error is thrown (GH-286, GH-347)
  • Add a debugger Detaching notify which informs a debug client of an orderly (or non-orderly) pending detach (GH-423, GH-430, GH-434)
  • Allow debugger detached callback to call duk_debugger_attach(), previously this clobbered some internal state (GH-399)
  • Add defines DUK_DEFPROP{SET,CLEAR}_{WRITABLE,ENUMERABLE,CONFIGURABLE} for duk_def_prop() to improve call site readability (GH-421)
  • Add convenience API calls to detect specific error subtypes, e.g. duk_is_eval_error() (GH-340, GH-433)
  • Make Error instance .filename, .lineNumber, and .stack directly writable to match V8 and Spidermonkey behavior; the previous behavior is provided by polyfills/duktape-error-setter-nonwritable.js (GH-390)
  • Add duk_require_function() and duk_require_callable() (GH-441)
  • Improve error message verbosity for API index check calls, duk_require_xxx() calls, and Array iterator calls (GH-441)
  • Improve error object .fileName and .lineNumber attribution: if a callstack function is missing a .fileName property, scan the callstack until a function with a .fileName is found which improves error reporting for e.g. "[1,2,3].forEach(null)" (GH-455)
  • Provide a stronger finalizer re-entry guarantee than before: a finalizer is called exactly once (at the latest in heap destruction) unless the target object is rescued, in which case the finalizer is called once per "rescue cycle" (GH-473)
  • Better finalizer behavior for heap destruction: finalized objects may create new finalizable objects whose finalizers will also be called (GH-473)
  • Add a combined duktape.c without #line directives into the dist package, as it is a useful alternative in some environments (GH-363)
  • Add a short term workaround for case sensitive RegExp performance using a 128kB canonicalization lookup table; the workaround is disabled by default because of the relatively large code footprint, enable using DUK_OPT_REGEXP_CANON_WORKAROUND or DUK_USE_REGEXP_CANON_WORKAROUND if editing duk_config.h directly (GH-411)
  • Fix a segfault (and assertion error) caused by compiler intermediate value handling bug; the bug was triggered when a temporary register was required by the compiler, but an existing "intermediate value" referred to a const instead of a register value (GH-449)
  • Fix compile warnings for gcc/clang -Wcast-qual (GH-426)
  • Fix "debugger" statement line number off-by-one so that the debugger now correctly pauses on the debugger statement rather than after it (GH-347)
  • Fix assignment expression handling of the right-hand-side value when that value is a register-bound variable which is used and mutated in the rest of the expression (GH-381)
  • Fix nested property assignment handling (GH-427, GH-428)
  • Fix property access expression handling when a variable holding the base value is mutated by other parts of the expression, in both LHS and RHS positions (GH-429)
  • Fix Unix local time offset handling which caused issues at least on RISC OS (GH-406, GH-407)
  • Fix a bug in stack trace ellipsis ("[...]") handling: previously the ellipsis might be emitted up to 2 callstack levels too early because the presence of a compilation error and/or a C call site was not taken into account in stack trace creation (GH-455)
  • Remove octal autodetection in parseInt(), also fixes incorrect octal autodetection in e.g. "parseInt('00e1', 16)" (GH-413, GH-414)
  • Fix base64 decode reject for whitespace between padding characters (e.g. "Zm= =") (GH-465)
  • Internal performance improvement: rework RETURN opcode handling to avoid longjmp() calls, improving performance slightly on ordinary platforms and significantly on Emscripten (GH-342, GH-345)
  • Internal performance improvement: rework BREAK and CONTINUE opcode handling to avoid longjmp() calls, improving performance slightly on ordinary platforms and significantly on Emscripten (GH-348)
  • Internal performance improvement: improve bytecode emitted when compiling assignment statements with an identifier left-hand-side value, especially when the assignment is a top level expression like "x = y + z;" (GH-380)
  • Internal performance improvement: split bytecode executor into an inner and outer function, with the outer function containing a setjmp/longjmp catch point and the inner function free of setjmp/longjmp (GH-369, GH-370)
  • Internal performance improvement: change value stack initialization policy so that values above current value stack top are set to "undefined" instead of "unused" to improve call performance (GH-389)
  • Internal performance improvement: use a separate 'unused' tag instead of a sub-type of 'undefined' to e.g. mark gaps in arrays (GH-396)
  • Internal performance improvement: rework "effective this" handling for better call performance (GH-397)
  • Internal performance improvement: improve duk_push_this() performance by direct value stack access (GH-403)
  • Internal performance improvement: faster computation of string UTF-8 character length in string interning (GH-422)
  • Internal performance improvement: change default internal string hash algorithm to a faster algorithm adapted from Lua/djb2 hash, with the previous algorithm (based on Murmurhash2) available using a config option (GH-139, GH-432)
  • Internal performance improvement: optimize internal refcount handling macros (GH-394)
  • Internal performance improvement: improve JSON.stringify() slow path indentation and loop detection performance (GH-444, GH-446)
  • Internal performance improvement: improve JSON.stringify() fast path by allowing indent value or gap string and by supporting JX/JC in the fast path (GH-445)
  • Internal performance improvement: add fast paths for hex and base64 encoding/decoding (GH-465, GH-467, GH-471)

2.0.0 (XXXX-XX-XX)

  • Rework Duktape module loading model to be more flexible
  • Ecmascript 6 features will be implemented in v2.x.x at the earliest (some individual features may be cherry picked into v1.x.x)