diff --git a/src/libs/zbxembed/duk_config.h b/src/libs/zbxembed/duk_config.h
index 6910ba8f84..8093492f1a 100644
--- a/src/libs/zbxembed/duk_config.h
+++ b/src/libs/zbxembed/duk_config.h
@@ -1,9 +1,9 @@
 /*
  *  duk_config.h configuration header generated by genconfig.py.
  *
- *  Git commit: d4f2cff1c592d70f58bab8e1bd85705174c02a58
- *  Git describe: v2.4.0
- *  Git branch: master
+ *  Git commit: external
+ *  Git describe: external
+ *  Git branch: external
  *
  *  Supported platforms:
  *      - Mac OSX, iPhone, Darwin
@@ -40,6 +40,8 @@
  *      - PowerPC 64-bit
  *      - SPARC 32-bit
  *      - SPARC 64-bit
+ *      - RISC-V 32-bit
+ *      - RISC-V 64-bit
  *      - SuperH
  *      - Motorola 68k
  *      - Emscripten
@@ -285,6 +287,22 @@
 #endif
 #endif
 
+/* RISC-V, https://github.com/riscv/riscv-toolchain-conventions#cc-preprocessor-definitions */
+#if defined(__riscv)
+#define DUK_F_RISCV
+#if defined(__riscv_xlen)
+#if (__riscv_xlen == 32)
+#define DUK_F_RISCV32
+#elif (__riscv_xlen == 64)
+#define DUK_F_RISCV64
+#else
+#error __riscv_xlen has unsupported value (not 32 or 64)
+#endif
+#else
+#error __riscv defined without __riscv_xlen
+#endif
+#endif  /* __riscv */
+
 /* SuperH */
 #if defined(__sh__) || \
     defined(__sh1__) || defined(__SH1__) || \
@@ -330,7 +348,7 @@
 #endif
 
 /* MinGW.  Also GCC flags (DUK_F_GCC) are enabled now. */
-#if defined(__MINGW32__)
+#if defined(__MINGW32__) || defined(__MINGW64__)
 #define DUK_F_MINGW
 #endif
 
@@ -747,8 +765,11 @@
 #if defined(DUK_F_OLD_SOLARIS)
 /* Old Solaris with no endian.h, stdint.h */
 #define DUK_F_NO_STDINT_H
+#if !defined(DUK_USE_BYTEORDER)
+#define DUK_USE_BYTEORDER 3
+#endif
 #else  /* DUK_F_OLD_SOLARIS */
-#include <ast/endian.h>
+#include <sys/param.h>
 #endif  /* DUK_F_OLD_SOLARIS */
 
 #include <sys/param.h>
@@ -935,13 +956,15 @@
 #elif defined(DUK_F_PPC32)
 /* --- PowerPC 32-bit --- */
 #define DUK_USE_ARCH_STRING "ppc32"
-/* Byte order varies, so rely on autodetect. */
+#if !defined(DUK_USE_BYTEORDER)
+#define DUK_USE_BYTEORDER 3
+#endif
 #define DUK_USE_PACKED_TVAL
 #define DUK_F_PACKED_TVAL_PROVIDED
 #elif defined(DUK_F_PPC64)
 /* --- PowerPC 64-bit --- */
 #define DUK_USE_ARCH_STRING "ppc64"
-/* Byte order varies, so rely on autodetect. */
+/* No forced byteorder (both little and big endian are possible). */
 #undef DUK_USE_PACKED_TVAL
 #define DUK_F_PACKED_TVAL_PROVIDED
 #elif defined(DUK_F_SPARC32)
@@ -956,6 +979,18 @@
 /* SPARC byte order varies so rely on autodetection. */
 #undef DUK_USE_PACKED_TVAL
 #define DUK_F_PACKED_TVAL_PROVIDED
+#elif defined(DUK_F_RISCV32)
+/* --- RISC-V 32-bit --- */
+#define DUK_USE_ARCH_STRING "riscv32"
+#define DUK_USE_BYTEORDER 1
+#define DUK_USE_PACKED_TVAL
+#define DUK_F_PACKED_TVAL_PROVIDED
+#elif defined(DUK_F_RISCV64)
+/* --- RISC-V 64-bit --- */
+#define DUK_USE_ARCH_STRING "riscv64"
+#define DUK_USE_BYTEORDER 1
+#undef DUK_USE_PACKED_TVAL
+#define DUK_F_PACKED_TVAL_PROVIDED
 #elif defined(DUK_F_SUPERH)
 /* --- SuperH --- */
 #define DUK_USE_ARCH_STRING "sh"
@@ -1096,7 +1131,7 @@
 #define DUK_USE_FLEX_ZEROSIZE
 #endif
 
-#undef DUK_USE_GCC_PRAGMAS
+#define DUK_USE_CLANG_PRAGMAS
 #define DUK_USE_PACK_CLANG_ATTR
 
 #if defined(__clang__) && defined(__has_builtin)
@@ -1236,6 +1271,7 @@
 #define DUK_USE_FLEX_ZEROSIZE
 #endif
 
+/* Since 4.6 one can '#pragma GCC diagnostic push/pop'. */
 #if defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 40600)
 #define DUK_USE_GCC_PRAGMAS
 #else
@@ -2290,10 +2326,6 @@ typedef struct duk_hthread duk_context;
 #elif defined(DUK_F_AIX)
 /* Older versions may be missing isnan(), etc. */
 #define DUK_F_USE_REPL_ALL
-#elif defined(DUK_F_OLD_SOLARIS)
-/* Solaris 11.3 seem to be missing fsnotify, isnan etc and also ast/endian.h header.        */
-/* Forcing DUK_F_OLD_SOLARIS fixes include, so bind the replacements to this define as well */
-#define DUK_F_USE_REPL_ALL
 #endif
 
 #if defined(DUK_F_USE_REPL_ALL)
@@ -2645,12 +2677,15 @@ typedef struct duk_hthread duk_context;
 #define DUK_WO_NORETURN(stmt) do { stmt } while (0)
 #endif
 
-#if !defined(DUK_UNREACHABLE)
+#if defined(DUK_UNREACHABLE)
+#define DUK_WO_UNREACHABLE(stmt) do { } while (0)
+#else
 /* Don't know how to declare unreachable point, so don't do it; this
  * may cause some spurious compilation warnings (e.g. "variable used
  * uninitialized").
  */
 #define DUK_UNREACHABLE()  do { } while (0)
+#define DUK_WO_UNREACHABLE(stmt) do { stmt } while (0)
 #endif
 
 #if !defined(DUK_LOSE_CONST)
@@ -2858,6 +2893,12 @@ typedef struct duk_hthread duk_context;
 #error __FAST_MATH__ defined, refusing to compile
 #endif
 
+/*
+ *  Forced options
+ */
+
+#undef DUK_USE_JSON_STRINGIFY_FASTPATH
+
 /*
  *  Autogenerated defaults
  */
@@ -2879,6 +2920,10 @@ typedef struct duk_hthread duk_context;
 #define DUK_USE_CACHE_ACTIVATION
 #define DUK_USE_CACHE_CATCHER
 #define DUK_USE_CALLSTACK_LIMIT 10000
+#define DUK_USE_CBOR_BUILTIN
+#define DUK_USE_CBOR_DEC_RECLIMIT 1000
+#define DUK_USE_CBOR_ENC_RECLIMIT 1000
+#define DUK_USE_CBOR_SUPPORT
 #define DUK_USE_COMPILER_RECLIMIT 2500
 #define DUK_USE_COROUTINE_SUPPORT
 #undef DUK_USE_CPP_EXCEPTIONS
@@ -2942,7 +2987,7 @@ typedef struct duk_hthread duk_context;
 #undef DUK_USE_GC_TORTURE
 #undef DUK_USE_GET_MONOTONIC_TIME
 #undef DUK_USE_GET_RANDOM_DOUBLE
-#undef DUK_USE_GLOBAL_BINDING
+#define DUK_USE_GLOBAL_BINDING
 #define DUK_USE_GLOBAL_BUILTIN
 #undef DUK_USE_HEAPPTR16
 #undef DUK_USE_HEAPPTR_DEC16
@@ -2950,6 +2995,7 @@ typedef struct duk_hthread duk_context;
 #define DUK_USE_HEX_FASTPATH
 #define DUK_USE_HEX_SUPPORT
 #define DUK_USE_HOBJECT_ARRAY_ABANDON_LIMIT 2
+#define DUK_USE_HOBJECT_ARRAY_ABANDON_MINSIZE 257
 #define DUK_USE_HOBJECT_ARRAY_FAST_RESIZE_LIMIT 9
 #define DUK_USE_HOBJECT_ARRAY_MINGROW_ADD 16
 #define DUK_USE_HOBJECT_ARRAY_MINGROW_DIVISOR 8
@@ -2974,7 +3020,6 @@ typedef struct duk_hthread duk_context;
 #define DUK_USE_JSON_EATWHITE_FASTPATH
 #define DUK_USE_JSON_ENC_RECLIMIT 1000
 #define DUK_USE_JSON_QUOTESTRING_FASTPATH
-#undef DUK_USE_JSON_STRINGIFY_FASTPATH
 #define DUK_USE_JSON_SUPPORT
 #define DUK_USE_JX
 #define DUK_USE_LEXER_SLIDING_WINDOW
@@ -3140,587 +3185,6 @@ int	zbx_es_check_timeout(void *);
 
 #endif  /* DUK_COMPILING_DUKTAPE */
 
-/*
- *  Checks for legacy feature options (DUK_OPT_xxx)
- */
-
-#if defined(DUK_OPT_ASSERTIONS)
-#error unsupported legacy feature option DUK_OPT_ASSERTIONS used
-#endif
-#if defined(DUK_OPT_BUFFEROBJECT_SUPPORT)
-#error unsupported legacy feature option DUK_OPT_BUFFEROBJECT_SUPPORT used
-#endif
-#if defined(DUK_OPT_BUFLEN16)
-#error unsupported legacy feature option DUK_OPT_BUFLEN16 used
-#endif
-#if defined(DUK_OPT_DATAPTR16)
-#error unsupported legacy feature option DUK_OPT_DATAPTR16 used
-#endif
-#if defined(DUK_OPT_DATAPTR_DEC16)
-#error unsupported legacy feature option DUK_OPT_DATAPTR_DEC16 used
-#endif
-#if defined(DUK_OPT_DATAPTR_ENC16)
-#error unsupported legacy feature option DUK_OPT_DATAPTR_ENC16 used
-#endif
-#if defined(DUK_OPT_DDDPRINT)
-#error unsupported legacy feature option DUK_OPT_DDDPRINT used
-#endif
-#if defined(DUK_OPT_DDPRINT)
-#error unsupported legacy feature option DUK_OPT_DDPRINT used
-#endif
-#if defined(DUK_OPT_DEBUG)
-#error unsupported legacy feature option DUK_OPT_DEBUG used
-#endif
-#if defined(DUK_OPT_DEBUGGER_DUMPHEAP)
-#error unsupported legacy feature option DUK_OPT_DEBUGGER_DUMPHEAP used
-#endif
-#if defined(DUK_OPT_DEBUGGER_FWD_LOGGING)
-#error unsupported legacy feature option DUK_OPT_DEBUGGER_FWD_LOGGING used
-#endif
-#if defined(DUK_OPT_DEBUGGER_FWD_PRINTALERT)
-#error unsupported legacy feature option DUK_OPT_DEBUGGER_FWD_PRINTALERT used
-#endif
-#if defined(DUK_OPT_DEBUGGER_SUPPORT)
-#error unsupported legacy feature option DUK_OPT_DEBUGGER_SUPPORT used
-#endif
-#if defined(DUK_OPT_DEBUGGER_TRANSPORT_TORTURE)
-#error unsupported legacy feature option DUK_OPT_DEBUGGER_TRANSPORT_TORTURE used
-#endif
-#if defined(DUK_OPT_DEBUG_BUFSIZE)
-#error unsupported legacy feature option DUK_OPT_DEBUG_BUFSIZE used
-#endif
-#if defined(DUK_OPT_DECLARE)
-#error unsupported legacy feature option DUK_OPT_DECLARE used
-#endif
-#if defined(DUK_OPT_DEEP_C_STACK)
-#error unsupported legacy feature option DUK_OPT_DEEP_C_STACK used
-#endif
-#if defined(DUK_OPT_DLL_BUILD)
-#error unsupported legacy feature option DUK_OPT_DLL_BUILD used
-#endif
-#if defined(DUK_OPT_DPRINT)
-#error unsupported legacy feature option DUK_OPT_DPRINT used
-#endif
-#if defined(DUK_OPT_DPRINT_COLORS)
-#error unsupported legacy feature option DUK_OPT_DPRINT_COLORS used
-#endif
-#if defined(DUK_OPT_DPRINT_RDTSC)
-#error unsupported legacy feature option DUK_OPT_DPRINT_RDTSC used
-#endif
-#if defined(DUK_OPT_EXEC_TIMEOUT_CHECK)
-#error unsupported legacy feature option DUK_OPT_EXEC_TIMEOUT_CHECK used
-#endif
-#if defined(DUK_OPT_EXTERNAL_STRINGS)
-#error unsupported legacy feature option DUK_OPT_EXTERNAL_STRINGS used
-#endif
-#if defined(DUK_OPT_EXTSTR_FREE)
-#error unsupported legacy feature option DUK_OPT_EXTSTR_FREE used
-#endif
-#if defined(DUK_OPT_EXTSTR_INTERN_CHECK)
-#error unsupported legacy feature option DUK_OPT_EXTSTR_INTERN_CHECK used
-#endif
-#if defined(DUK_OPT_FASTINT)
-#error unsupported legacy feature option DUK_OPT_FASTINT used
-#endif
-#if defined(DUK_OPT_FORCE_ALIGN)
-#error unsupported legacy feature option DUK_OPT_FORCE_ALIGN used
-#endif
-#if defined(DUK_OPT_FORCE_BYTEORDER)
-#error unsupported legacy feature option DUK_OPT_FORCE_BYTEORDER used
-#endif
-#if defined(DUK_OPT_FUNCPTR16)
-#error unsupported legacy feature option DUK_OPT_FUNCPTR16 used
-#endif
-#if defined(DUK_OPT_FUNCPTR_DEC16)
-#error unsupported legacy feature option DUK_OPT_FUNCPTR_DEC16 used
-#endif
-#if defined(DUK_OPT_FUNCPTR_ENC16)
-#error unsupported legacy feature option DUK_OPT_FUNCPTR_ENC16 used
-#endif
-#if defined(DUK_OPT_FUNC_NONSTD_CALLER_PROPERTY)
-#error unsupported legacy feature option DUK_OPT_FUNC_NONSTD_CALLER_PROPERTY used
-#endif
-#if defined(DUK_OPT_FUNC_NONSTD_SOURCE_PROPERTY)
-#error unsupported legacy feature option DUK_OPT_FUNC_NONSTD_SOURCE_PROPERTY used
-#endif
-#if defined(DUK_OPT_GC_TORTURE)
-#error unsupported legacy feature option DUK_OPT_GC_TORTURE used
-#endif
-#if defined(DUK_OPT_HAVE_CUSTOM_H)
-#error unsupported legacy feature option DUK_OPT_HAVE_CUSTOM_H used
-#endif
-#if defined(DUK_OPT_HEAPPTR16)
-#error unsupported legacy feature option DUK_OPT_HEAPPTR16 used
-#endif
-#if defined(DUK_OPT_HEAPPTR_DEC16)
-#error unsupported legacy feature option DUK_OPT_HEAPPTR_DEC16 used
-#endif
-#if defined(DUK_OPT_HEAPPTR_ENC16)
-#error unsupported legacy feature option DUK_OPT_HEAPPTR_ENC16 used
-#endif
-#if defined(DUK_OPT_INTERRUPT_COUNTER)
-#error unsupported legacy feature option DUK_OPT_INTERRUPT_COUNTER used
-#endif
-#if defined(DUK_OPT_JSON_STRINGIFY_FASTPATH)
-#error unsupported legacy feature option DUK_OPT_JSON_STRINGIFY_FASTPATH used
-#endif
-#if defined(DUK_OPT_LIGHTFUNC_BUILTINS)
-#error unsupported legacy feature option DUK_OPT_LIGHTFUNC_BUILTINS used
-#endif
-#if defined(DUK_OPT_NONSTD_FUNC_CALLER_PROPERTY)
-#error unsupported legacy feature option DUK_OPT_NONSTD_FUNC_CALLER_PROPERTY used
-#endif
-#if defined(DUK_OPT_NONSTD_FUNC_SOURCE_PROPERTY)
-#error unsupported legacy feature option DUK_OPT_NONSTD_FUNC_SOURCE_PROPERTY used
-#endif
-#if defined(DUK_OPT_NO_ARRAY_SPLICE_NONSTD_DELCOUNT)
-#error unsupported legacy feature option DUK_OPT_NO_ARRAY_SPLICE_NONSTD_DELCOUNT used
-#endif
-#if defined(DUK_OPT_NO_AUGMENT_ERRORS)
-#error unsupported legacy feature option DUK_OPT_NO_AUGMENT_ERRORS used
-#endif
-#if defined(DUK_OPT_NO_BROWSER_LIKE)
-#error unsupported legacy feature option DUK_OPT_NO_BROWSER_LIKE used
-#endif
-#if defined(DUK_OPT_NO_BUFFEROBJECT_SUPPORT)
-#error unsupported legacy feature option DUK_OPT_NO_BUFFEROBJECT_SUPPORT used
-#endif
-#if defined(DUK_OPT_NO_BYTECODE_DUMP_SUPPORT)
-#error unsupported legacy feature option DUK_OPT_NO_BYTECODE_DUMP_SUPPORT used
-#endif
-#if defined(DUK_OPT_NO_COMMONJS_MODULES)
-#error unsupported legacy feature option DUK_OPT_NO_COMMONJS_MODULES used
-#endif
-#if defined(DUK_OPT_NO_ES6_OBJECT_PROTO_PROPERTY)
-#error unsupported legacy feature option DUK_OPT_NO_ES6_OBJECT_PROTO_PROPERTY used
-#endif
-#if defined(DUK_OPT_NO_ES6_OBJECT_SETPROTOTYPEOF)
-#error unsupported legacy feature option DUK_OPT_NO_ES6_OBJECT_SETPROTOTYPEOF used
-#endif
-#if defined(DUK_OPT_NO_ES6_PROXY)
-#error unsupported legacy feature option DUK_OPT_NO_ES6_PROXY used
-#endif
-#if defined(DUK_OPT_NO_FILE_IO)
-#error unsupported legacy feature option DUK_OPT_NO_FILE_IO used
-#endif
-#if defined(DUK_OPT_NO_FUNC_STMT)
-#error unsupported legacy feature option DUK_OPT_NO_FUNC_STMT used
-#endif
-#if defined(DUK_OPT_NO_JC)
-#error unsupported legacy feature option DUK_OPT_NO_JC used
-#endif
-#if defined(DUK_OPT_NO_JSONC)
-#error unsupported legacy feature option DUK_OPT_NO_JSONC used
-#endif
-#if defined(DUK_OPT_NO_JSONX)
-#error unsupported legacy feature option DUK_OPT_NO_JSONX used
-#endif
-#if defined(DUK_OPT_NO_JX)
-#error unsupported legacy feature option DUK_OPT_NO_JX used
-#endif
-#if defined(DUK_OPT_NO_MARK_AND_SWEEP)
-#error unsupported legacy feature option DUK_OPT_NO_MARK_AND_SWEEP used
-#endif
-#if defined(DUK_OPT_NO_MS_STRINGTABLE_RESIZE)
-#error unsupported legacy feature option DUK_OPT_NO_MS_STRINGTABLE_RESIZE used
-#endif
-#if defined(DUK_OPT_NO_NONSTD_ACCESSOR_KEY_ARGUMENT)
-#error unsupported legacy feature option DUK_OPT_NO_NONSTD_ACCESSOR_KEY_ARGUMENT used
-#endif
-#if defined(DUK_OPT_NO_NONSTD_ARRAY_CONCAT_TRAILER)
-#error unsupported legacy feature option DUK_OPT_NO_NONSTD_ARRAY_CONCAT_TRAILER used
-#endif
-#if defined(DUK_OPT_NO_NONSTD_ARRAY_MAP_TRAILER)
-#error unsupported legacy feature option DUK_OPT_NO_NONSTD_ARRAY_MAP_TRAILER used
-#endif
-#if defined(DUK_OPT_NO_NONSTD_ARRAY_SPLICE_DELCOUNT)
-#error unsupported legacy feature option DUK_OPT_NO_NONSTD_ARRAY_SPLICE_DELCOUNT used
-#endif
-#if defined(DUK_OPT_NO_NONSTD_FUNC_STMT)
-#error unsupported legacy feature option DUK_OPT_NO_NONSTD_FUNC_STMT used
-#endif
-#if defined(DUK_OPT_NO_NONSTD_JSON_ESC_U2028_U2029)
-#error unsupported legacy feature option DUK_OPT_NO_NONSTD_JSON_ESC_U2028_U2029 used
-#endif
-#if defined(DUK_OPT_NO_NONSTD_STRING_FROMCHARCODE_32BIT)
-#error unsupported legacy feature option DUK_OPT_NO_NONSTD_STRING_FROMCHARCODE_32BIT used
-#endif
-#if defined(DUK_OPT_NO_OBJECT_ES6_PROTO_PROPERTY)
-#error unsupported legacy feature option DUK_OPT_NO_OBJECT_ES6_PROTO_PROPERTY used
-#endif
-#if defined(DUK_OPT_NO_OBJECT_ES6_SETPROTOTYPEOF)
-#error unsupported legacy feature option DUK_OPT_NO_OBJECT_ES6_SETPROTOTYPEOF used
-#endif
-#if defined(DUK_OPT_NO_OCTAL_SUPPORT)
-#error unsupported legacy feature option DUK_OPT_NO_OCTAL_SUPPORT used
-#endif
-#if defined(DUK_OPT_NO_PACKED_TVAL)
-#error unsupported legacy feature option DUK_OPT_NO_PACKED_TVAL used
-#endif
-#if defined(DUK_OPT_NO_PC2LINE)
-#error unsupported legacy feature option DUK_OPT_NO_PC2LINE used
-#endif
-#if defined(DUK_OPT_NO_REFERENCE_COUNTING)
-#error unsupported legacy feature option DUK_OPT_NO_REFERENCE_COUNTING used
-#endif
-#if defined(DUK_OPT_NO_REGEXP_SUPPORT)
-#error unsupported legacy feature option DUK_OPT_NO_REGEXP_SUPPORT used
-#endif
-#if defined(DUK_OPT_NO_SECTION_B)
-#error unsupported legacy feature option DUK_OPT_NO_SECTION_B used
-#endif
-#if defined(DUK_OPT_NO_SOURCE_NONBMP)
-#error unsupported legacy feature option DUK_OPT_NO_SOURCE_NONBMP used
-#endif
-#if defined(DUK_OPT_NO_STRICT_DECL)
-#error unsupported legacy feature option DUK_OPT_NO_STRICT_DECL used
-#endif
-#if defined(DUK_OPT_NO_TRACEBACKS)
-#error unsupported legacy feature option DUK_OPT_NO_TRACEBACKS used
-#endif
-#if defined(DUK_OPT_NO_VERBOSE_ERRORS)
-#error unsupported legacy feature option DUK_OPT_NO_VERBOSE_ERRORS used
-#endif
-#if defined(DUK_OPT_NO_VOLUNTARY_GC)
-#error unsupported legacy feature option DUK_OPT_NO_VOLUNTARY_GC used
-#endif
-#if defined(DUK_OPT_NO_ZERO_BUFFER_DATA)
-#error unsupported legacy feature option DUK_OPT_NO_ZERO_BUFFER_DATA used
-#endif
-#if defined(DUK_OPT_OBJSIZES16)
-#error unsupported legacy feature option DUK_OPT_OBJSIZES16 used
-#endif
-#if defined(DUK_OPT_PANIC_HANDLER)
-#error unsupported legacy feature option DUK_OPT_PANIC_HANDLER used
-#endif
-#if defined(DUK_OPT_REFCOUNT16)
-#error unsupported legacy feature option DUK_OPT_REFCOUNT16 used
-#endif
-#if defined(DUK_OPT_SEGFAULT_ON_PANIC)
-#error unsupported legacy feature option DUK_OPT_SEGFAULT_ON_PANIC used
-#endif
-#if defined(DUK_OPT_SELF_TESTS)
-#error unsupported legacy feature option DUK_OPT_SELF_TESTS used
-#endif
-#if defined(DUK_OPT_SETJMP)
-#error unsupported legacy feature option DUK_OPT_SETJMP used
-#endif
-#if defined(DUK_OPT_SHUFFLE_TORTURE)
-#error unsupported legacy feature option DUK_OPT_SHUFFLE_TORTURE used
-#endif
-#if defined(DUK_OPT_SIGSETJMP)
-#error unsupported legacy feature option DUK_OPT_SIGSETJMP used
-#endif
-#if defined(DUK_OPT_STRHASH16)
-#error unsupported legacy feature option DUK_OPT_STRHASH16 used
-#endif
-#if defined(DUK_OPT_STRICT_UTF8_SOURCE)
-#error unsupported legacy feature option DUK_OPT_STRICT_UTF8_SOURCE used
-#endif
-#if defined(DUK_OPT_STRLEN16)
-#error unsupported legacy feature option DUK_OPT_STRLEN16 used
-#endif
-#if defined(DUK_OPT_STRTAB_CHAIN)
-#error unsupported legacy feature option DUK_OPT_STRTAB_CHAIN used
-#endif
-#if defined(DUK_OPT_STRTAB_CHAIN_SIZE)
-#error unsupported legacy feature option DUK_OPT_STRTAB_CHAIN_SIZE used
-#endif
-#if defined(DUK_OPT_TARGET_INFO)
-#error unsupported legacy feature option DUK_OPT_TARGET_INFO used
-#endif
-#if defined(DUK_OPT_TRACEBACK_DEPTH)
-#error unsupported legacy feature option DUK_OPT_TRACEBACK_DEPTH used
-#endif
-#if defined(DUK_OPT_UNDERSCORE_SETJMP)
-#error unsupported legacy feature option DUK_OPT_UNDERSCORE_SETJMP used
-#endif
-#if defined(DUK_OPT_USER_INITJS)
-#error unsupported legacy feature option DUK_OPT_USER_INITJS used
-#endif
-
-/*
- *  Checks for config option consistency (DUK_USE_xxx)
- */
-
-#if defined(DUK_USE_32BIT_PTRS)
-#error unsupported config option used (option has been removed): DUK_USE_32BIT_PTRS
-#endif
-#if defined(DUK_USE_ALIGN_4)
-#error unsupported config option used (option has been removed): DUK_USE_ALIGN_4
-#endif
-#if defined(DUK_USE_ALIGN_8)
-#error unsupported config option used (option has been removed): DUK_USE_ALIGN_8
-#endif
-#if defined(DUK_USE_BROWSER_LIKE)
-#error unsupported config option used (option has been removed): DUK_USE_BROWSER_LIKE
-#endif
-#if defined(DUK_USE_BUILTIN_INITJS)
-#error unsupported config option used (option has been removed): DUK_USE_BUILTIN_INITJS
-#endif
-#if defined(DUK_USE_BYTEORDER_FORCED)
-#error unsupported config option used (option has been removed): DUK_USE_BYTEORDER_FORCED
-#endif
-#if defined(DUK_USE_COMMONJS_MODULES)
-#error unsupported config option used (option has been removed): DUK_USE_COMMONJS_MODULES
-#endif
-#if defined(DUK_USE_DATAPTR_DEC16) && !defined(DUK_USE_DATAPTR16)
-#error config option DUK_USE_DATAPTR_DEC16 requires option DUK_USE_DATAPTR16 (which is missing)
-#endif
-#if defined(DUK_USE_DATAPTR_ENC16) && !defined(DUK_USE_DATAPTR16)
-#error config option DUK_USE_DATAPTR_ENC16 requires option DUK_USE_DATAPTR16 (which is missing)
-#endif
-#if defined(DUK_USE_DDDPRINT)
-#error unsupported config option used (option has been removed): DUK_USE_DDDPRINT
-#endif
-#if defined(DUK_USE_DDPRINT)
-#error unsupported config option used (option has been removed): DUK_USE_DDPRINT
-#endif
-#if defined(DUK_USE_DEBUGGER_FWD_LOGGING)
-#error unsupported config option used (option has been removed): DUK_USE_DEBUGGER_FWD_LOGGING
-#endif
-#if defined(DUK_USE_DEBUGGER_FWD_PRINTALERT)
-#error unsupported config option used (option has been removed): DUK_USE_DEBUGGER_FWD_PRINTALERT
-#endif
-#if defined(DUK_USE_DEBUGGER_SUPPORT) && !defined(DUK_USE_INTERRUPT_COUNTER)
-#error config option DUK_USE_DEBUGGER_SUPPORT requires option DUK_USE_INTERRUPT_COUNTER (which is missing)
-#endif
-#if defined(DUK_USE_DEEP_C_STACK)
-#error unsupported config option used (option has been removed): DUK_USE_DEEP_C_STACK
-#endif
-#if defined(DUK_USE_DOUBLE_BE)
-#error unsupported config option used (option has been removed): DUK_USE_DOUBLE_BE
-#endif
-#if defined(DUK_USE_DOUBLE_BE) && defined(DUK_USE_DOUBLE_LE)
-#error config option DUK_USE_DOUBLE_BE conflicts with option DUK_USE_DOUBLE_LE (which is also defined)
-#endif
-#if defined(DUK_USE_DOUBLE_BE) && defined(DUK_USE_DOUBLE_ME)
-#error config option DUK_USE_DOUBLE_BE conflicts with option DUK_USE_DOUBLE_ME (which is also defined)
-#endif
-#if defined(DUK_USE_DOUBLE_LE)
-#error unsupported config option used (option has been removed): DUK_USE_DOUBLE_LE
-#endif
-#if defined(DUK_USE_DOUBLE_LE) && defined(DUK_USE_DOUBLE_BE)
-#error config option DUK_USE_DOUBLE_LE conflicts with option DUK_USE_DOUBLE_BE (which is also defined)
-#endif
-#if defined(DUK_USE_DOUBLE_LE) && defined(DUK_USE_DOUBLE_ME)
-#error config option DUK_USE_DOUBLE_LE conflicts with option DUK_USE_DOUBLE_ME (which is also defined)
-#endif
-#if defined(DUK_USE_DOUBLE_ME)
-#error unsupported config option used (option has been removed): DUK_USE_DOUBLE_ME
-#endif
-#if defined(DUK_USE_DOUBLE_ME) && defined(DUK_USE_DOUBLE_LE)
-#error config option DUK_USE_DOUBLE_ME conflicts with option DUK_USE_DOUBLE_LE (which is also defined)
-#endif
-#if defined(DUK_USE_DOUBLE_ME) && defined(DUK_USE_DOUBLE_BE)
-#error config option DUK_USE_DOUBLE_ME conflicts with option DUK_USE_DOUBLE_BE (which is also defined)
-#endif
-#if defined(DUK_USE_DPRINT)
-#error unsupported config option used (option has been removed): DUK_USE_DPRINT
-#endif
-#if defined(DUK_USE_DPRINT) && !defined(DUK_USE_DEBUG)
-#error config option DUK_USE_DPRINT requires option DUK_USE_DEBUG (which is missing)
-#endif
-#if defined(DUK_USE_DPRINT_COLORS)
-#error unsupported config option used (option has been removed): DUK_USE_DPRINT_COLORS
-#endif
-#if defined(DUK_USE_DPRINT_RDTSC)
-#error unsupported config option used (option has been removed): DUK_USE_DPRINT_RDTSC
-#endif
-#if defined(DUK_USE_ES6_REGEXP_BRACES)
-#error unsupported config option used (option has been removed): DUK_USE_ES6_REGEXP_BRACES
-#endif
-#if defined(DUK_USE_ESBC_MAX_BYTES) && !defined(DUK_USE_ESBC_LIMITS)
-#error config option DUK_USE_ESBC_MAX_BYTES requires option DUK_USE_ESBC_LIMITS (which is missing)
-#endif
-#if defined(DUK_USE_ESBC_MAX_LINENUMBER) && !defined(DUK_USE_ESBC_LIMITS)
-#error config option DUK_USE_ESBC_MAX_LINENUMBER requires option DUK_USE_ESBC_LIMITS (which is missing)
-#endif
-#if defined(DUK_USE_EXEC_TIMEOUT_CHECK) && !defined(DUK_USE_INTERRUPT_COUNTER)
-#error config option DUK_USE_EXEC_TIMEOUT_CHECK requires option DUK_USE_INTERRUPT_COUNTER (which is missing)
-#endif
-#if defined(DUK_USE_EXTSTR_FREE) && !defined(DUK_USE_HSTRING_EXTDATA)
-#error config option DUK_USE_EXTSTR_FREE requires option DUK_USE_HSTRING_EXTDATA (which is missing)
-#endif
-#if defined(DUK_USE_EXTSTR_INTERN_CHECK) && !defined(DUK_USE_HSTRING_EXTDATA)
-#error config option DUK_USE_EXTSTR_INTERN_CHECK requires option DUK_USE_HSTRING_EXTDATA (which is missing)
-#endif
-#if defined(DUK_USE_FASTINT) && !defined(DUK_USE_64BIT_OPS)
-#error config option DUK_USE_FASTINT requires option DUK_USE_64BIT_OPS (which is missing)
-#endif
-#if defined(DUK_USE_FILE_IO)
-#error unsupported config option used (option has been removed): DUK_USE_FILE_IO
-#endif
-#if defined(DUK_USE_FULL_TVAL)
-#error unsupported config option used (option has been removed): DUK_USE_FULL_TVAL
-#endif
-#if defined(DUK_USE_FUNCPTR_DEC16) && !defined(DUK_USE_FUNCPTR16)
-#error config option DUK_USE_FUNCPTR_DEC16 requires option DUK_USE_FUNCPTR16 (which is missing)
-#endif
-#if defined(DUK_USE_FUNCPTR_ENC16) && !defined(DUK_USE_FUNCPTR16)
-#error config option DUK_USE_FUNCPTR_ENC16 requires option DUK_USE_FUNCPTR16 (which is missing)
-#endif
-#if defined(DUK_USE_HASHBYTES_UNALIGNED_U32_ACCESS)
-#error unsupported config option used (option has been removed): DUK_USE_HASHBYTES_UNALIGNED_U32_ACCESS
-#endif
-#if defined(DUK_USE_HEAPPTR16) && defined(DUK_USE_DEBUG)
-#error config option DUK_USE_HEAPPTR16 conflicts with option DUK_USE_DEBUG (which is also defined)
-#endif
-#if defined(DUK_USE_HEAPPTR_DEC16) && !defined(DUK_USE_HEAPPTR16)
-#error config option DUK_USE_HEAPPTR_DEC16 requires option DUK_USE_HEAPPTR16 (which is missing)
-#endif
-#if defined(DUK_USE_HEAPPTR_ENC16) && !defined(DUK_USE_HEAPPTR16)
-#error config option DUK_USE_HEAPPTR_ENC16 requires option DUK_USE_HEAPPTR16 (which is missing)
-#endif
-#if defined(DUK_USE_INTEGER_BE)
-#error unsupported config option used (option has been removed): DUK_USE_INTEGER_BE
-#endif
-#if defined(DUK_USE_INTEGER_BE) && defined(DUK_USE_INTEGER_LE)
-#error config option DUK_USE_INTEGER_BE conflicts with option DUK_USE_INTEGER_LE (which is also defined)
-#endif
-#if defined(DUK_USE_INTEGER_BE) && defined(DUK_USE_INTEGER_ME)
-#error config option DUK_USE_INTEGER_BE conflicts with option DUK_USE_INTEGER_ME (which is also defined)
-#endif
-#if defined(DUK_USE_INTEGER_LE)
-#error unsupported config option used (option has been removed): DUK_USE_INTEGER_LE
-#endif
-#if defined(DUK_USE_INTEGER_LE) && defined(DUK_USE_INTEGER_BE)
-#error config option DUK_USE_INTEGER_LE conflicts with option DUK_USE_INTEGER_BE (which is also defined)
-#endif
-#if defined(DUK_USE_INTEGER_LE) && defined(DUK_USE_INTEGER_ME)
-#error config option DUK_USE_INTEGER_LE conflicts with option DUK_USE_INTEGER_ME (which is also defined)
-#endif
-#if defined(DUK_USE_INTEGER_ME)
-#error unsupported config option used (option has been removed): DUK_USE_INTEGER_ME
-#endif
-#if defined(DUK_USE_INTEGER_ME) && defined(DUK_USE_INTEGER_LE)
-#error config option DUK_USE_INTEGER_ME conflicts with option DUK_USE_INTEGER_LE (which is also defined)
-#endif
-#if defined(DUK_USE_INTEGER_ME) && defined(DUK_USE_INTEGER_BE)
-#error config option DUK_USE_INTEGER_ME conflicts with option DUK_USE_INTEGER_BE (which is also defined)
-#endif
-#if defined(DUK_USE_MARKANDSWEEP_FINALIZER_TORTURE)
-#error unsupported config option used (option has been removed): DUK_USE_MARKANDSWEEP_FINALIZER_TORTURE
-#endif
-#if defined(DUK_USE_MARK_AND_SWEEP)
-#error unsupported config option used (option has been removed): DUK_USE_MARK_AND_SWEEP
-#endif
-#if defined(DUK_USE_MATH_FMAX)
-#error unsupported config option used (option has been removed): DUK_USE_MATH_FMAX
-#endif
-#if defined(DUK_USE_MATH_FMIN)
-#error unsupported config option used (option has been removed): DUK_USE_MATH_FMIN
-#endif
-#if defined(DUK_USE_MATH_ROUND)
-#error unsupported config option used (option has been removed): DUK_USE_MATH_ROUND
-#endif
-#if defined(DUK_USE_MS_STRINGTABLE_RESIZE)
-#error unsupported config option used (option has been removed): DUK_USE_MS_STRINGTABLE_RESIZE
-#endif
-#if defined(DUK_USE_NONSTD_ARRAY_CONCAT_TRAILER)
-#error unsupported config option used (option has been removed): DUK_USE_NONSTD_ARRAY_CONCAT_TRAILER
-#endif
-#if defined(DUK_USE_NONSTD_ARRAY_MAP_TRAILER)
-#error unsupported config option used (option has been removed): DUK_USE_NONSTD_ARRAY_MAP_TRAILER
-#endif
-#if defined(DUK_USE_NONSTD_REGEXP_DOLLAR_ESCAPE)
-#error unsupported config option used (option has been removed): DUK_USE_NONSTD_REGEXP_DOLLAR_ESCAPE
-#endif
-#if defined(DUK_USE_NO_DOUBLE_ALIASING_SELFTEST)
-#error unsupported config option used (option has been removed): DUK_USE_NO_DOUBLE_ALIASING_SELFTEST
-#endif
-#if defined(DUK_USE_OCTAL_SUPPORT)
-#error unsupported config option used (option has been removed): DUK_USE_OCTAL_SUPPORT
-#endif
-#if defined(DUK_USE_PACKED_TVAL_POSSIBLE)
-#error unsupported config option used (option has been removed): DUK_USE_PACKED_TVAL_POSSIBLE
-#endif
-#if defined(DUK_USE_PANIC_ABORT)
-#error unsupported config option used (option has been removed): DUK_USE_PANIC_ABORT
-#endif
-#if defined(DUK_USE_PANIC_EXIT)
-#error unsupported config option used (option has been removed): DUK_USE_PANIC_EXIT
-#endif
-#if defined(DUK_USE_PANIC_HANDLER)
-#error unsupported config option used (option has been removed): DUK_USE_PANIC_HANDLER
-#endif
-#if defined(DUK_USE_PANIC_SEGFAULT)
-#error unsupported config option used (option has been removed): DUK_USE_PANIC_SEGFAULT
-#endif
-#if defined(DUK_USE_POW_NETBSD_WORKAROUND)
-#error unsupported config option used (option has been removed): DUK_USE_POW_NETBSD_WORKAROUND
-#endif
-#if defined(DUK_USE_RDTSC)
-#error unsupported config option used (option has been removed): DUK_USE_RDTSC
-#endif
-#if defined(DUK_USE_REFZERO_FINALIZER_TORTURE)
-#error unsupported config option used (option has been removed): DUK_USE_REFZERO_FINALIZER_TORTURE
-#endif
-#if defined(DUK_USE_ROM_GLOBAL_CLONE) && !defined(DUK_USE_ROM_STRINGS)
-#error config option DUK_USE_ROM_GLOBAL_CLONE requires option DUK_USE_ROM_STRINGS (which is missing)
-#endif
-#if defined(DUK_USE_ROM_GLOBAL_CLONE) && !defined(DUK_USE_ROM_OBJECTS)
-#error config option DUK_USE_ROM_GLOBAL_CLONE requires option DUK_USE_ROM_OBJECTS (which is missing)
-#endif
-#if defined(DUK_USE_ROM_GLOBAL_CLONE) && defined(DUK_USE_ROM_GLOBAL_INHERIT)
-#error config option DUK_USE_ROM_GLOBAL_CLONE conflicts with option DUK_USE_ROM_GLOBAL_INHERIT (which is also defined)
-#endif
-#if defined(DUK_USE_ROM_GLOBAL_INHERIT) && !defined(DUK_USE_ROM_STRINGS)
-#error config option DUK_USE_ROM_GLOBAL_INHERIT requires option DUK_USE_ROM_STRINGS (which is missing)
-#endif
-#if defined(DUK_USE_ROM_GLOBAL_INHERIT) && !defined(DUK_USE_ROM_OBJECTS)
-#error config option DUK_USE_ROM_GLOBAL_INHERIT requires option DUK_USE_ROM_OBJECTS (which is missing)
-#endif
-#if defined(DUK_USE_ROM_GLOBAL_INHERIT) && defined(DUK_USE_ROM_GLOBAL_CLONE)
-#error config option DUK_USE_ROM_GLOBAL_INHERIT conflicts with option DUK_USE_ROM_GLOBAL_CLONE (which is also defined)
-#endif
-#if defined(DUK_USE_ROM_OBJECTS) && !defined(DUK_USE_ROM_STRINGS)
-#error config option DUK_USE_ROM_OBJECTS requires option DUK_USE_ROM_STRINGS (which is missing)
-#endif
-#if defined(DUK_USE_ROM_STRINGS) && !defined(DUK_USE_ROM_OBJECTS)
-#error config option DUK_USE_ROM_STRINGS requires option DUK_USE_ROM_OBJECTS (which is missing)
-#endif
-#if defined(DUK_USE_SETJMP)
-#error unsupported config option used (option has been removed): DUK_USE_SETJMP
-#endif
-#if defined(DUK_USE_SIGSETJMP)
-#error unsupported config option used (option has been removed): DUK_USE_SIGSETJMP
-#endif
-#if defined(DUK_USE_STRTAB_CHAIN)
-#error unsupported config option used (option has been removed): DUK_USE_STRTAB_CHAIN
-#endif
-#if defined(DUK_USE_STRTAB_CHAIN_SIZE)
-#error unsupported config option used (option has been removed): DUK_USE_STRTAB_CHAIN_SIZE
-#endif
-#if defined(DUK_USE_STRTAB_CHAIN_SIZE) && !defined(DUK_USE_STRTAB_CHAIN)
-#error config option DUK_USE_STRTAB_CHAIN_SIZE requires option DUK_USE_STRTAB_CHAIN (which is missing)
-#endif
-#if defined(DUK_USE_STRTAB_PROBE)
-#error unsupported config option used (option has been removed): DUK_USE_STRTAB_PROBE
-#endif
-#if defined(DUK_USE_STRTAB_PTRCOMP) && !defined(DUK_USE_HEAPPTR16)
-#error config option DUK_USE_STRTAB_PTRCOMP requires option DUK_USE_HEAPPTR16 (which is missing)
-#endif
-#if defined(DUK_USE_TAILCALL) && defined(DUK_USE_NONSTD_FUNC_CALLER_PROPERTY)
-#error config option DUK_USE_TAILCALL conflicts with option DUK_USE_NONSTD_FUNC_CALLER_PROPERTY (which is also defined)
-#endif
-#if defined(DUK_USE_UNALIGNED_ACCESSES_POSSIBLE)
-#error unsupported config option used (option has been removed): DUK_USE_UNALIGNED_ACCESSES_POSSIBLE
-#endif
-#if defined(DUK_USE_UNDERSCORE_SETJMP)
-#error unsupported config option used (option has been removed): DUK_USE_UNDERSCORE_SETJMP
-#endif
-#if defined(DUK_USE_USER_DECLARE)
-#error unsupported config option used (option has been removed): DUK_USE_USER_DECLARE
-#endif
-#if defined(DUK_USE_USER_INITJS)
-#error unsupported config option used (option has been removed): DUK_USE_USER_INITJS
-#endif
-
-#if defined(DUK_USE_CPP_EXCEPTIONS) && !defined(__cplusplus)
-#error DUK_USE_CPP_EXCEPTIONS enabled but not compiling with a C++ compiler
-#endif
-
 /*
  *  Convert DUK_USE_BYTEORDER, from whatever source, into currently used
  *  internal defines.  If detection failed, #error out.
diff --git a/src/libs/zbxembed/duktape.c b/src/libs/zbxembed/duktape.c
index 1146dff9ea..5987fd03df 100644
--- a/src/libs/zbxembed/duktape.c
+++ b/src/libs/zbxembed/duktape.c
@@ -1,8 +1,8 @@
 /*
- *  Single source autogenerated distributable for Duktape 2.4.0.
+ *  Single source autogenerated distributable for Duktape 2.6.0.
  *
- *  Git commit d4f2cff1c592d70f58bab8e1bd85705174c02a58 (v2.4.0).
- *  Git branch master.
+ *  Git commit external (external).
+ *  Git branch external.
  *
  *  See Duktape AUTHORS.rst and LICENSE.txt for copyright and
  *  licensing information.
@@ -104,6 +104,7 @@
 *  * James Swift (https://github.com/phraemer)
 *  * Luis de Bethencourt (https://github.com/luisbg)
 *  * Ian Whyman (https://github.com/v00d00)
+*  * Rick Sayre (https://github.com/whorfin)
 *
 *  Other contributions
 *  ===================
@@ -225,13 +226,14 @@
  *
  *    A B C D E F G H    Big endian (e.g. 68k)           DUK_USE_DOUBLE_BE
  *    H G F E D C B A    Little endian (e.g. x86)        DUK_USE_DOUBLE_LE
- *    D C B A H G F E    Mixed/cross endian (e.g. ARM)   DUK_USE_DOUBLE_ME
+ *    D C B A H G F E    Mixed endian (e.g. ARM FPA)     DUK_USE_DOUBLE_ME
  *
- *  ARM is a special case: ARM double values are in mixed/cross endian
- *  format while ARM duk_uint64_t values are in standard little endian
+ *  Legacy ARM (FPA) is a special case: ARM double values are in mixed
+ *  endian format while ARM duk_uint64_t values are in standard little endian
  *  format (H G F E D C B A).  When a double is read as a duk_uint64_t
  *  from memory, the register will contain the (logical) value
  *  E F G H A B C D.  This requires some special handling below.
+ *  See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0056d/Bcfhgcgd.html.
  *
  *  Indexes of various types (8-bit, 16-bit, 32-bit) in memory relative to
  *  the logical (big endian) order:
@@ -520,7 +522,8 @@ typedef union duk_double_union duk_double_union;
 	} while (0)
 
 #define DUK__DBLUNION_NORMALIZE_NAN_CHECK_NOTFULL(u)  do { \
-		if (DUK__DBLUNION_IS_NAN_NOTFULL((u))) { \
+		/* Check must be full. */ \
+		if (DUK__DBLUNION_IS_NAN_FULL((u))) { \
 			DUK__DBLUNION_SET_NAN_NOTFULL((u)); \
 		} \
 	} while (0)
@@ -532,12 +535,11 @@ typedef union duk_double_union duk_double_union;
  */
 
 #if defined(DUK_USE_PACKED_TVAL)
-#if defined(DUK_USE_FULL_TVAL)
 #define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u)  DUK__DBLUNION_NORMALIZE_NAN_CHECK_FULL((u))
 #define DUK_DBLUNION_IS_NAN(u)               DUK__DBLUNION_IS_NAN_FULL((u))
 #define DUK_DBLUNION_IS_NORMALIZED_NAN(u)    DUK__DBLUNION_IS_NORMALIZED_NAN_FULL((u))
 #define DUK_DBLUNION_SET_NAN(d)              DUK__DBLUNION_SET_NAN_FULL((d))
-#else
+#if 0
 #define DUK_DBLUNION_NORMALIZE_NAN_CHECK(u)  DUK__DBLUNION_NORMALIZE_NAN_CHECK_NOTFULL((u))
 #define DUK_DBLUNION_IS_NAN(u)               DUK__DBLUNION_IS_NAN_NOTFULL((u))
 #define DUK_DBLUNION_IS_NORMALIZED_NAN(u)    DUK__DBLUNION_IS_NORMALIZED_NAN_NOTFULL((u))
@@ -620,6 +622,46 @@ typedef union duk_double_union duk_double_union;
 #endif
 
 #endif  /* DUK_DBLUNION_H_INCLUDED */
+/* #include duk_fltunion.h */
+/*
+ *  Union to access IEEE float memory representation.
+ */
+
+#if !defined(DUK_FLTUNION_H_INCLUDED)
+#define DUK_FLTUNION_H_INCLUDED
+
+/* #include duk_internal.h -> already included */
+
+union duk_float_union {
+	float f;
+	duk_uint32_t ui[1];
+	duk_uint16_t us[2];
+	duk_uint8_t uc[4];
+};
+
+typedef union duk_float_union duk_float_union;
+
+#if defined(DUK_USE_DOUBLE_LE) || defined(DUK_USE_DOUBLE_ME)
+#define DUK_FLT_IDX_UI0    0
+#define DUK_FLT_IDX_US0    1
+#define DUK_FLT_IDX_US1    0
+#define DUK_FLT_IDX_UC0    3
+#define DUK_FLT_IDX_UC1    2
+#define DUK_FLT_IDX_UC2    1
+#define DUK_FLT_IDX_UC3    0
+#elif defined(DUK_USE_DOUBLE_BE)
+#define DUK_FLT_IDX_UI0    0
+#define DUK_FLT_IDX_US0    0
+#define DUK_FLT_IDX_US1    1
+#define DUK_FLT_IDX_UC0    0
+#define DUK_FLT_IDX_UC1    1
+#define DUK_FLT_IDX_UC2    2
+#define DUK_FLT_IDX_UC3    3
+#else
+#error internal error
+#endif
+
+#endif  /* DUK_FLTUNION_H_INCLUDED */
 /* #include duk_replacements.h */
 #if !defined(DUK_REPLACEMENTS_H_INCLUDED)
 #define DUK_REPLACEMENTS_H_INCLUDED
@@ -1510,9 +1552,9 @@ DUK_INTERNAL_DECL void duk_tval_assert_valid(duk_tval *tv);
 #define DUK_STRIDX_UC_FUNCTION                                        5                              /* 'Function' */
 #define DUK_HEAP_STRING_UC_FUNCTION(heap)                             DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_FUNCTION)
 #define DUK_HTHREAD_STRING_UC_FUNCTION(thr)                           DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_FUNCTION)
-#define DUK_STRIDX_ARRAY                                              6                              /* 'Array' */
-#define DUK_HEAP_STRING_ARRAY(heap)                                   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ARRAY)
-#define DUK_HTHREAD_STRING_ARRAY(thr)                                 DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ARRAY)
+#define DUK_STRIDX_UC_ARRAY                                           6                              /* 'Array' */
+#define DUK_HEAP_STRING_UC_ARRAY(heap)                                DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_ARRAY)
+#define DUK_HTHREAD_STRING_UC_ARRAY(thr)                              DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_ARRAY)
 #define DUK_STRIDX_UC_STRING                                          7                              /* 'String' */
 #define DUK_HEAP_STRING_UC_STRING(heap)                               DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_STRING)
 #define DUK_HTHREAD_STRING_UC_STRING(thr)                             DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_STRING)
@@ -1522,9 +1564,9 @@ DUK_INTERNAL_DECL void duk_tval_assert_valid(duk_tval *tv);
 #define DUK_STRIDX_UC_NUMBER                                          9                              /* 'Number' */
 #define DUK_HEAP_STRING_UC_NUMBER(heap)                               DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_NUMBER)
 #define DUK_HTHREAD_STRING_UC_NUMBER(thr)                             DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_NUMBER)
-#define DUK_STRIDX_DATE                                               10                             /* 'Date' */
-#define DUK_HEAP_STRING_DATE(heap)                                    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DATE)
-#define DUK_HTHREAD_STRING_DATE(thr)                                  DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DATE)
+#define DUK_STRIDX_UC_DATE                                            10                             /* 'Date' */
+#define DUK_HEAP_STRING_UC_DATE(heap)                                 DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_DATE)
+#define DUK_HTHREAD_STRING_UC_DATE(thr)                               DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_DATE)
 #define DUK_STRIDX_REG_EXP                                            11                             /* 'RegExp' */
 #define DUK_HEAP_STRING_REG_EXP(heap)                                 DUK_HEAP_GET_STRING((heap),DUK_STRIDX_REG_EXP)
 #define DUK_HTHREAD_STRING_REG_EXP(thr)                               DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_REG_EXP)
@@ -1750,260 +1792,263 @@ DUK_INTERNAL_DECL void duk_tval_assert_valid(duk_tval *tv);
 #define DUK_STRIDX_DATA                                               85                             /* 'data' */
 #define DUK_HEAP_STRING_DATA(heap)                                    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DATA)
 #define DUK_HTHREAD_STRING_DATA(thr)                                  DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DATA)
-#define DUK_STRIDX_LENGTH                                             86                             /* 'length' */
+#define DUK_STRIDX_LC_BUFFER                                          86                             /* 'buffer' */
+#define DUK_HEAP_STRING_LC_BUFFER(heap)                               DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_BUFFER)
+#define DUK_HTHREAD_STRING_LC_BUFFER(thr)                             DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_BUFFER)
+#define DUK_STRIDX_LENGTH                                             87                             /* 'length' */
 #define DUK_HEAP_STRING_LENGTH(heap)                                  DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LENGTH)
 #define DUK_HTHREAD_STRING_LENGTH(thr)                                DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LENGTH)
-#define DUK_STRIDX_SET                                                87                             /* 'set' */
+#define DUK_STRIDX_SET                                                88                             /* 'set' */
 #define DUK_HEAP_STRING_SET(heap)                                     DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SET)
 #define DUK_HTHREAD_STRING_SET(thr)                                   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SET)
-#define DUK_STRIDX_STACK                                              88                             /* 'stack' */
+#define DUK_STRIDX_STACK                                              89                             /* 'stack' */
 #define DUK_HEAP_STRING_STACK(heap)                                   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_STACK)
 #define DUK_HTHREAD_STRING_STACK(thr)                                 DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_STACK)
-#define DUK_STRIDX_PC                                                 89                             /* 'pc' */
+#define DUK_STRIDX_PC                                                 90                             /* 'pc' */
 #define DUK_HEAP_STRING_PC(heap)                                      DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PC)
 #define DUK_HTHREAD_STRING_PC(thr)                                    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PC)
-#define DUK_STRIDX_LINE_NUMBER                                        90                             /* 'lineNumber' */
+#define DUK_STRIDX_LINE_NUMBER                                        91                             /* 'lineNumber' */
 #define DUK_HEAP_STRING_LINE_NUMBER(heap)                             DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LINE_NUMBER)
 #define DUK_HTHREAD_STRING_LINE_NUMBER(thr)                           DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LINE_NUMBER)
-#define DUK_STRIDX_INT_TRACEDATA                                      91                             /* '\x82Tracedata' */
+#define DUK_STRIDX_INT_TRACEDATA                                      92                             /* '\x82Tracedata' */
 #define DUK_HEAP_STRING_INT_TRACEDATA(heap)                           DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_TRACEDATA)
 #define DUK_HTHREAD_STRING_INT_TRACEDATA(thr)                         DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_TRACEDATA)
-#define DUK_STRIDX_NAME                                               92                             /* 'name' */
+#define DUK_STRIDX_NAME                                               93                             /* 'name' */
 #define DUK_HEAP_STRING_NAME(heap)                                    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_NAME)
 #define DUK_HTHREAD_STRING_NAME(thr)                                  DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_NAME)
-#define DUK_STRIDX_FILE_NAME                                          93                             /* 'fileName' */
+#define DUK_STRIDX_FILE_NAME                                          94                             /* 'fileName' */
 #define DUK_HEAP_STRING_FILE_NAME(heap)                               DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FILE_NAME)
 #define DUK_HTHREAD_STRING_FILE_NAME(thr)                             DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FILE_NAME)
-#define DUK_STRIDX_LC_POINTER                                         94                             /* 'pointer' */
+#define DUK_STRIDX_LC_POINTER                                         95                             /* 'pointer' */
 #define DUK_HEAP_STRING_LC_POINTER(heap)                              DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_POINTER)
 #define DUK_HTHREAD_STRING_LC_POINTER(thr)                            DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_POINTER)
-#define DUK_STRIDX_INT_TARGET                                         95                             /* '\x82Target' */
+#define DUK_STRIDX_INT_TARGET                                         96                             /* '\x82Target' */
 #define DUK_HEAP_STRING_INT_TARGET(heap)                              DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_TARGET)
 #define DUK_HTHREAD_STRING_INT_TARGET(thr)                            DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_TARGET)
-#define DUK_STRIDX_INT_NEXT                                           96                             /* '\x82Next' */
+#define DUK_STRIDX_INT_NEXT                                           97                             /* '\x82Next' */
 #define DUK_HEAP_STRING_INT_NEXT(heap)                                DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_NEXT)
 #define DUK_HTHREAD_STRING_INT_NEXT(thr)                              DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_NEXT)
-#define DUK_STRIDX_INT_BYTECODE                                       97                             /* '\x82Bytecode' */
+#define DUK_STRIDX_INT_BYTECODE                                       98                             /* '\x82Bytecode' */
 #define DUK_HEAP_STRING_INT_BYTECODE(heap)                            DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_BYTECODE)
 #define DUK_HTHREAD_STRING_INT_BYTECODE(thr)                          DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_BYTECODE)
-#define DUK_STRIDX_INT_FORMALS                                        98                             /* '\x82Formals' */
+#define DUK_STRIDX_INT_FORMALS                                        99                             /* '\x82Formals' */
 #define DUK_HEAP_STRING_INT_FORMALS(heap)                             DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_FORMALS)
 #define DUK_HTHREAD_STRING_INT_FORMALS(thr)                           DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_FORMALS)
-#define DUK_STRIDX_INT_VARMAP                                         99                             /* '\x82Varmap' */
+#define DUK_STRIDX_INT_VARMAP                                         100                            /* '\x82Varmap' */
 #define DUK_HEAP_STRING_INT_VARMAP(heap)                              DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_VARMAP)
 #define DUK_HTHREAD_STRING_INT_VARMAP(thr)                            DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_VARMAP)
-#define DUK_STRIDX_INT_SOURCE                                         100                            /* '\x82Source' */
+#define DUK_STRIDX_INT_SOURCE                                         101                            /* '\x82Source' */
 #define DUK_HEAP_STRING_INT_SOURCE(heap)                              DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_SOURCE)
 #define DUK_HTHREAD_STRING_INT_SOURCE(thr)                            DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_SOURCE)
-#define DUK_STRIDX_INT_PC2LINE                                        101                            /* '\x82Pc2line' */
+#define DUK_STRIDX_INT_PC2LINE                                        102                            /* '\x82Pc2line' */
 #define DUK_HEAP_STRING_INT_PC2LINE(heap)                             DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_PC2LINE)
 #define DUK_HTHREAD_STRING_INT_PC2LINE(thr)                           DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_PC2LINE)
-#define DUK_STRIDX_INT_MAP                                            102                            /* '\x82Map' */
+#define DUK_STRIDX_INT_MAP                                            103                            /* '\x82Map' */
 #define DUK_HEAP_STRING_INT_MAP(heap)                                 DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_MAP)
 #define DUK_HTHREAD_STRING_INT_MAP(thr)                               DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_MAP)
-#define DUK_STRIDX_INT_VARENV                                         103                            /* '\x82Varenv' */
+#define DUK_STRIDX_INT_VARENV                                         104                            /* '\x82Varenv' */
 #define DUK_HEAP_STRING_INT_VARENV(heap)                              DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_VARENV)
 #define DUK_HTHREAD_STRING_INT_VARENV(thr)                            DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_VARENV)
-#define DUK_STRIDX_INT_FINALIZER                                      104                            /* '\x82Finalizer' */
+#define DUK_STRIDX_INT_FINALIZER                                      105                            /* '\x82Finalizer' */
 #define DUK_HEAP_STRING_INT_FINALIZER(heap)                           DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_FINALIZER)
 #define DUK_HTHREAD_STRING_INT_FINALIZER(thr)                         DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_FINALIZER)
-#define DUK_STRIDX_INT_VALUE                                          105                            /* '\x82Value' */
+#define DUK_STRIDX_INT_VALUE                                          106                            /* '\x82Value' */
 #define DUK_HEAP_STRING_INT_VALUE(heap)                               DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_VALUE)
 #define DUK_HTHREAD_STRING_INT_VALUE(thr)                             DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_VALUE)
-#define DUK_STRIDX_COMPILE                                            106                            /* 'compile' */
+#define DUK_STRIDX_COMPILE                                            107                            /* 'compile' */
 #define DUK_HEAP_STRING_COMPILE(heap)                                 DUK_HEAP_GET_STRING((heap),DUK_STRIDX_COMPILE)
 #define DUK_HTHREAD_STRING_COMPILE(thr)                               DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_COMPILE)
-#define DUK_STRIDX_INPUT                                              107                            /* 'input' */
+#define DUK_STRIDX_INPUT                                              108                            /* 'input' */
 #define DUK_HEAP_STRING_INPUT(heap)                                   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INPUT)
 #define DUK_HTHREAD_STRING_INPUT(thr)                                 DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INPUT)
-#define DUK_STRIDX_ERR_CREATE                                         108                            /* 'errCreate' */
+#define DUK_STRIDX_ERR_CREATE                                         109                            /* 'errCreate' */
 #define DUK_HEAP_STRING_ERR_CREATE(heap)                              DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ERR_CREATE)
 #define DUK_HTHREAD_STRING_ERR_CREATE(thr)                            DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ERR_CREATE)
-#define DUK_STRIDX_ERR_THROW                                          109                            /* 'errThrow' */
+#define DUK_STRIDX_ERR_THROW                                          110                            /* 'errThrow' */
 #define DUK_HEAP_STRING_ERR_THROW(heap)                               DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ERR_THROW)
 #define DUK_HTHREAD_STRING_ERR_THROW(thr)                             DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ERR_THROW)
-#define DUK_STRIDX_ENV                                                110                            /* 'env' */
+#define DUK_STRIDX_ENV                                                111                            /* 'env' */
 #define DUK_HEAP_STRING_ENV(heap)                                     DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ENV)
 #define DUK_HTHREAD_STRING_ENV(thr)                                   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ENV)
-#define DUK_STRIDX_HEX                                                111                            /* 'hex' */
+#define DUK_STRIDX_HEX                                                112                            /* 'hex' */
 #define DUK_HEAP_STRING_HEX(heap)                                     DUK_HEAP_GET_STRING((heap),DUK_STRIDX_HEX)
 #define DUK_HTHREAD_STRING_HEX(thr)                                   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_HEX)
-#define DUK_STRIDX_BASE64                                             112                            /* 'base64' */
+#define DUK_STRIDX_BASE64                                             113                            /* 'base64' */
 #define DUK_HEAP_STRING_BASE64(heap)                                  DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BASE64)
 #define DUK_HTHREAD_STRING_BASE64(thr)                                DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BASE64)
-#define DUK_STRIDX_JX                                                 113                            /* 'jx' */
+#define DUK_STRIDX_JX                                                 114                            /* 'jx' */
 #define DUK_HEAP_STRING_JX(heap)                                      DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JX)
 #define DUK_HTHREAD_STRING_JX(thr)                                    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JX)
-#define DUK_STRIDX_JC                                                 114                            /* 'jc' */
+#define DUK_STRIDX_JC                                                 115                            /* 'jc' */
 #define DUK_HEAP_STRING_JC(heap)                                      DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JC)
 #define DUK_HTHREAD_STRING_JC(thr)                                    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JC)
-#define DUK_STRIDX_JSON_EXT_UNDEFINED                                 115                            /* '{"_undef":true}' */
+#define DUK_STRIDX_JSON_EXT_UNDEFINED                                 116                            /* '{"_undef":true}' */
 #define DUK_HEAP_STRING_JSON_EXT_UNDEFINED(heap)                      DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_UNDEFINED)
 #define DUK_HTHREAD_STRING_JSON_EXT_UNDEFINED(thr)                    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_UNDEFINED)
-#define DUK_STRIDX_JSON_EXT_NAN                                       116                            /* '{"_nan":true}' */
+#define DUK_STRIDX_JSON_EXT_NAN                                       117                            /* '{"_nan":true}' */
 #define DUK_HEAP_STRING_JSON_EXT_NAN(heap)                            DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_NAN)
 #define DUK_HTHREAD_STRING_JSON_EXT_NAN(thr)                          DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_NAN)
-#define DUK_STRIDX_JSON_EXT_POSINF                                    117                            /* '{"_inf":true}' */
+#define DUK_STRIDX_JSON_EXT_POSINF                                    118                            /* '{"_inf":true}' */
 #define DUK_HEAP_STRING_JSON_EXT_POSINF(heap)                         DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_POSINF)
 #define DUK_HTHREAD_STRING_JSON_EXT_POSINF(thr)                       DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_POSINF)
-#define DUK_STRIDX_JSON_EXT_NEGINF                                    118                            /* '{"_ninf":true}' */
+#define DUK_STRIDX_JSON_EXT_NEGINF                                    119                            /* '{"_ninf":true}' */
 #define DUK_HEAP_STRING_JSON_EXT_NEGINF(heap)                         DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_NEGINF)
 #define DUK_HTHREAD_STRING_JSON_EXT_NEGINF(thr)                       DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_NEGINF)
-#define DUK_STRIDX_JSON_EXT_FUNCTION1                                 119                            /* '{"_func":true}' */
+#define DUK_STRIDX_JSON_EXT_FUNCTION1                                 120                            /* '{"_func":true}' */
 #define DUK_HEAP_STRING_JSON_EXT_FUNCTION1(heap)                      DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_FUNCTION1)
 #define DUK_HTHREAD_STRING_JSON_EXT_FUNCTION1(thr)                    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_FUNCTION1)
-#define DUK_STRIDX_JSON_EXT_FUNCTION2                                 120                            /* '{_func:true}' */
+#define DUK_STRIDX_JSON_EXT_FUNCTION2                                 121                            /* '{_func:true}' */
 #define DUK_HEAP_STRING_JSON_EXT_FUNCTION2(heap)                      DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_FUNCTION2)
 #define DUK_HTHREAD_STRING_JSON_EXT_FUNCTION2(thr)                    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_FUNCTION2)
-#define DUK_STRIDX_BREAK                                              121                            /* 'break' */
+#define DUK_STRIDX_BREAK                                              122                            /* 'break' */
 #define DUK_HEAP_STRING_BREAK(heap)                                   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BREAK)
 #define DUK_HTHREAD_STRING_BREAK(thr)                                 DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BREAK)
-#define DUK_STRIDX_CASE                                               122                            /* 'case' */
+#define DUK_STRIDX_CASE                                               123                            /* 'case' */
 #define DUK_HEAP_STRING_CASE(heap)                                    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CASE)
 #define DUK_HTHREAD_STRING_CASE(thr)                                  DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CASE)
-#define DUK_STRIDX_CATCH                                              123                            /* 'catch' */
+#define DUK_STRIDX_CATCH                                              124                            /* 'catch' */
 #define DUK_HEAP_STRING_CATCH(heap)                                   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CATCH)
 #define DUK_HTHREAD_STRING_CATCH(thr)                                 DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CATCH)
-#define DUK_STRIDX_CONTINUE                                           124                            /* 'continue' */
+#define DUK_STRIDX_CONTINUE                                           125                            /* 'continue' */
 #define DUK_HEAP_STRING_CONTINUE(heap)                                DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CONTINUE)
 #define DUK_HTHREAD_STRING_CONTINUE(thr)                              DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CONTINUE)
-#define DUK_STRIDX_DEBUGGER                                           125                            /* 'debugger' */
+#define DUK_STRIDX_DEBUGGER                                           126                            /* 'debugger' */
 #define DUK_HEAP_STRING_DEBUGGER(heap)                                DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DEBUGGER)
 #define DUK_HTHREAD_STRING_DEBUGGER(thr)                              DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DEBUGGER)
-#define DUK_STRIDX_DEFAULT                                            126                            /* 'default' */
+#define DUK_STRIDX_DEFAULT                                            127                            /* 'default' */
 #define DUK_HEAP_STRING_DEFAULT(heap)                                 DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DEFAULT)
 #define DUK_HTHREAD_STRING_DEFAULT(thr)                               DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DEFAULT)
-#define DUK_STRIDX_DELETE                                             127                            /* 'delete' */
+#define DUK_STRIDX_DELETE                                             128                            /* 'delete' */
 #define DUK_HEAP_STRING_DELETE(heap)                                  DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DELETE)
 #define DUK_HTHREAD_STRING_DELETE(thr)                                DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DELETE)
-#define DUK_STRIDX_DO                                                 128                            /* 'do' */
+#define DUK_STRIDX_DO                                                 129                            /* 'do' */
 #define DUK_HEAP_STRING_DO(heap)                                      DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DO)
 #define DUK_HTHREAD_STRING_DO(thr)                                    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DO)
-#define DUK_STRIDX_ELSE                                               129                            /* 'else' */
+#define DUK_STRIDX_ELSE                                               130                            /* 'else' */
 #define DUK_HEAP_STRING_ELSE(heap)                                    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ELSE)
 #define DUK_HTHREAD_STRING_ELSE(thr)                                  DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ELSE)
-#define DUK_STRIDX_FINALLY                                            130                            /* 'finally' */
+#define DUK_STRIDX_FINALLY                                            131                            /* 'finally' */
 #define DUK_HEAP_STRING_FINALLY(heap)                                 DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FINALLY)
 #define DUK_HTHREAD_STRING_FINALLY(thr)                               DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FINALLY)
-#define DUK_STRIDX_FOR                                                131                            /* 'for' */
+#define DUK_STRIDX_FOR                                                132                            /* 'for' */
 #define DUK_HEAP_STRING_FOR(heap)                                     DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FOR)
 #define DUK_HTHREAD_STRING_FOR(thr)                                   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FOR)
-#define DUK_STRIDX_LC_FUNCTION                                        132                            /* 'function' */
+#define DUK_STRIDX_LC_FUNCTION                                        133                            /* 'function' */
 #define DUK_HEAP_STRING_LC_FUNCTION(heap)                             DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_FUNCTION)
 #define DUK_HTHREAD_STRING_LC_FUNCTION(thr)                           DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_FUNCTION)
-#define DUK_STRIDX_IF                                                 133                            /* 'if' */
+#define DUK_STRIDX_IF                                                 134                            /* 'if' */
 #define DUK_HEAP_STRING_IF(heap)                                      DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IF)
 #define DUK_HTHREAD_STRING_IF(thr)                                    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IF)
-#define DUK_STRIDX_IN                                                 134                            /* 'in' */
+#define DUK_STRIDX_IN                                                 135                            /* 'in' */
 #define DUK_HEAP_STRING_IN(heap)                                      DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IN)
 #define DUK_HTHREAD_STRING_IN(thr)                                    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IN)
-#define DUK_STRIDX_INSTANCEOF                                         135                            /* 'instanceof' */
+#define DUK_STRIDX_INSTANCEOF                                         136                            /* 'instanceof' */
 #define DUK_HEAP_STRING_INSTANCEOF(heap)                              DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INSTANCEOF)
 #define DUK_HTHREAD_STRING_INSTANCEOF(thr)                            DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INSTANCEOF)
-#define DUK_STRIDX_NEW                                                136                            /* 'new' */
+#define DUK_STRIDX_NEW                                                137                            /* 'new' */
 #define DUK_HEAP_STRING_NEW(heap)                                     DUK_HEAP_GET_STRING((heap),DUK_STRIDX_NEW)
 #define DUK_HTHREAD_STRING_NEW(thr)                                   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_NEW)
-#define DUK_STRIDX_RETURN                                             137                            /* 'return' */
+#define DUK_STRIDX_RETURN                                             138                            /* 'return' */
 #define DUK_HEAP_STRING_RETURN(heap)                                  DUK_HEAP_GET_STRING((heap),DUK_STRIDX_RETURN)
 #define DUK_HTHREAD_STRING_RETURN(thr)                                DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_RETURN)
-#define DUK_STRIDX_SWITCH                                             138                            /* 'switch' */
+#define DUK_STRIDX_SWITCH                                             139                            /* 'switch' */
 #define DUK_HEAP_STRING_SWITCH(heap)                                  DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SWITCH)
 #define DUK_HTHREAD_STRING_SWITCH(thr)                                DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SWITCH)
-#define DUK_STRIDX_THIS                                               139                            /* 'this' */
+#define DUK_STRIDX_THIS                                               140                            /* 'this' */
 #define DUK_HEAP_STRING_THIS(heap)                                    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_THIS)
 #define DUK_HTHREAD_STRING_THIS(thr)                                  DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_THIS)
-#define DUK_STRIDX_THROW                                              140                            /* 'throw' */
+#define DUK_STRIDX_THROW                                              141                            /* 'throw' */
 #define DUK_HEAP_STRING_THROW(heap)                                   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_THROW)
 #define DUK_HTHREAD_STRING_THROW(thr)                                 DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_THROW)
-#define DUK_STRIDX_TRY                                                141                            /* 'try' */
+#define DUK_STRIDX_TRY                                                142                            /* 'try' */
 #define DUK_HEAP_STRING_TRY(heap)                                     DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TRY)
 #define DUK_HTHREAD_STRING_TRY(thr)                                   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TRY)
-#define DUK_STRIDX_TYPEOF                                             142                            /* 'typeof' */
+#define DUK_STRIDX_TYPEOF                                             143                            /* 'typeof' */
 #define DUK_HEAP_STRING_TYPEOF(heap)                                  DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TYPEOF)
 #define DUK_HTHREAD_STRING_TYPEOF(thr)                                DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TYPEOF)
-#define DUK_STRIDX_VAR                                                143                            /* 'var' */
+#define DUK_STRIDX_VAR                                                144                            /* 'var' */
 #define DUK_HEAP_STRING_VAR(heap)                                     DUK_HEAP_GET_STRING((heap),DUK_STRIDX_VAR)
 #define DUK_HTHREAD_STRING_VAR(thr)                                   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_VAR)
-#define DUK_STRIDX_CONST                                              144                            /* 'const' */
+#define DUK_STRIDX_CONST                                              145                            /* 'const' */
 #define DUK_HEAP_STRING_CONST(heap)                                   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CONST)
 #define DUK_HTHREAD_STRING_CONST(thr)                                 DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CONST)
-#define DUK_STRIDX_VOID                                               145                            /* 'void' */
+#define DUK_STRIDX_VOID                                               146                            /* 'void' */
 #define DUK_HEAP_STRING_VOID(heap)                                    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_VOID)
 #define DUK_HTHREAD_STRING_VOID(thr)                                  DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_VOID)
-#define DUK_STRIDX_WHILE                                              146                            /* 'while' */
+#define DUK_STRIDX_WHILE                                              147                            /* 'while' */
 #define DUK_HEAP_STRING_WHILE(heap)                                   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_WHILE)
 #define DUK_HTHREAD_STRING_WHILE(thr)                                 DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_WHILE)
-#define DUK_STRIDX_WITH                                               147                            /* 'with' */
+#define DUK_STRIDX_WITH                                               148                            /* 'with' */
 #define DUK_HEAP_STRING_WITH(heap)                                    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_WITH)
 #define DUK_HTHREAD_STRING_WITH(thr)                                  DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_WITH)
-#define DUK_STRIDX_CLASS                                              148                            /* 'class' */
+#define DUK_STRIDX_CLASS                                              149                            /* 'class' */
 #define DUK_HEAP_STRING_CLASS(heap)                                   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CLASS)
 #define DUK_HTHREAD_STRING_CLASS(thr)                                 DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CLASS)
-#define DUK_STRIDX_ENUM                                               149                            /* 'enum' */
+#define DUK_STRIDX_ENUM                                               150                            /* 'enum' */
 #define DUK_HEAP_STRING_ENUM(heap)                                    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ENUM)
 #define DUK_HTHREAD_STRING_ENUM(thr)                                  DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ENUM)
-#define DUK_STRIDX_EXPORT                                             150                            /* 'export' */
+#define DUK_STRIDX_EXPORT                                             151                            /* 'export' */
 #define DUK_HEAP_STRING_EXPORT(heap)                                  DUK_HEAP_GET_STRING((heap),DUK_STRIDX_EXPORT)
 #define DUK_HTHREAD_STRING_EXPORT(thr)                                DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_EXPORT)
-#define DUK_STRIDX_EXTENDS                                            151                            /* 'extends' */
+#define DUK_STRIDX_EXTENDS                                            152                            /* 'extends' */
 #define DUK_HEAP_STRING_EXTENDS(heap)                                 DUK_HEAP_GET_STRING((heap),DUK_STRIDX_EXTENDS)
 #define DUK_HTHREAD_STRING_EXTENDS(thr)                               DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_EXTENDS)
-#define DUK_STRIDX_IMPORT                                             152                            /* 'import' */
+#define DUK_STRIDX_IMPORT                                             153                            /* 'import' */
 #define DUK_HEAP_STRING_IMPORT(heap)                                  DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IMPORT)
 #define DUK_HTHREAD_STRING_IMPORT(thr)                                DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IMPORT)
-#define DUK_STRIDX_SUPER                                              153                            /* 'super' */
+#define DUK_STRIDX_SUPER                                              154                            /* 'super' */
 #define DUK_HEAP_STRING_SUPER(heap)                                   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SUPER)
 #define DUK_HTHREAD_STRING_SUPER(thr)                                 DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SUPER)
-#define DUK_STRIDX_LC_NULL                                            154                            /* 'null' */
+#define DUK_STRIDX_LC_NULL                                            155                            /* 'null' */
 #define DUK_HEAP_STRING_LC_NULL(heap)                                 DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_NULL)
 #define DUK_HTHREAD_STRING_LC_NULL(thr)                               DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_NULL)
-#define DUK_STRIDX_TRUE                                               155                            /* 'true' */
+#define DUK_STRIDX_TRUE                                               156                            /* 'true' */
 #define DUK_HEAP_STRING_TRUE(heap)                                    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TRUE)
 #define DUK_HTHREAD_STRING_TRUE(thr)                                  DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TRUE)
-#define DUK_STRIDX_FALSE                                              156                            /* 'false' */
+#define DUK_STRIDX_FALSE                                              157                            /* 'false' */
 #define DUK_HEAP_STRING_FALSE(heap)                                   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FALSE)
 #define DUK_HTHREAD_STRING_FALSE(thr)                                 DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FALSE)
-#define DUK_STRIDX_IMPLEMENTS                                         157                            /* 'implements' */
+#define DUK_STRIDX_IMPLEMENTS                                         158                            /* 'implements' */
 #define DUK_HEAP_STRING_IMPLEMENTS(heap)                              DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IMPLEMENTS)
 #define DUK_HTHREAD_STRING_IMPLEMENTS(thr)                            DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IMPLEMENTS)
-#define DUK_STRIDX_INTERFACE                                          158                            /* 'interface' */
+#define DUK_STRIDX_INTERFACE                                          159                            /* 'interface' */
 #define DUK_HEAP_STRING_INTERFACE(heap)                               DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INTERFACE)
 #define DUK_HTHREAD_STRING_INTERFACE(thr)                             DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INTERFACE)
-#define DUK_STRIDX_LET                                                159                            /* 'let' */
+#define DUK_STRIDX_LET                                                160                            /* 'let' */
 #define DUK_HEAP_STRING_LET(heap)                                     DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LET)
 #define DUK_HTHREAD_STRING_LET(thr)                                   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LET)
-#define DUK_STRIDX_PACKAGE                                            160                            /* 'package' */
+#define DUK_STRIDX_PACKAGE                                            161                            /* 'package' */
 #define DUK_HEAP_STRING_PACKAGE(heap)                                 DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PACKAGE)
 #define DUK_HTHREAD_STRING_PACKAGE(thr)                               DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PACKAGE)
-#define DUK_STRIDX_PRIVATE                                            161                            /* 'private' */
+#define DUK_STRIDX_PRIVATE                                            162                            /* 'private' */
 #define DUK_HEAP_STRING_PRIVATE(heap)                                 DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PRIVATE)
 #define DUK_HTHREAD_STRING_PRIVATE(thr)                               DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PRIVATE)
-#define DUK_STRIDX_PROTECTED                                          162                            /* 'protected' */
+#define DUK_STRIDX_PROTECTED                                          163                            /* 'protected' */
 #define DUK_HEAP_STRING_PROTECTED(heap)                               DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PROTECTED)
 #define DUK_HTHREAD_STRING_PROTECTED(thr)                             DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PROTECTED)
-#define DUK_STRIDX_PUBLIC                                             163                            /* 'public' */
+#define DUK_STRIDX_PUBLIC                                             164                            /* 'public' */
 #define DUK_HEAP_STRING_PUBLIC(heap)                                  DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PUBLIC)
 #define DUK_HTHREAD_STRING_PUBLIC(thr)                                DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PUBLIC)
-#define DUK_STRIDX_STATIC                                             164                            /* 'static' */
+#define DUK_STRIDX_STATIC                                             165                            /* 'static' */
 #define DUK_HEAP_STRING_STATIC(heap)                                  DUK_HEAP_GET_STRING((heap),DUK_STRIDX_STATIC)
 #define DUK_HTHREAD_STRING_STATIC(thr)                                DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_STATIC)
-#define DUK_STRIDX_YIELD                                              165                            /* 'yield' */
+#define DUK_STRIDX_YIELD                                              166                            /* 'yield' */
 #define DUK_HEAP_STRING_YIELD(heap)                                   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_YIELD)
 #define DUK_HTHREAD_STRING_YIELD(thr)                                 DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_YIELD)
 
-#define DUK_HEAP_NUM_STRINGS                                          166
-#define DUK_STRIDX_START_RESERVED                                     121
-#define DUK_STRIDX_START_STRICT_RESERVED                              157
-#define DUK_STRIDX_END_RESERVED                                       166                            /* exclusive endpoint */
+#define DUK_HEAP_NUM_STRINGS                                          167
+#define DUK_STRIDX_START_RESERVED                                     122
+#define DUK_STRIDX_START_STRICT_RESERVED                              158
+#define DUK_STRIDX_END_RESERVED                                       167                            /* exclusive endpoint */
 
 /* To convert a heap stridx to a token number, subtract
  * DUK_STRIDX_START_RESERVED and add DUK_TOK_START_RESERVED.
  */
 #if !defined(DUK_SINGLE_FILE)
-DUK_INTERNAL_DECL const duk_uint8_t duk_strings_data[967];
+DUK_INTERNAL_DECL const duk_uint8_t duk_strings_data[972];
 #endif  /* !DUK_SINGLE_FILE */
 #define DUK_STRDATA_MAX_STRLEN                                        27
-#define DUK_STRDATA_DATA_LENGTH                                       967
+#define DUK_STRDATA_DATA_LENGTH                                       972
 #endif  /* DUK_USE_ROM_STRINGS */
 
 #if defined(DUK_USE_ROM_OBJECTS)
@@ -2186,13 +2231,15 @@ DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_tojson(duk_context *ctx);
 DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_fill(duk_context *ctx);
 DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_copy(duk_context *ctx);
 DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_write(duk_context *ctx);
+DUK_INTERNAL_DECL duk_ret_t duk_bi_cbor_encode(duk_context *ctx);
+DUK_INTERNAL_DECL duk_ret_t duk_bi_cbor_decode(duk_context *ctx);
 DUK_INTERNAL_DECL duk_ret_t duk_bi_textencoder_prototype_encoding_getter(duk_context *ctx);
 DUK_INTERNAL_DECL duk_ret_t duk_bi_textencoder_prototype_encode(duk_context *ctx);
 DUK_INTERNAL_DECL duk_ret_t duk_bi_textdecoder_prototype_shared_getter(duk_context *ctx);
 DUK_INTERNAL_DECL duk_ret_t duk_bi_textdecoder_prototype_decode(duk_context *ctx);
 DUK_INTERNAL_DECL duk_ret_t duk_bi_performance_now(duk_context *ctx);
 #if !defined(DUK_SINGLE_FILE)
-DUK_INTERNAL_DECL const duk_c_function duk_bi_native_functions[183];
+DUK_INTERNAL_DECL const duk_c_function duk_bi_native_functions[185];
 #endif  /* !DUK_SINGLE_FILE */
 #define DUK_BIDX_GLOBAL                                               0
 #define DUK_BIDX_GLOBAL_ENV                                           1
@@ -2247,22 +2294,22 @@ DUK_INTERNAL_DECL const duk_c_function duk_bi_native_functions[183];
 #define DUK_BIDX_NODEJS_BUFFER_PROTOTYPE                              50
 #define DUK_NUM_BUILTINS                                              51
 #define DUK_NUM_BIDX_BUILTINS                                         51
-#define DUK_NUM_ALL_BUILTINS                                          79
+#define DUK_NUM_ALL_BUILTINS                                          80
 #if defined(DUK_USE_DOUBLE_LE)
 #if !defined(DUK_SINGLE_FILE)
-DUK_INTERNAL_DECL const duk_uint8_t duk_builtins_data[4251];
+DUK_INTERNAL_DECL const duk_uint8_t duk_builtins_data[4281];
 #endif  /* !DUK_SINGLE_FILE */
-#define DUK_BUILTINS_DATA_LENGTH                                      4251
+#define DUK_BUILTINS_DATA_LENGTH                                      4281
 #elif defined(DUK_USE_DOUBLE_BE)
 #if !defined(DUK_SINGLE_FILE)
-DUK_INTERNAL_DECL const duk_uint8_t duk_builtins_data[4251];
+DUK_INTERNAL_DECL const duk_uint8_t duk_builtins_data[4281];
 #endif  /* !DUK_SINGLE_FILE */
-#define DUK_BUILTINS_DATA_LENGTH                                      4251
+#define DUK_BUILTINS_DATA_LENGTH                                      4281
 #elif defined(DUK_USE_DOUBLE_ME)
 #if !defined(DUK_SINGLE_FILE)
-DUK_INTERNAL_DECL const duk_uint8_t duk_builtins_data[4251];
+DUK_INTERNAL_DECL const duk_uint8_t duk_builtins_data[4281];
 #endif  /* !DUK_SINGLE_FILE */
-#define DUK_BUILTINS_DATA_LENGTH                                      4251
+#define DUK_BUILTINS_DATA_LENGTH                                      4281
 #else
 #error invalid endianness defines
 #endif
@@ -2339,40 +2386,49 @@ struct duk_bitencoder_ctx {
 
 /*
  *  Raw write/read macros for big endian, unaligned basic values.
- *  Caller ensures there's enough space.  The macros update the pointer
- *  argument automatically on resizes.  The idiom seems a bit odd, but
- *  leads to compact code.
+ *  Caller ensures there's enough space.  The INC macro variants
+ *  update the pointer argument automatically.
  */
 
 #define DUK_RAW_WRITE_U8(ptr,val)  do { \
-		*(ptr)++ = (duk_uint8_t) (val); \
-	} while (0)
-#define DUK_RAW_WRITE_U16_BE(ptr,val) duk_raw_write_u16_be(&(ptr), (duk_uint16_t) (val))
-#define DUK_RAW_WRITE_U32_BE(ptr,val) duk_raw_write_u32_be(&(ptr), (duk_uint32_t) (val))
-#define DUK_RAW_WRITE_DOUBLE_BE(ptr,val) duk_raw_write_double_be(&(ptr), (duk_double_t) (val))
-#define DUK_RAW_WRITE_XUTF8(ptr,val)  do { \
-		/* 'ptr' is evaluated both as LHS and RHS. */ \
-		duk_uint8_t *duk__ptr; \
-		duk_small_int_t duk__len; \
-		duk__ptr = (duk_uint8_t *) (ptr); \
-		duk__len = duk_unicode_encode_xutf8((duk_ucodepoint_t) (val), duk__ptr); \
-		duk__ptr += duk__len; \
-		(ptr) = duk__ptr; \
+		*(ptr) = (duk_uint8_t) (val); \
 	} while (0)
-#define DUK_RAW_WRITE_CESU8(ptr,val)  do { \
-		/* 'ptr' is evaluated both as LHS and RHS. */ \
-		duk_uint8_t *duk__ptr; \
-		duk_small_int_t duk__len; \
-		duk__ptr = (duk_uint8_t *) (ptr); \
-		duk__len = duk_unicode_encode_cesu8((duk_ucodepoint_t) (val), duk__ptr); \
-		duk__ptr += duk__len; \
-		(ptr) = duk__ptr; \
+#define DUK_RAW_WRITE_U16_BE(ptr,val) duk_raw_write_u16_be((ptr), (duk_uint16_t) (val))
+#define DUK_RAW_WRITE_U32_BE(ptr,val) duk_raw_write_u32_be((ptr), (duk_uint32_t) (val))
+#define DUK_RAW_WRITE_FLOAT_BE(ptr,val) duk_raw_write_float_be((ptr), (duk_float_t) (val))
+#define DUK_RAW_WRITE_DOUBLE_BE(ptr,val) duk_raw_write_double_be((ptr), (duk_double_t) (val))
+#define DUK_RAW_WRITE_XUTF8(ptr,val) duk_raw_write_xutf8((ptr), (duk_ucodepoint_t) (val))
+
+#define DUK_RAW_WRITEINC_U8(ptr,val)  do { \
+		*(ptr)++ = (duk_uint8_t) (val); \
 	} while (0)
+#define DUK_RAW_WRITEINC_U16_BE(ptr,val) duk_raw_writeinc_u16_be(&(ptr), (duk_uint16_t) (val))
+#define DUK_RAW_WRITEINC_U32_BE(ptr,val) duk_raw_writeinc_u32_be(&(ptr), (duk_uint32_t) (val))
+#define DUK_RAW_WRITEINC_FLOAT_BE(ptr,val) duk_raw_writeinc_float_be(&(ptr), (duk_float_t) (val))
+#define DUK_RAW_WRITEINC_DOUBLE_BE(ptr,val) duk_raw_writeinc_double_be(&(ptr), (duk_double_t) (val))
+#define DUK_RAW_WRITEINC_XUTF8(ptr,val) duk_raw_writeinc_xutf8(&(ptr), (duk_ucodepoint_t) (val))
+#define DUK_RAW_WRITEINC_CESU8(ptr,val) duk_raw_writeinc_cesu8(&(ptr), (duk_ucodepoint_t) (val))
+
+#define DUK_RAW_READ_U8(ptr) ((duk_uint8_t) (*(ptr)))
+#define DUK_RAW_READ_U16_BE(ptr) duk_raw_read_u16_be((ptr));
+#define DUK_RAW_READ_U32_BE(ptr) duk_raw_read_u32_be((ptr));
+#define DUK_RAW_READ_DOUBLE_BE(ptr) duk_raw_read_double_be((ptr));
+
+#define DUK_RAW_READINC_U8(ptr) ((duk_uint8_t) (*(ptr)++))
+#define DUK_RAW_READINC_U16_BE(ptr) duk_raw_readinc_u16_be(&(ptr));
+#define DUK_RAW_READINC_U32_BE(ptr) duk_raw_readinc_u32_be(&(ptr));
+#define DUK_RAW_READINC_DOUBLE_BE(ptr) duk_raw_readinc_double_be(&(ptr));
+
+/*
+ *  Double and float byte order operations.
+ */
 
-#define DUK_RAW_READ_U8(ptr) ((duk_uint8_t) (*(ptr)++))
-#define DUK_RAW_READ_U16_BE(ptr) duk_raw_read_u16_be(&(ptr));
-#define DUK_RAW_READ_U32_BE(ptr) duk_raw_read_u32_be(&(ptr));
-#define DUK_RAW_READ_DOUBLE_BE(ptr) duk_raw_read_double_be(&(ptr));
+DUK_INTERNAL_DECL void duk_dblunion_host_to_little(duk_double_union *u);
+DUK_INTERNAL_DECL void duk_dblunion_little_to_host(duk_double_union *u);
+DUK_INTERNAL_DECL void duk_dblunion_host_to_big(duk_double_union *u);
+DUK_INTERNAL_DECL void duk_dblunion_big_to_host(duk_double_union *u);
+DUK_INTERNAL_DECL void duk_fltunion_host_to_big(duk_float_union *u);
+DUK_INTERNAL_DECL void duk_fltunion_big_to_host(duk_float_union *u);
 
 /*
  *  Buffer writer (dynamic buffer only)
@@ -2801,12 +2857,26 @@ DUK_INTERNAL_DECL duk_uint8_t *duk_bw_insert_ensure_area(duk_hthread *thr, duk_b
 DUK_INTERNAL_DECL void duk_bw_remove_raw_slice(duk_hthread *thr, duk_bufwriter_ctx *bw, duk_size_t off, duk_size_t len);
 /* No duk_bw_remove_ensure_slice(), functionality would be identical. */
 
-DUK_INTERNAL_DECL duk_uint16_t duk_raw_read_u16_be(duk_uint8_t **p);
-DUK_INTERNAL_DECL duk_uint32_t duk_raw_read_u32_be(duk_uint8_t **p);
-DUK_INTERNAL_DECL duk_double_t duk_raw_read_double_be(duk_uint8_t **p);
-DUK_INTERNAL_DECL void duk_raw_write_u16_be(duk_uint8_t **p, duk_uint16_t val);
-DUK_INTERNAL_DECL void duk_raw_write_u32_be(duk_uint8_t **p, duk_uint32_t val);
-DUK_INTERNAL_DECL void duk_raw_write_double_be(duk_uint8_t **p, duk_double_t val);
+DUK_INTERNAL_DECL duk_uint16_t duk_raw_read_u16_be(const duk_uint8_t *p);
+DUK_INTERNAL_DECL duk_uint32_t duk_raw_read_u32_be(const duk_uint8_t *p);
+DUK_INTERNAL_DECL duk_float_t duk_raw_read_float_be(const duk_uint8_t *p);
+DUK_INTERNAL_DECL duk_double_t duk_raw_read_double_be(const duk_uint8_t *p);
+DUK_INTERNAL_DECL duk_uint16_t duk_raw_readinc_u16_be(const duk_uint8_t **p);
+DUK_INTERNAL_DECL duk_uint32_t duk_raw_readinc_u32_be(const duk_uint8_t **p);
+DUK_INTERNAL_DECL duk_float_t duk_raw_readinc_float_be(const duk_uint8_t **p);
+DUK_INTERNAL_DECL duk_double_t duk_raw_readinc_double_be(const duk_uint8_t **p);
+DUK_INTERNAL_DECL void duk_raw_write_u16_be(duk_uint8_t *p, duk_uint16_t val);
+DUK_INTERNAL_DECL void duk_raw_write_u32_be(duk_uint8_t *p, duk_uint32_t val);
+DUK_INTERNAL_DECL void duk_raw_write_float_be(duk_uint8_t *p, duk_float_t val);
+DUK_INTERNAL_DECL void duk_raw_write_double_be(duk_uint8_t *p, duk_double_t val);
+DUK_INTERNAL_DECL duk_small_int_t duk_raw_write_xutf8(duk_uint8_t *p, duk_ucodepoint_t val);
+DUK_INTERNAL_DECL duk_small_int_t duk_raw_write_cesu8(duk_uint8_t *p, duk_ucodepoint_t val);
+DUK_INTERNAL_DECL void duk_raw_writeinc_u16_be(duk_uint8_t **p, duk_uint16_t val);
+DUK_INTERNAL_DECL void duk_raw_writeinc_u32_be(duk_uint8_t **p, duk_uint32_t val);
+DUK_INTERNAL_DECL void duk_raw_writeinc_float_be(duk_uint8_t **p, duk_float_t val);
+DUK_INTERNAL_DECL void duk_raw_writeinc_double_be(duk_uint8_t **p, duk_double_t val);
+DUK_INTERNAL_DECL void duk_raw_writeinc_xutf8(duk_uint8_t **p, duk_ucodepoint_t val);
+DUK_INTERNAL_DECL void duk_raw_writeinc_cesu8(duk_uint8_t **p, duk_ucodepoint_t val);
 
 #if defined(DUK_USE_DEBUGGER_SUPPORT)  /* For now only needed by the debugger. */
 DUK_INTERNAL_DECL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len);
@@ -2957,6 +3027,8 @@ DUK_INTERNAL_DECL duk_uint_t duk_double_to_uint_t(duk_double_t x);
 DUK_INTERNAL_DECL duk_int32_t duk_double_to_int32_t(duk_double_t x);
 DUK_INTERNAL_DECL duk_uint32_t duk_double_to_uint32_t(duk_double_t x);
 DUK_INTERNAL_DECL duk_float_t duk_double_to_float_t(duk_double_t x);
+DUK_INTERNAL_DECL duk_bool_t duk_double_equals(duk_double_t x, duk_double_t y);
+DUK_INTERNAL_DECL duk_bool_t duk_float_equals(duk_float_t x, duk_float_t y);
 
 /*
  *  Miscellaneous
@@ -3056,10 +3128,12 @@ DUK_INTERNAL_DECL duk_float_t duk_double_to_float_t(duk_double_t x);
 /* JSON */
 #define DUK_STR_FMT_PTR                          "%p"
 #define DUK_STR_FMT_INVALID_JSON                 "invalid json (at offset %ld)"
-#define DUK_STR_JSONDEC_RECLIMIT                 "json decode recursion limit"
-#define DUK_STR_JSONENC_RECLIMIT                 "json encode recursion limit"
 #define DUK_STR_CYCLIC_INPUT                     "cyclic input"
 
+/* Generic codec */
+#define DUK_STR_DEC_RECLIMIT                     "decode recursion limit"
+#define DUK_STR_ENC_RECLIMIT                     "encode recursion limit"
+
 /* Object property access */
 #define DUK_STR_INVALID_BASE                     "invalid base value"
 #define DUK_STR_STRICT_CALLER_READ               "cannot read strict 'caller'"
@@ -5412,6 +5486,28 @@ DUK_INTERNAL_DECL void duk_heaphdr_decref_norz(duk_hthread *thr, duk_heaphdr *h)
 #if !defined(DUK_API_INTERNAL_H_INCLUDED)
 #define DUK_API_INTERNAL_H_INCLUDED
 
+/* Inline macro helpers. */
+#if defined(DUK_USE_PREFER_SIZE)
+#define DUK_INLINE_PERF
+#define DUK_ALWAYS_INLINE_PERF
+#define DUK_NOINLINE_PERF
+#else
+#define DUK_INLINE_PERF DUK_INLINE
+#define DUK_ALWAYS_INLINE_PERF DUK_ALWAYS_INLINE
+#define DUK_NOINLINE_PERF DUK_NOINLINE
+#endif
+
+/* Inline macro helpers, for bytecode executor. */
+#if defined(DUK_USE_EXEC_PREFER_SIZE)
+#define DUK_EXEC_INLINE_PERF
+#define DUK_EXEC_ALWAYS_INLINE_PERF
+#define DUK_EXEC_NOINLINE_PERF
+#else
+#define DUK_EXEC_INLINE_PERF DUK_INLINE
+#define DUK_EXEC_ALWAYS_INLINE_PERF DUK_ALWAYS_INLINE
+#define DUK_EXEC_NOINLINE_PERF DUK_NOINLINE
+#endif
+
 /* duk_push_sprintf constants */
 #define DUK_PUSH_SPRINTF_INITIAL_SIZE  256L
 #define DUK_PUSH_SPRINTF_SANITY_LIMIT  (1L * 1024L * 1024L * 1024L)
@@ -8423,20 +8519,17 @@ struct duk_hproxy {
  */
 #define DUK_MS_FLAG_EMERGENCY                (1U << 0)
 
-/* Voluntary mark-and-sweep: triggered periodically. */
-#define DUK_MS_FLAG_VOLUNTARY                (1U << 1)
-
 /* Postpone rescue decisions for reachable objects with FINALIZED set.
  * Used during finalize_list processing to avoid incorrect rescue
  * decisions due to finalize_list being a reachability root.
  */
-#define DUK_MS_FLAG_POSTPONE_RESCUE          (1U << 2)
+#define DUK_MS_FLAG_POSTPONE_RESCUE          (1U << 1)
 
 /* Don't compact objects; needed during object property table resize
  * to prevent a recursive resize.  It would suffice to protect only the
  * current object being resized, but this is not yet implemented.
  */
-#define DUK_MS_FLAG_NO_OBJECT_COMPACTION     (1U << 3)
+#define DUK_MS_FLAG_NO_OBJECT_COMPACTION     (1U << 2)
 
 /*
  *  Thread switching
@@ -10220,6 +10313,7 @@ DUK_INTERNAL_DECL duk_small_int_t duk_unicode_encode_cesu8(duk_ucodepoint_t cp,
 DUK_INTERNAL_DECL duk_small_int_t duk_unicode_decode_xutf8(duk_hthread *thr, const duk_uint8_t **ptr, const duk_uint8_t *ptr_start, const duk_uint8_t *ptr_end, duk_ucodepoint_t *out_cp);
 DUK_INTERNAL_DECL duk_ucodepoint_t duk_unicode_decode_xutf8_checked(duk_hthread *thr, const duk_uint8_t **ptr, const duk_uint8_t *ptr_start, const duk_uint8_t *ptr_end);
 DUK_INTERNAL_DECL duk_size_t duk_unicode_unvalidated_utf8_length(const duk_uint8_t *data, duk_size_t blen);
+DUK_INTERNAL_DECL duk_bool_t duk_unicode_is_utf8_compatible(const duk_uint8_t *buf, duk_size_t len);
 DUK_INTERNAL_DECL duk_small_int_t duk_unicode_is_whitespace(duk_codepoint_t cp);
 DUK_INTERNAL_DECL duk_small_int_t duk_unicode_is_line_terminator(duk_codepoint_t cp);
 DUK_INTERNAL_DECL duk_small_int_t duk_unicode_is_identifier_start(duk_codepoint_t cp);
@@ -10352,6 +10446,8 @@ DUK_INTERNAL_DECL duk_bool_t duk_js_instanceof_ordinary(duk_hthread *thr, duk_tv
 #endif
 DUK_INTERNAL_DECL duk_bool_t duk_js_in(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y);
 DUK_INTERNAL_DECL duk_small_uint_t duk_js_typeof_stridx(duk_tval *tv_x);
+DUK_INTERNAL_DECL duk_bool_t duk_js_isarray_hobject(duk_hobject *h);
+DUK_INTERNAL_DECL duk_bool_t duk_js_isarray(duk_tval *tv);
 
 /* arithmetic */
 DUK_INTERNAL_DECL double duk_js_arith_pow(double x, double y);
@@ -10800,7 +10896,7 @@ DUK_INTERNAL void duk_debug_log(const char *fmt, ...) {
 #if defined(DUK_USE_ROM_STRINGS)
 #error ROM support not enabled, rerun configure.py with --rom-support
 #else  /* DUK_USE_ROM_STRINGS */
-DUK_INTERNAL const duk_uint8_t duk_strings_data[967] = {
+DUK_INTERNAL const duk_uint8_t duk_strings_data[972] = {
 79,40,209,144,168,105,6,78,54,139,89,185,44,48,46,90,120,8,154,140,35,103,
 35,113,193,73,5,52,112,180,104,166,135,52,188,4,98,12,27,146,156,80,211,31,
 129,115,150,64,52,220,109,24,18,68,156,24,38,67,114,36,55,9,119,151,132,
@@ -10828,34 +10924,34 @@ DUK_INTERNAL const duk_uint8_t duk_strings_data[967] = {
 113,67,77,201,128,223,255,223,224,121,44,48,46,95,203,145,46,9,205,16,39,
 201,62,36,0,192,21,147,255,238,145,39,199,197,211,116,240,242,113,197,78,
 214,211,226,233,187,107,105,19,119,37,56,161,166,52,221,212,201,205,36,240,
-242,16,96,152,12,178,52,211,56,228,73,150,83,0,148,39,137,75,67,73,198,209,
-129,36,85,185,201,196,2,32,193,48,17,160,97,16,84,44,156,104,24,67,189,200,
-108,201,19,238,114,96,137,137,50,238,113,164,188,211,185,192,226,100,19,
-134,68,110,112,174,139,0,185,31,115,149,4,88,7,159,115,146,117,34,34,35,
-115,143,22,146,208,210,19,115,140,3,207,185,202,130,36,109,85,185,194,161,
-160,90,50,72,155,115,149,2,232,67,137,204,122,22,66,161,175,164,210,72,199,
-130,137,1,50,32,145,143,38,120,186,195,35,106,51,146,230,8,36,77,109,65,38,
-226,72,159,191,189,181,70,140,133,222,249,212,227,66,125,245,187,251,219,
-77,3,119,190,117,56,208,159,125,110,254,246,210,26,93,239,157,78,52,39,223,
-93,191,189,180,212,52,187,223,58,156,104,79,190,187,127,123,104,180,104,
-183,190,117,56,208,159,125,102,254,209,104,209,124,234,113,161,62,250,80,
-196,128,81,4,9,16,162,4,196,116,9,205,154,27,66,32,100,13,12,98,68,227,33,
-65,69,204,195,34,201,50,8,110,33,23,34,28,168,104,22,188,12,174,138,11,70,
-138,104,115,68,130,137,13,82,27,41,129,162,35,138,54,146,198,137,39,72,180,
-210,178,38,35,146,103,68,139,51,197,214,28,227,131,79,15,35,138,58,130,37,
-19,155,41,146,174,64,203,99,161,100,37,145,51,148,75,4,164,66,54,140,49,46,
-247,70,103,37,230,70,142,70,67,30,232,204,178,163,201,18,54,139,89,39,26,
-16,165,2,228,69,33,143,89,24,70,206,73,67,102,72,148,2,32,214,73,157,224,
-18,128,98,29,241,69,65,50,37,241,116,200,41,144,102,125,2,180,8,210,152,38,
-129,23,8,34,198,
+242,16,96,152,12,26,20,164,137,150,70,154,103,28,137,50,202,96,18,132,241,
+41,104,105,56,218,48,36,138,183,57,56,128,68,24,38,2,52,12,34,10,133,147,
+141,3,8,119,185,13,153,34,125,206,76,17,49,38,93,206,52,151,154,119,56,28,
+76,130,112,200,141,206,21,209,96,23,35,238,114,160,139,0,243,238,114,78,
+164,68,68,110,113,226,210,90,26,66,110,113,128,121,247,57,80,68,141,170,
+183,56,84,52,11,70,73,19,110,114,160,93,8,113,57,143,66,200,84,53,244,154,
+73,24,240,81,32,38,68,18,49,228,207,23,88,100,109,70,114,92,193,4,137,173,
+168,36,220,73,19,247,247,182,168,209,144,187,223,58,156,104,79,190,183,127,
+123,105,160,110,247,206,167,26,19,239,173,223,222,218,67,75,189,243,169,
+198,132,251,235,183,247,182,154,134,151,123,231,83,141,9,247,215,111,239,
+109,22,141,22,247,206,167,26,19,239,172,223,218,45,26,47,157,78,52,39,223,
+74,24,144,10,32,129,34,20,64,152,142,129,57,179,67,104,68,12,129,161,140,
+72,156,100,40,40,185,152,100,89,38,65,13,196,34,228,67,149,13,2,215,129,
+149,209,65,104,209,77,14,104,144,81,33,170,67,101,48,52,68,113,70,210,88,
+209,36,233,22,154,86,68,196,114,76,232,145,102,120,186,195,156,112,105,225,
+228,113,71,80,68,162,115,101,50,85,200,25,108,116,44,132,178,38,114,137,96,
+148,136,70,209,134,37,222,232,204,228,188,200,209,200,200,99,221,25,150,84,
+121,34,70,209,107,36,227,66,20,160,92,136,164,49,235,35,8,217,201,40,108,
+201,18,128,68,26,201,51,188,2,80,12,67,190,40,168,38,68,190,46,153,5,50,12,
+207,160,86,129,26,83,4,208,34,225,4,88,192,
 };
 #endif  /* DUK_USE_ROM_STRINGS */
 
 #if defined(DUK_USE_ROM_OBJECTS)
 #error ROM support not enabled, rerun configure.py with --rom-support
 #else  /* DUK_USE_ROM_OBJECTS */
-/* native functions: 183 */
-DUK_INTERNAL const duk_c_function duk_bi_native_functions[183] = {
+/* native functions: 185 */
+DUK_INTERNAL const duk_c_function duk_bi_native_functions[185] = {
 	NULL,
 	duk_bi_array_constructor,
 	duk_bi_array_constructor_is_array,
@@ -10881,6 +10977,8 @@ DUK_INTERNAL const duk_c_function duk_bi_native_functions[183] = {
 	duk_bi_buffer_readfield,
 	duk_bi_buffer_slice_shared,
 	duk_bi_buffer_writefield,
+	duk_bi_cbor_decode,
+	duk_bi_cbor_encode,
 	duk_bi_dataview_constructor,
 	duk_bi_date_constructor,
 	duk_bi_date_constructor_now,
@@ -11041,598 +11139,604 @@ DUK_INTERNAL const duk_c_function duk_bi_native_functions[183] = {
 	duk_bi_uint8array_plainof,
 };
 #if defined(DUK_USE_DOUBLE_LE)
-DUK_INTERNAL const duk_uint8_t duk_builtins_data[4251] = {
-144,148,105,225,32,68,52,228,126,12,104,201,37,132,52,167,194,138,105,244,
-124,57,28,211,57,18,64,52,238,254,44,138,111,171,241,164,19,87,137,30,33,
-167,18,145,159,8,211,137,9,225,42,5,240,145,139,163,163,8,211,137,10,228,
-64,211,19,132,140,93,29,56,70,156,72,119,34,66,146,36,104,137,194,70,46,
-142,172,35,78,36,47,146,195,102,11,240,145,139,163,175,8,211,137,9,228,240,
-242,112,145,139,163,179,8,211,137,8,237,34,130,118,49,116,118,225,26,48,0,
-1,94,29,201,158,46,183,39,135,147,132,140,93,16,132,76,66,33,8,66,16,132,
-33,8,66,26,180,41,97,167,64,150,34,33,154,112,0,1,87,247,35,79,103,237,198,
-174,216,47,31,23,95,17,13,31,217,96,211,49,50,53,212,77,141,24,0,0,179,10,
-228,240,242,15,128,140,65,128,134,188,0,0,89,167,97,181,224,0,2,205,62,53,
-224,0,2,205,66,237,120,0,0,179,81,204,107,192,0,5,154,150,67,94,0,0,44,212,
-245,90,240,0,1,102,169,162,215,128,0,11,53,93,150,188,0,0,89,171,111,53,
-108,150,163,70,0,0,42,2,249,50,94,124,35,68,225,146,49,13,24,0,0,165,161,
-124,153,47,62,12,130,112,201,24,132,56,97,115,16,0,0,0,0,0,0,62,31,243,48,
-0,0,0,0,0,0,60,31,242,241,32,26,193,55,132,112,161,156,72,135,26,41,200,
-140,114,163,156,201,7,56,79,9,80,47,132,140,93,19,160,43,145,3,76,78,18,49,
-116,78,144,238,68,133,36,72,209,19,132,140,93,19,168,47,146,195,102,11,240,
-145,139,162,117,132,242,120,121,56,72,197,209,59,2,59,72,160,157,140,93,19,
-181,36,242,50,143,36,31,131,162,166,7,144,238,133,227,226,235,224,242,161,
-249,18,21,100,20,207,44,199,151,180,122,89,135,152,154,121,153,199,156,158,
-121,218,7,158,162,121,250,71,160,166,122,26,135,162,170,122,58,199,164,16,
-240,70,68,226,27,51,199,138,120,35,34,112,171,112,38,121,1,124,153,47,62,
-17,162,112,201,19,211,11,228,201,121,240,100,19,134,72,158,160,91,201,18,
-186,44,3,68,79,122,168,151,115,165,40,21,18,227,65,198,231,200,8,68,184,84,
-53,19,38,120,128,145,144,78,25,59,72,163,48,64,144,200,39,12,157,164,80,46,
-185,143,115,72,217,230,72,9,35,68,225,147,180,138,51,68,9,17,162,112,201,
-218,69,2,235,152,247,52,141,158,108,128,98,72,64,121,51,132,4,81,164,144,
-128,242,104,136,0,16,92,38,14,49,39,199,197,211,116,240,242,113,197,231,18,
-53,189,116,65,131,18,124,117,155,199,197,207,36,103,142,12,146,20,80,249,
-186,60,116,4,204,73,241,214,111,31,23,60,145,158,56,208,48,146,229,146,3,2,
-82,65,155,195,94,3,10,36,4,201,196,64,56,100,42,26,78,62,46,121,35,60,113,
-152,16,25,10,134,147,143,139,158,72,205,4,151,21,0,73,16,11,230,144,12,88,
-144,153,39,52,144,69,241,37,72,217,240,151,153,27,36,57,178,230,16,16,137,
-114,68,2,200,62,81,1,8,151,11,23,100,141,229,18,6,34,92,37,230,70,201,1,89,
-57,36,2,40,152,151,44,129,83,18,124,117,155,199,197,207,36,103,142,75,12,
-11,151,46,89,40,18,37,200,64,12,154,236,252,238,185,23,95,213,1,132,234,0,
-194,245,128,14,56,37,199,89,188,124,92,242,70,120,232,16,26,137,113,241,
-116,221,60,60,156,113,122,36,10,62,46,121,35,60,113,18,225,27,70,18,32,10,
-201,211,32,67,107,104,100,42,26,78,24,147,153,35,181,181,207,64,67,107,104,
-100,42,26,78,72,147,153,35,181,181,207,68,16,218,218,91,156,170,63,134,36,
-230,72,237,109,116,136,16,218,218,91,156,170,63,146,36,230,72,237,109,116,
-137,16,96,128,228,2,6,191,46,3,71,147,68,4,16,22,188,169,240,16,40,104,242,
-135,198,171,44,68,65,5,217,231,215,6,231,62,188,8,49,1,3,162,92,4,98,12,41,
-7,33,148,53,242,128,97,32,130,3,9,205,16,38,199,198,14,9,0,111,115,225,0,8,
-250,72,240,207,128,241,37,73,25,18,40,0,178,58,11,56,192,2,201,104,17,35,
-160,9,39,70,114,8,6,147,214,129,18,74,240,30,141,145,208,89,203,62,3,161,
-163,37,248,226,185,244,11,88,37,62,33,163,37,248,226,185,252,0,127,255,130,
-146,164,142,32,26,1,36,230,18,1,164,7,43,163,194,0,71,128,105,64,216,7,192,
-52,192,197,66,230,72,192,52,224,209,32,232,34,68,62,129,113,32,232,34,114,
-40,49,231,16,254,0,63,255,208,99,2,140,44,92,206,8,224,143,4,225,147,210,
-124,13,44,92,206,9,195,39,30,228,54,126,163,225,200,169,198,133,42,166,191,
-246,3,11,251,0,24,71,4,120,9,251,8,10,17,193,30,9,195,39,1,63,105,1,98,112,
-201,199,185,13,159,1,63,105,32,48,156,209,2,126,227,224,58,26,50,95,142,47,
-192,208,22,176,74,124,67,70,75,241,197,248,26,64,213,184,64,89,56,39,49,
-224,137,62,36,2,176,19,17,254,68,3,196,143,88,4,79,162,0,210,32,34,35,253,
-72,5,146,208,34,125,144,5,147,214,137,253,208,9,149,3,41,197,13,55,233,0,
-185,187,139,117,137,30,8,18,39,172,1,25,187,139,112,128,178,113,110,177,35,
-193,2,68,245,128,23,55,114,143,121,35,193,2,68,245,130,8,205,220,91,132,5,
-147,148,123,201,30,8,18,39,172,16,18,113,67,63,128,3,68,143,32,39,243,32,
-42,83,4,103,46,89,19,63,224,208,16,70,142,92,178,38,127,193,164,8,67,68,
-186,12,146,247,154,1,165,64,202,113,252,160,131,32,7,35,167,26,50,235,231,
-130,48,179,192,65,148,69,19,214,2,251,85,2,232,72,31,255,255,255,255,255,
-253,239,226,122,196,55,106,160,93,9,0,4,0,0,0,0,0,0,3,49,0,0,0,0,0,0,3,225,
-252,143,94,233,34,104,169,54,144,210,161,168,158,32,0,0,0,0,0,0,120,63,145,
-235,72,96,77,21,38,210,26,84,53,19,196,0,0,0,0,0,0,15,15,240,253,35,228,
-133,185,176,0,0,0,0,0,0,44,15,8,117,128,190,212,128,82,109,33,179,33,137,
-24,31,255,255,255,255,255,231,232,100,58,196,55,106,64,41,54,144,217,144,
-196,140,15,255,255,255,255,255,243,252,49,15,4,100,78,33,179,60,120,167,
-130,50,39,10,183,2,103,144,113,8,151,10,134,162,100,221,16,18,137,113,13,
-153,12,72,238,137,1,81,46,52,28,110,232,148,53,18,228,128,82,113,13,153,12,
-72,238,137,142,73,78,52,0,0,0,0,0,0,0,0,8,58,254,1,12,38,248,134,23,130,0,
-60,221,194,162,228,30,244,128,217,187,132,187,220,210,54,104,2,247,132,5,
-205,220,124,72,36,73,14,110,252,132,25,128,193,94,8,200,149,200,3,237,38,
-43,31,192,54,186,213,128,57,45,56,210,0,0,0,0,0,0,62,31,241,90,251,224,6,
-77,220,24,38,78,74,113,67,77,124,16,50,110,228,208,194,114,83,138,26,107,
-224,172,37,240,97,41,187,139,112,128,178,112,96,153,57,41,197,13,53,240,
-113,41,187,139,112,128,178,114,104,97,57,41,197,13,53,240,128,195,95,8,44,
-61,240,132,216,93,33,133,192,128,14,98,79,147,67,9,129,0,44,196,159,11,69,
-175,152,32,35,100,33,135,24,147,237,38,34,246,139,95,48,64,70,200,68,8,49,
-39,198,57,179,61,144,138,22,98,79,180,152,153,215,54,103,178,17,129,204,73,
-240,96,153,44,132,112,163,18,125,164,196,62,130,100,178,18,1,140,73,240,96,
-197,144,146,18,98,79,180,152,135,208,98,200,74,8,49,39,195,186,145,149,144,
-150,22,98,79,180,152,143,215,82,50,178,19,2,140,73,241,136,109,38,73,89,9,
-161,166,36,251,73,137,157,67,105,50,74,200,78,10,49,39,201,16,78,104,229,
-100,39,134,152,147,237,38,41,116,130,115,71,43,33,64,60,196,159,24,133,173,
-18,32,156,209,202,200,81,18,49,39,218,76,76,234,22,180,72,130,115,71,43,33,
-72,68,196,159,38,134,19,46,105,56,226,150,68,157,160,1,228,73,242,104,97,
-46,16,31,34,79,140,66,214,137,16,78,104,229,108,169,137,72,147,237,38,38,
-117,11,90,36,65,57,163,149,178,168,21,34,79,146,32,156,209,202,218,250,161,
-178,36,251,73,138,93,32,156,209,202,218,250,193,82,36,248,196,54,147,36,
-173,191,174,27,34,79,180,152,153,212,54,147,36,173,191,176,17,34,79,135,
-117,35,43,115,236,133,200,147,237,38,35,245,212,140,173,207,180,15,34,79,
-131,4,201,108,173,133,72,147,237,38,33,244,19,37,178,184,17,34,79,140,115,
-102,123,107,238,133,200,147,237,38,38,117,205,153,237,175,188,23,34,79,133,
-162,215,204,16,17,182,254,248,116,137,62,210,98,47,104,181,243,4,4,109,191,
-192,131,152,147,230,8,8,217,12,16,60,137,62,96,128,141,178,193,181,55,136,
-200,51,128,114,108,28,100,128,0,0,0,0,0,0,0,12,110,127,32,98,115,249,73,
-117,243,249,67,21,159,202,38,47,63,148,86,8,75,144,94,50,1,38,73,79,204,67,
-95,231,1,6,128,14,79,129,185,40,249,18,149,181,207,142,199,155,172,248,172,
-89,183,207,140,198,137,175,200,0,159,72,10,5,21,220,138,120,74,129,124,36,
-98,232,228,74,81,62,160,20,10,107,185,21,114,32,105,137,194,70,46,142,68,
-165,19,235,1,64,170,187,145,119,34,66,146,36,104,137,194,70,46,142,68,165,
-19,236,1,64,174,187,145,95,37,134,204,23,225,35,23,71,34,82,137,246,128,
-160,89,93,200,167,147,195,201,194,70,46,142,68,165,19,238,1,64,182,187,145,
-71,105,20,19,177,139,163,145,41,68,16,7,6,15,82,70,72,115,96,0,0,0,0,0,118,
-105,160,91,60,165,195,201,194,8,134,149,216,130,0,192,41,224,136,2,48,176,
-228,1,149,13,195,15,0,200,209,97,71,128,99,32,176,131,192,113,57,143,0,167,
-131,32,230,80,28,202,139,175,237,2,48,189,160,20,1,119,48,87,193,186,129,
-89,56,72,197,209,200,193,185,35,23,71,109,13,219,36,98,232,237,156,13,26,
-208,211,14,102,19,87,137,91,95,128,0,10,64,24,92,0,0,82,2,53,63,240,49,204,
-202,10,14,38,78,44,141,52,207,31,0,0,22,32,129,100,180,8,148,145,78,102,
-152,80,113,50,113,100,105,166,120,248,0,0,177,1,65,196,201,199,20,178,36,
-227,224,0,2,200,3,6,133,41,35,31,0,0,22,1,44,57,137,62,33,179,216,162,152,
-192,131,18,124,162,27,61,138,41,108,32,196,159,16,217,232,235,81,76,104,73,
-137,62,81,13,158,142,181,20,184,16,98,79,136,108,244,244,168,166,56,36,196,
-159,40,134,207,79,74,138,93,10,49,39,194,173,192,158,158,149,20,188,20,98,
-79,133,91,129,61,109,74,41,124,30,68,159,16,217,236,83,108,96,68,137,62,81,
-13,158,197,54,182,17,34,79,136,108,244,117,169,182,52,38,68,159,40,134,207,
-71,90,155,92,8,145,39,196,54,122,122,84,219,28,19,34,79,148,67,103,167,165,
-77,174,133,72,147,225,86,224,79,79,74,155,94,10,145,39,194,173,192,158,182,
-165,54,190,206,25,212,35,208,226,100,150,211,201,29,162,44,140,35,103,0,0,
-0,0,0,0,3,192,252,206,25,228,35,208,226,100,150,211,201,29,162,44,140,35,
-103,0,0,0,0,0,0,3,192,252,206,25,244,35,208,226,100,150,211,201,29,162,44,
-140,35,103,0,0,0,0,0,0,3,192,252,206,26,4,35,208,226,100,150,211,201,29,
-162,44,140,35,103,0,0,0,0,0,0,0,1,0,206,26,20,35,208,226,100,150,211,201,
-29,162,44,140,35,103,0,0,0,0,0,0,0,1,0,206,26,36,35,208,226,100,150,211,
-201,29,162,44,140,35,103,0,0,0,0,0,0,0,65,0,206,26,52,35,208,226,100,150,
-211,201,29,162,44,140,35,103,0,0,0,0,0,0,0,65,0,206,26,68,35,208,226,100,
-150,211,201,29,162,44,140,35,103,0,0,0,0,0,0,0,65,0,206,26,84,35,208,226,
-100,150,211,201,29,162,44,140,35,103,0,0,0,0,0,0,0,129,0,195,154,99,16,38,
-36,0,251,68,117,179,216,162,128,68,72,1,241,13,158,197,20,150,25,18,0,125,
-162,58,217,232,235,117,100,162,136,25,18,0,125,162,58,217,232,235,116,36,
-162,145,2,226,64,15,136,108,244,117,186,178,81,73,129,113,32,7,196,54,122,
-58,221,9,40,165,64,200,144,3,237,17,214,207,79,75,171,37,20,80,200,144,3,
-237,17,214,207,79,75,161,37,20,138,23,18,0,124,67,103,167,165,213,146,138,
-77,11,137,0,62,33,179,211,210,232,73,69,42,133,196,128,31,10,183,2,125,89,
-40,163,5,196,128,31,10,183,2,125,9,40,164,96,200,144,3,224,221,64,172,157,
-89,40,163,134,68,128,31,6,234,5,100,232,73,69,35,133,68,128,31,104,142,182,
-125,89,40,180,0,168,144,3,237,17,214,207,161,37,22,144,19,18,0,124,67,103,
-213,146,139,80,9,137,0,62,33,179,232,73,69,172,5,90,40,153,59,68,117,179,
-216,166,192,77,162,137,147,136,108,246,41,180,176,219,69,19,39,104,142,182,
-122,58,221,89,41,178,6,218,40,153,59,68,117,179,209,214,232,73,77,162,6,90,
-40,153,56,134,207,71,91,171,37,54,152,25,104,162,100,226,27,61,29,110,132,
-148,218,160,109,162,137,147,180,71,91,61,61,46,172,148,217,67,109,20,76,
-157,162,58,217,233,233,116,36,166,209,67,45,20,76,156,67,103,167,165,213,
-146,155,77,12,180,81,50,113,13,158,158,151,66,74,109,84,50,209,68,201,194,
-173,192,159,86,74,108,193,150,138,38,78,21,110,4,250,18,83,104,193,182,138,
-38,78,13,212,10,201,213,146,155,56,109,162,137,147,131,117,2,178,116,36,
-166,209,194,237,20,76,157,162,58,217,245,100,167,16,2,237,20,76,157,162,58,
-217,244,36,167,18,2,173,20,76,156,67,103,213,146,156,80,10,180,81,50,113,
-13,159,66,74,113,97,175,220,48,216,109,192,4,42,22,189,163,0,196,133,0,185,
-80,32,28,78,99,193,18,80,36,4,19,159,141,156,0,178,90,4,74,73,0,22,209,68,
-201,185,129,4,2,8,3,132,64,60,36,6,149,113,72,176,171,240,84,0,157,91,116,
-116,32,11,42,218,221,216,181,129,32,3,234,219,165,3,188,231,235,249,8,187,
-152,252,47,86,227,105,18,7,244,17,91,42,56,175,185,248,110,173,198,209,208,
-36,0,238,82,97,87,188,189,179,240,93,122,32,12,22,162,42,125,144,132,160,7,
-236,161,25,232,237,105,64,205,59,127,102,158,160,230,63,11,217,66,51,210,
-129,154,118,254,205,61,65,236,127,171,197,34,168,48,6,90,162,1,0,39,75,84,
-72,8,9,33,186,162,80,64,76,13,213,19,2,130,96,110,150,181,0,65,6,51,213,20,
-128,65,17,11,213,19,130,137,121,211,210,210,144,6,39,75,84,80,0,201,119,
-234,138,8,41,86,231,71,84,80,129,79,135,186,122,101,224,34,25,69,233,208,3,
-91,141,170,40,96,139,113,180,181,69,36,21,110,54,142,134,168,165,1,176,23,
-212,47,0,216,134,234,87,128,111,117,181,168,128,209,3,70,230,106,192,5,139,
-168,209,234,138,32,36,144,102,235,8,3,146,27,170,40,160,146,132,103,170,40,
-192,115,3,117,69,28,22,113,163,69,170,41,103,1,66,188,17,145,52,104,4,202,
-113,67,76,130,227,72,194,13,240,108,0,0,83,96,0,2,185,0,104,146,84,97,48,0,
-1,90,192,56,169,24,145,179,192,0,5,96,8,56,16,32,128,56,18,52,125,198,86,
-147,186,140,28,50,21,13,39,31,23,60,145,158,56,204,141,47,121,6,155,190,
-188,24,49,39,199,89,188,124,92,242,70,120,224,201,33,69,15,155,163,199,68,
-14,49,39,199,197,211,116,240,242,113,197,231,18,180,254,4,3,17,46,18,243,
-35,100,128,172,156,146,70,163,150,76,34,248,146,164,108,248,75,204,141,146,
-28,217,115,9,27,79,11,241,173,235,162,160,224,200,2,206,9,113,13,148,192,
-209,18,22,164,146,37,193,57,162,4,249,39,196,128,24,2,178,66,213,136,68,
-201,16,77,209,131,31,192,242,88,96,92,191,151,34,100,136,38,232,255,252,92,
-221,199,197,12,68,209,82,66,212,11,155,185,41,197,13,55,38,3,66,213,47,131,
-250,72,12,162,99,133,116,127,196,32,225,1,3,34,92,170,9,105,164,32,225,64,
-131,156,1,193,133,7,19,39,22,70,154,103,143,128,0,11,16,20,28,76,156,113,
-75,34,78,62,0,0,44,128,48,104,82,146,49,240,0,1,96,11,180,192,0,5,162,1,18,
-160,65,24,131,20,145,25,188,48,132,122,28,76,146,218,121,35,180,69,145,132,
-108,224,0,0,0,0,0,0,120,31,153,188,56,132,122,28,76,146,218,121,35,180,69,
-145,132,108,224,0,0,0,0,0,0,120,31,168,160,45,110,23,30,176,33,184,0,0,181,
-32,29,235,2,27,199,23,0,0,22,196,51,120,129,8,244,56,153,37,180,242,71,104,
-139,35,8,217,192,0,0,0,0,0,0,240,63,51,120,145,8,244,56,153,37,180,242,71,
-104,139,35,8,217,192,0,0,0,0,0,0,0,64,51,120,161,8,244,56,153,37,180,242,
-71,104,139,35,8,217,192,0,0,0,0,0,0,0,64,51,120,177,8,244,56,153,37,180,
-242,71,104,139,35,8,217,192,0,0,0,0,0,0,16,64,51,120,193,8,244,56,153,37,
-180,242,71,104,139,35,8,217,192,0,0,0,0,0,0,16,64,51,120,209,8,244,56,153,
-37,180,242,71,104,139,35,8,217,192,0,0,0,0,0,0,16,64,51,120,225,8,244,56,
-153,37,180,242,71,104,139,35,8,217,192,0,0,0,0,0,0,32,64,32,227,194,0,97,
-57,162,4,246,40,5,34,92,35,68,225,161,166,219,16,16,137,112,52,41,73,29,
-169,1,65,196,201,197,145,166,153,246,8,3,137,204,120,34,74,8,200,58,128,28,
-211,160,130,52,78,26,26,110,248,0,0,170,4,12,70,137,195,38,0,0,42,68,159,7,
-84,3,154,150,16,70,137,195,67,77,223,0,0,20,224,20,160,152,23,223,0,0,20,
-226,9,65,154,232,147,161,115,59,224,0,2,156,84,12,50,9,195,38,0,0,41,133,
-30,224,32,54,186,221,128,60,
+DUK_INTERNAL const duk_uint8_t duk_builtins_data[4281] = {
+144,148,105,226,32,68,52,228,254,12,104,202,37,132,52,167,194,138,105,245,
+124,57,28,211,57,18,64,52,239,126,44,138,111,175,241,164,19,87,145,30,33,
+167,22,145,159,8,211,139,9,225,42,5,240,145,139,163,163,8,211,139,10,228,
+64,211,19,132,140,93,29,56,70,156,88,119,34,66,146,36,104,137,194,70,46,
+142,172,35,78,44,47,146,195,102,11,240,145,139,163,175,8,211,139,9,228,240,
+242,112,145,139,163,179,8,211,139,8,237,34,130,118,49,116,118,225,26,48,0,
+1,98,29,201,158,46,183,39,135,147,132,140,93,16,132,76,66,33,8,66,16,132,
+33,8,66,26,180,105,97,167,68,150,34,33,154,112,0,1,91,247,35,79,111,237,
+198,174,232,47,31,23,95,17,13,31,249,96,211,49,50,53,214,77,141,24,0,0,181,
+10,228,240,242,15,128,140,65,128,134,188,0,0,90,167,97,181,224,0,2,213,62,
+53,224,0,2,213,66,237,120,0,0,181,81,204,107,192,0,5,170,150,67,94,0,0,45,
+84,245,90,240,0,1,106,169,162,215,128,0,11,85,93,150,188,0,0,90,171,111,53,
+109,22,162,26,48,0,1,84,23,201,146,243,225,26,39,12,145,136,104,192,0,5,61,
+11,228,201,121,240,100,19,134,72,196,33,195,14,40,203,112,64,190,76,232,
+145,153,136,0,0,0,0,0,0,31,15,249,152,0,0,0,0,0,0,30,15,249,120,144,13,96,
+155,194,56,80,206,36,67,141,20,228,70,57,81,206,100,131,156,39,132,168,23,
+194,70,46,137,208,21,200,129,166,39,9,24,186,39,72,119,34,66,146,36,104,
+137,194,70,46,137,212,23,201,97,179,5,248,72,197,209,58,194,121,60,60,156,
+36,98,232,157,129,29,164,80,78,198,46,137,218,146,121,25,71,146,9,209,5,
+209,61,48,126,14,138,152,30,67,186,23,143,139,175,131,202,135,228,72,85,
+144,83,60,179,30,94,209,233,102,30,98,105,230,103,30,114,121,231,104,30,
+122,137,231,233,30,130,153,232,106,30,138,169,232,235,30,144,67,193,25,19,
+136,108,207,30,41,224,140,137,194,173,192,153,228,5,242,100,188,248,70,137,
+195,36,79,78,47,147,37,231,193,144,78,25,34,122,145,111,36,74,232,176,13,
+17,61,234,226,93,207,148,160,84,75,141,7,27,161,32,33,18,225,80,212,76,154,
+2,2,70,65,56,100,237,34,140,209,2,67,32,156,50,118,145,64,186,230,61,205,
+35,103,155,32,36,141,19,134,78,210,40,206,16,36,70,137,195,39,105,20,11,
+174,99,220,210,54,121,210,1,137,33,1,228,207,16,17,70,146,66,3,201,164,32,
+0,65,112,152,56,196,159,31,23,77,211,195,201,199,23,160,72,214,246,81,6,12,
+73,241,214,111,31,23,60,145,158,56,50,72,81,67,230,232,242,80,19,49,39,199,
+89,188,124,92,242,70,120,227,64,194,75,154,72,12,9,73,6,111,21,120,12,40,
+144,19,39,25,0,225,144,168,105,56,248,185,228,140,241,200,96,64,100,42,26,
+78,62,46,121,35,52,18,92,116,1,36,64,47,158,64,49,98,66,100,156,242,65,23,
+196,149,35,103,194,94,100,108,144,230,203,156,64,66,37,201,16,11,32,249,
+132,4,34,92,44,93,146,55,152,72,24,137,112,151,153,27,36,5,100,229,144,8,
+162,98,92,210,5,76,73,241,214,111,31,23,60,145,158,57,44,48,46,92,185,164,
+160,72,151,41,0,50,107,179,244,59,36,93,127,92,6,19,172,3,11,216,0,56,224,
+151,29,102,241,241,115,201,25,227,164,64,106,37,199,197,211,116,240,242,
+113,197,233,144,40,248,185,228,140,241,196,75,132,109,24,72,128,43,39,84,
+129,13,173,161,144,168,105,56,98,78,100,142,214,215,69,1,13,173,161,144,
+168,105,57,34,78,100,142,214,215,69,16,67,107,105,110,114,168,254,24,147,
+153,35,181,181,212,32,67,107,105,110,114,168,254,72,147,153,35,181,181,212,
+36,65,130,3,144,8,26,252,200,13,30,85,16,16,64,90,242,231,192,64,161,163,
+203,31,26,172,193,17,4,23,105,159,96,27,172,251,16,32,196,4,14,137,112,17,
+136,48,164,28,134,80,215,202,1,132,130,8,12,39,52,64,155,31,24,56,36,1,189,
+207,132,0,35,233,35,195,62,3,196,149,36,100,72,160,2,200,232,44,227,0,11,
+37,160,68,142,128,36,157,25,200,32,26,79,90,4,73,43,192,122,54,71,65,103,
+44,248,14,134,140,151,227,138,231,208,45,96,148,248,134,140,151,227,138,
+231,240,1,255,254,10,74,146,56,128,104,4,147,152,72,6,144,28,174,143,8,1,
+30,1,165,3,96,31,0,211,3,21,11,153,35,0,211,131,68,131,160,137,16,250,5,
+196,131,160,137,200,160,199,156,67,248,0,255,255,65,140,10,48,177,115,56,
+35,130,60,19,134,79,89,240,52,177,115,56,39,12,156,123,144,217,251,15,135,
+34,167,30,20,170,154,255,232,12,47,244,0,97,28,17,224,39,238,32,40,71,4,
+120,39,12,156,4,253,228,5,137,195,39,30,228,54,124,4,253,228,128,194,115,
+68,9,252,15,128,232,104,201,126,56,191,35,64,90,193,41,241,13,25,47,199,23,
+228,105,3,86,225,1,100,224,156,199,130,36,249,144,10,192,76,71,250,16,15,
+18,61,96,17,62,200,3,72,128,136,143,247,32,22,75,64,137,248,64,22,79,90,39,
+249,64,38,84,12,167,20,52,223,196,2,230,238,45,214,36,120,32,72,158,208,4,
+102,238,45,194,2,201,197,186,196,143,4,9,19,218,0,92,221,202,61,228,143,4,
+9,19,218,8,35,55,113,110,16,22,78,81,239,36,120,32,72,158,208,64,73,197,12,
+255,0,13,18,60,128,159,212,128,169,76,17,156,185,100,76,255,163,64,65,26,
+57,114,200,153,255,70,144,33,13,18,232,50,75,226,104,6,149,3,41,199,246,
+130,12,128,28,142,156,120,203,175,158,8,194,207,1,6,81,20,79,88,11,237,84,
+11,161,32,127,255,255,255,255,255,247,191,137,235,16,221,170,129,116,36,0,
+16,0,0,0,0,0,0,12,196,0,0,0,0,0,0,15,135,242,61,123,164,137,162,164,218,67,
+74,134,162,120,128,0,0,0,0,0,1,224,254,71,173,33,129,52,84,155,72,105,80,
+212,79,16,0,0,0,0,0,0,60,63,195,244,143,146,22,230,192,0,0,0,0,0,0,176,60,
+33,214,2,251,82,1,73,180,134,204,134,36,96,127,255,255,255,255,255,159,161,
+144,235,16,221,169,0,164,218,67,102,67,18,48,63,255,255,255,255,255,207,
+240,196,60,17,145,56,134,204,241,226,158,8,200,156,42,220,9,158,65,196,34,
+92,42,26,137,147,120,64,74,37,196,54,100,49,35,188,36,5,68,184,208,113,187,
+194,80,212,75,146,1,73,196,54,100,49,35,188,38,57,37,56,240,0,0,0,0,0,0,0,
+0,32,235,248,68,48,156,2,24,94,24,0,243,119,10,139,144,123,242,3,102,238,
+18,239,115,72,217,160,11,223,16,23,55,113,241,32,145,36,57,188,18,16,102,3,
+5,120,35,34,89,32,15,180,152,173,127,0,218,235,88,0,228,180,227,200,0,0,0,
+0,0,0,248,127,197,107,240,64,6,77,220,24,38,78,74,113,67,77,130,4,12,155,
+185,52,48,156,148,226,134,155,4,10,194,96,129,132,166,238,45,194,2,201,193,
+130,100,228,167,20,52,216,32,113,41,187,139,112,128,178,114,104,97,57,41,
+197,13,54,8,32,48,216,32,130,195,224,130,19,97,124,134,23,6,0,57,137,62,77,
+12,38,12,0,179,18,124,45,22,190,96,128,141,176,134,28,98,79,180,152,139,
+218,45,124,193,1,27,97,16,32,196,159,24,230,204,246,194,40,89,137,62,210,
+98,103,92,217,158,216,70,7,49,39,193,130,100,182,17,194,140,73,246,147,16,
+250,9,146,216,72,6,49,39,193,131,22,194,72,73,137,62,210,98,31,65,139,97,
+40,32,196,159,14,234,70,86,194,88,89,137,62,210,98,63,93,72,202,216,76,10,
+49,39,198,33,180,153,37,108,38,134,152,147,237,38,38,117,13,164,201,43,97,
+56,40,196,159,36,65,57,163,149,176,158,26,98,79,180,152,165,210,9,205,28,
+173,133,0,243,18,124,98,22,180,72,130,115,71,43,97,68,72,196,159,105,49,51,
+168,90,209,34,9,205,28,173,133,33,19,18,124,154,24,76,185,164,227,138,89,
+18,119,0,7,145,39,201,161,132,188,64,124,137,62,49,11,90,36,65,57,163,149,
+210,166,37,34,79,180,152,153,212,45,104,145,4,230,142,87,74,160,84,137,62,
+72,130,115,71,43,171,234,134,200,147,237,38,41,116,130,115,71,43,171,235,5,
+72,147,227,16,218,76,146,186,254,184,108,137,62,210,98,103,80,218,76,146,
+186,254,192,68,137,62,29,212,140,174,207,178,23,34,79,180,152,143,215,82,
+50,187,62,208,60,137,62,12,19,37,210,182,21,34,79,180,152,135,208,76,151,
+74,224,68,137,62,49,205,153,238,175,186,23,34,79,180,152,153,215,54,103,
+186,190,240,92,137,62,22,139,95,48,64,70,235,251,225,210,36,251,73,136,189,
+162,215,204,16,17,186,255,2,14,98,79,152,32,35,108,48,64,242,36,249,130,2,
+55,75,6,212,224,72,200,51,128,114,108,28,100,128,0,0,0,0,0,0,0,12,110,127,
+48,98,115,249,201,117,243,249,195,21,159,206,38,47,63,156,86,8,75,144,94,
+82,1,38,73,79,208,67,95,233,1,6,128,14,79,129,186,40,249,18,149,182,207,
+144,200,155,188,248,204,105,184,207,142,199,137,175,201,0,159,72,10,5,21,
+221,10,120,74,129,124,36,98,232,228,74,81,62,160,20,10,107,186,21,114,32,
+105,137,194,70,46,142,68,165,19,235,1,64,170,187,161,119,34,66,146,36,104,
+137,194,70,46,142,68,165,19,236,1,64,174,187,161,95,37,134,204,23,225,35,
+23,71,34,82,137,246,128,160,89,93,208,167,147,195,201,194,70,46,142,68,165,
+19,238,1,64,182,187,161,71,105,20,19,177,139,163,145,41,68,16,7,6,15,82,70,
+72,115,96,0,0,0,0,0,15,106,32,91,60,165,195,201,194,8,134,149,216,162,0,
+192,41,225,8,2,48,177,36,1,149,13,196,15,0,200,209,97,199,128,99,32,176,
+195,192,113,57,143,0,167,133,32,230,80,28,202,139,175,238,2,48,189,192,20,
+1,119,80,87,193,186,129,89,56,72,197,209,200,193,185,35,23,71,109,13,219,
+36,98,232,237,156,13,26,208,211,14,102,19,87,137,91,95,128,0,10,96,24,92,0,
+0,83,2,53,56,0,0,165,3,28,204,160,160,226,100,226,200,211,76,241,240,0,1,
+102,8,22,75,64,137,73,20,230,105,133,7,19,39,22,70,154,103,143,128,0,11,48,
+20,28,76,156,113,75,34,78,62,0,0,45,3,103,31,0,0,22,65,44,57,137,62,33,179,
+216,162,152,192,131,18,124,162,27,61,138,41,108,32,196,159,16,217,232,235,
+81,76,104,73,137,62,81,13,158,142,181,20,184,16,98,79,136,108,244,244,168,
+166,56,36,196,159,40,134,207,79,74,138,93,10,49,39,194,173,192,158,158,149,
+20,188,20,98,79,133,91,129,61,109,74,41,124,30,68,159,16,217,236,83,108,96,
+68,137,62,81,13,158,197,54,182,17,34,79,136,108,244,117,169,182,52,38,68,
+159,40,134,207,71,90,155,92,8,145,39,196,54,122,122,84,219,28,19,34,79,148,
+67,103,167,165,77,174,133,72,147,225,86,224,79,79,74,155,94,10,145,39,194,
+173,192,158,182,165,54,190,206,25,212,35,208,226,100,150,211,201,29,162,44,
+140,35,103,0,0,0,0,0,0,3,192,252,206,25,228,35,208,226,100,150,211,201,29,
+162,44,140,35,103,0,0,0,0,0,0,3,192,252,206,25,244,35,208,226,100,150,211,
+201,29,162,44,140,35,103,0,0,0,0,0,0,3,192,252,206,26,4,35,208,226,100,150,
+211,201,29,162,44,140,35,103,0,0,0,0,0,0,0,1,0,206,26,20,35,208,226,100,
+150,211,201,29,162,44,140,35,103,0,0,0,0,0,0,0,1,0,206,26,36,35,208,226,
+100,150,211,201,29,162,44,140,35,103,0,0,0,0,0,0,0,65,0,206,26,52,35,208,
+226,100,150,211,201,29,162,44,140,35,103,0,0,0,0,0,0,0,65,0,206,26,68,35,
+208,226,100,150,211,201,29,162,44,140,35,103,0,0,0,0,0,0,0,65,0,206,26,84,
+35,208,226,100,150,211,201,29,162,44,140,35,103,0,0,0,0,0,0,0,129,0,195,
+154,99,16,38,36,0,251,68,117,179,216,162,128,68,72,1,241,13,158,197,20,150,
+25,18,0,125,162,58,217,232,235,117,100,162,136,25,18,0,125,162,58,217,232,
+235,116,36,162,145,2,226,64,15,136,108,244,117,186,178,81,73,129,113,32,7,
+196,54,122,58,221,9,40,165,64,200,144,3,237,17,214,207,79,75,171,37,20,80,
+200,144,3,237,17,214,207,79,75,161,37,20,138,23,18,0,124,67,103,167,165,
+213,146,138,77,11,137,0,62,33,179,211,210,232,73,69,42,133,196,128,31,10,
+183,2,125,89,40,163,5,196,128,31,10,183,2,125,9,40,164,96,200,144,3,224,
+221,64,172,157,89,40,163,134,68,128,31,6,234,5,100,232,73,69,35,133,68,128,
+31,104,142,182,125,89,40,180,0,168,144,3,237,17,214,207,161,37,22,144,19,
+18,0,124,67,103,213,146,139,80,9,137,0,62,33,179,232,73,69,172,5,90,40,153,
+59,68,117,179,216,166,192,77,162,137,147,136,108,246,41,180,176,219,69,19,
+39,104,142,182,122,58,221,89,41,178,6,218,40,153,59,68,117,179,209,214,232,
+73,77,162,6,90,40,153,56,134,207,71,91,171,37,54,152,25,104,162,100,226,27,
+61,29,110,132,148,218,160,109,162,137,147,180,71,91,61,61,46,172,148,217,
+67,109,20,76,157,162,58,217,233,233,116,36,166,209,67,45,20,76,156,67,103,
+167,165,213,146,155,77,12,180,81,50,113,13,158,158,151,66,74,109,84,50,209,
+68,201,194,173,192,159,86,74,108,193,150,138,38,78,21,110,4,250,18,83,104,
+193,182,138,38,78,13,212,10,201,213,146,155,56,109,162,137,147,131,117,2,
+178,116,36,166,209,194,237,20,76,157,162,58,217,245,100,167,16,2,237,20,76,
+157,162,58,217,244,36,167,18,2,173,20,76,156,67,103,213,146,156,80,10,180,
+81,50,113,13,159,66,74,113,97,175,221,48,216,110,64,4,42,22,189,179,0,196,
+133,0,185,80,32,28,78,99,193,18,80,36,4,19,159,141,172,0,178,90,4,74,73,0,
+22,209,68,201,187,129,4,2,8,3,132,64,60,36,6,149,113,72,176,171,240,84,0,
+157,91,116,116,32,11,42,218,221,216,181,129,32,3,234,219,165,3,188,231,235,
+249,8,187,152,252,47,86,227,105,18,7,244,17,91,42,56,175,185,248,110,173,
+198,209,208,36,0,238,82,97,87,188,189,179,240,93,122,32,12,22,162,42,125,
+144,132,160,7,236,161,25,232,237,105,64,205,59,127,102,158,160,230,63,11,
+217,66,51,210,129,154,118,254,205,61,65,236,127,171,197,34,168,48,6,90,194,
+1,0,39,75,88,72,8,9,33,186,194,80,64,76,13,214,19,2,130,96,110,150,189,0,
+65,6,51,214,20,128,65,17,11,214,19,130,137,121,211,210,211,144,6,39,75,88,
+80,0,201,119,235,10,8,41,86,231,71,88,80,129,79,135,186,122,133,224,34,25,
+69,234,80,3,91,141,172,40,96,139,113,180,181,133,36,21,110,54,142,134,176,
+165,1,176,23,213,47,0,216,134,234,215,128,111,117,181,232,128,209,3,70,230,
+107,64,5,139,168,209,235,10,32,36,144,102,235,136,3,146,27,172,40,160,146,
+132,103,172,40,192,115,3,117,133,28,22,113,163,69,172,41,103,1,66,188,17,
+145,52,168,4,202,113,67,76,130,227,76,194,13,240,108,0,0,83,224,0,2,193,0,
+104,146,84,97,48,0,1,94,192,56,169,24,145,179,192,0,5,112,8,56,16,32,128,
+56,18,52,125,230,86,147,190,140,28,50,21,13,39,31,23,60,145,158,57,12,141,
+47,129,6,155,194,188,24,49,39,199,89,188,124,92,242,70,120,224,201,33,69,
+15,155,163,201,68,14,49,39,199,197,211,116,240,242,113,197,232,18,180,254,
+36,3,17,46,18,243,35,100,128,172,156,178,70,163,154,76,34,248,146,164,108,
+248,75,204,141,146,28,217,115,137,27,95,27,241,173,236,162,160,224,200,2,
+206,9,113,13,148,192,209,18,22,164,146,37,193,57,162,4,249,39,196,128,24,2,
+178,66,213,136,68,201,16,77,209,131,31,192,242,88,96,92,191,151,34,100,136,
+38,232,255,252,92,221,199,197,12,68,209,82,66,212,11,155,185,41,197,13,55,
+38,3,66,213,47,135,254,72,12,162,99,133,116,112,0,1,72,66,14,16,16,50,37,
+202,160,150,154,66,14,20,8,57,192,28,24,80,113,50,113,100,105,166,120,248,
+0,0,179,1,65,196,201,199,20,178,36,227,224,0,2,208,54,113,240,0,1,100,11,
+181,192,0,5,178,1,18,160,65,24,131,20,145,25,188,48,132,122,28,76,146,218,
+121,35,180,69,145,132,108,224,0,0,0,0,0,0,120,31,153,188,56,132,122,28,76,
+146,218,121,35,180,69,145,132,108,224,0,0,0,0,0,0,120,31,168,160,45,110,23,
+30,176,33,184,0,0,183,32,29,235,2,27,199,23,0,0,23,4,51,120,129,8,244,56,
+153,37,180,242,71,104,139,35,8,217,192,0,0,0,0,0,0,240,63,51,120,145,8,244,
+56,153,37,180,242,71,104,139,35,8,217,192,0,0,0,0,0,0,0,64,51,120,161,8,
+244,56,153,37,180,242,71,104,139,35,8,217,192,0,0,0,0,0,0,0,64,51,120,177,
+8,244,56,153,37,180,242,71,104,139,35,8,217,192,0,0,0,0,0,0,16,64,51,120,
+193,8,244,56,153,37,180,242,71,104,139,35,8,217,192,0,0,0,0,0,0,16,64,51,
+120,209,8,244,56,153,37,180,242,71,104,139,35,8,217,192,0,0,0,0,0,0,16,64,
+51,120,225,8,244,56,153,37,180,242,71,104,139,35,8,217,192,0,0,0,0,0,0,32,
+64,32,227,194,0,97,57,162,4,246,104,5,34,92,35,68,225,161,166,220,16,16,
+137,112,52,41,73,29,185,1,65,196,201,197,145,166,153,246,72,3,137,204,120,
+34,74,8,199,1,67,17,162,112,201,84,128,97,144,78,25,42,16,131,169,1,205,66,
+8,35,68,225,161,166,239,128,0,10,192,64,196,104,156,50,96,0,2,172,73,240,
+117,96,57,170,97,4,104,156,52,52,221,240,0,1,82,1,74,9,129,125,240,0,1,82,
+32,148,25,174,137,58,23,51,190,0,0,42,69,64,195,32,156,50,96,0,2,160,81,
+238,2,3,107,173,218,3,192,
 };
 #elif defined(DUK_USE_DOUBLE_BE)
-DUK_INTERNAL const duk_uint8_t duk_builtins_data[4251] = {
-144,148,105,225,32,68,52,228,126,12,104,201,37,132,52,167,194,138,105,244,
-124,57,28,211,57,18,64,52,238,254,44,138,111,171,241,164,19,87,137,30,33,
-167,18,145,159,8,211,137,9,225,42,5,240,145,139,163,163,8,211,137,10,228,
-64,211,19,132,140,93,29,56,70,156,72,119,34,66,146,36,104,137,194,70,46,
-142,172,35,78,36,47,146,195,102,11,240,145,139,163,175,8,211,137,9,228,240,
-242,112,145,139,163,179,8,211,137,8,237,34,130,118,49,116,118,225,26,48,0,
-1,94,29,201,158,46,183,39,135,147,132,140,93,16,132,76,66,33,8,66,16,132,
-33,8,66,26,180,41,97,167,64,150,34,33,154,112,0,1,87,247,35,79,103,237,198,
-174,216,47,31,23,95,17,13,31,217,96,211,49,50,53,212,77,141,24,0,0,179,10,
-228,240,242,15,128,140,65,128,134,188,0,0,89,167,97,181,224,0,2,205,62,53,
-224,0,2,205,66,237,120,0,0,179,81,204,107,192,0,5,154,150,67,94,0,0,44,212,
-245,90,240,0,1,102,169,162,215,128,0,11,53,93,150,188,0,0,89,171,111,53,
-108,150,163,70,0,0,42,2,249,50,94,124,35,68,225,146,49,13,24,0,0,165,161,
-124,153,47,62,12,130,112,201,24,132,56,97,115,16,31,254,0,0,0,0,0,0,51,48,
-31,252,0,0,0,0,0,0,50,241,32,26,193,55,132,112,161,156,72,135,26,41,200,
-140,114,163,156,201,7,56,79,9,80,47,132,140,93,19,160,43,145,3,76,78,18,49,
-116,78,144,238,68,133,36,72,209,19,132,140,93,19,168,47,146,195,102,11,240,
-145,139,162,117,132,242,120,121,56,72,197,209,59,2,59,72,160,157,140,93,19,
-181,36,242,50,143,36,31,131,162,166,7,144,238,133,227,226,235,224,242,161,
-249,18,21,100,20,207,44,199,151,180,122,89,135,152,154,121,153,199,156,158,
-121,218,7,158,162,121,250,71,160,166,122,26,135,162,170,122,58,199,164,16,
-240,70,68,226,27,51,199,138,120,35,34,112,171,112,38,121,1,124,153,47,62,
-17,162,112,201,19,211,11,228,201,121,240,100,19,134,72,158,160,91,201,18,
-186,44,3,68,79,122,168,151,115,165,40,21,18,227,65,198,231,200,8,68,184,84,
-53,19,38,120,128,145,144,78,25,59,72,163,48,64,144,200,39,12,157,164,80,46,
-185,143,115,72,217,230,72,9,35,68,225,147,180,138,51,68,9,17,162,112,201,
-218,69,2,235,152,247,52,141,158,108,128,98,72,64,121,51,132,4,81,164,144,
-128,242,104,136,0,16,92,38,14,49,39,199,197,211,116,240,242,113,197,231,18,
-53,189,116,65,131,18,124,117,155,199,197,207,36,103,142,12,146,20,80,249,
-186,60,116,4,204,73,241,214,111,31,23,60,145,158,56,208,48,146,229,146,3,2,
-82,65,155,195,94,3,10,36,4,201,196,64,56,100,42,26,78,62,46,121,35,60,113,
-152,16,25,10,134,147,143,139,158,72,205,4,151,21,0,73,16,11,230,144,12,88,
-144,153,39,52,144,69,241,37,72,217,240,151,153,27,36,57,178,230,16,16,137,
-114,68,2,200,62,81,1,8,151,11,23,100,141,229,18,6,34,92,37,230,70,201,1,89,
-57,36,2,40,152,151,44,129,83,18,124,117,155,199,197,207,36,103,142,75,12,
-11,151,46,89,40,18,37,200,64,12,154,236,252,238,185,23,95,213,1,132,234,0,
-194,245,128,14,56,37,199,89,188,124,92,242,70,120,232,16,26,137,113,241,
-116,221,60,60,156,113,122,36,10,62,46,121,35,60,113,18,225,27,70,18,32,10,
-201,211,32,67,107,104,100,42,26,78,24,147,153,35,181,181,207,64,67,107,104,
-100,42,26,78,72,147,153,35,181,181,207,68,16,218,218,91,156,170,63,134,36,
-230,72,237,109,116,136,16,218,218,91,156,170,63,146,36,230,72,237,109,116,
-137,16,96,128,228,2,6,191,46,3,71,147,68,4,16,22,188,169,240,16,40,104,242,
-135,198,171,44,68,65,5,217,231,215,6,231,62,188,8,49,1,3,162,92,4,98,12,41,
-7,33,148,53,242,128,97,32,130,3,9,205,16,38,199,198,14,9,0,111,115,225,0,8,
-250,72,240,207,128,241,37,73,25,18,40,0,178,58,11,56,192,2,201,104,17,35,
-160,9,39,70,114,8,6,147,214,129,18,74,240,30,141,145,208,89,203,62,3,161,
-163,37,248,226,185,244,11,88,37,62,33,163,37,248,226,185,252,0,127,255,130,
-146,164,142,32,26,1,36,230,18,1,164,7,43,163,194,0,71,128,105,64,216,7,192,
-52,192,197,66,230,72,192,52,224,209,32,232,34,68,62,129,113,32,232,34,114,
-40,49,231,16,254,0,63,255,208,99,2,140,44,92,206,8,224,143,4,225,147,210,
-124,13,44,92,206,9,195,39,30,228,54,126,163,225,200,169,198,133,42,166,191,
-246,3,11,251,0,24,71,4,120,9,251,8,10,17,193,30,9,195,39,1,63,105,1,98,112,
-201,199,185,13,159,1,63,105,32,48,156,209,2,126,227,224,58,26,50,95,142,47,
-192,208,22,176,74,124,67,70,75,241,197,248,26,64,213,184,64,89,56,39,49,
-224,137,62,36,2,176,19,17,254,68,3,196,143,88,4,79,162,0,210,32,34,35,253,
-72,5,146,208,34,125,144,5,147,214,137,253,208,9,149,3,41,197,13,55,233,0,
-185,187,139,117,137,30,8,18,39,172,1,25,187,139,112,128,178,113,110,177,35,
-193,2,68,245,128,23,55,114,143,121,35,193,2,68,245,130,8,205,220,91,132,5,
-147,148,123,201,30,8,18,39,172,16,18,113,67,63,128,3,68,143,32,39,243,32,
-42,83,4,103,46,89,19,63,224,208,16,70,142,92,178,38,127,193,164,8,67,68,
-186,12,146,247,154,1,165,64,202,113,252,160,131,32,7,35,167,26,50,235,231,
-130,48,179,192,65,148,69,19,214,2,251,85,2,232,72,15,253,255,255,255,255,
-255,255,226,122,196,55,106,160,93,9,0,0,0,0,0,0,0,0,7,49,1,255,224,0,0,0,0,
-0,0,143,94,233,34,104,169,54,144,210,161,168,158,32,63,248,0,0,0,0,0,0,17,
-235,72,96,77,21,38,210,26,84,53,19,196,15,255,0,0,0,0,0,0,0,253,35,228,133,
-185,176,15,44,0,0,0,0,0,0,8,117,128,190,212,128,82,109,33,179,33,137,24,8,
-103,255,255,255,255,255,255,228,58,196,55,106,64,41,54,144,217,144,196,140,
-12,51,255,255,255,255,255,255,241,15,4,100,78,33,179,60,120,167,130,50,39,
-10,183,2,103,144,113,8,151,10,134,162,100,221,16,18,137,113,13,153,12,72,
-238,137,1,81,46,52,28,110,232,148,53,18,228,128,82,113,13,153,12,72,238,
-137,142,73,78,52,0,0,0,0,0,0,0,0,8,58,254,1,12,38,248,134,23,130,0,60,221,
-194,162,228,30,244,128,217,187,132,187,220,210,54,104,2,247,132,5,205,220,
-124,72,36,73,14,110,252,132,25,128,193,94,8,200,149,200,3,237,38,43,31,192,
-54,186,213,128,57,45,56,210,31,254,0,0,0,0,0,0,49,90,251,224,6,77,220,24,
-38,78,74,113,67,77,124,16,50,110,228,208,194,114,83,138,26,107,224,172,37,
-240,97,41,187,139,112,128,178,112,96,153,57,41,197,13,53,240,113,41,187,
-139,112,128,178,114,104,97,57,41,197,13,53,240,128,195,95,8,44,61,240,132,
-216,93,33,133,192,128,14,98,79,147,67,9,129,0,44,196,159,11,69,175,152,32,
-35,100,33,135,24,147,237,38,34,246,139,95,48,64,70,200,68,8,49,39,198,57,
-179,61,144,138,22,98,79,180,152,153,215,54,103,178,17,129,204,73,240,96,
-153,44,132,112,163,18,125,164,196,62,130,100,178,18,1,140,73,240,96,197,
-144,146,18,98,79,180,152,135,208,98,200,74,8,49,39,195,186,145,149,144,150,
-22,98,79,180,152,143,215,82,50,178,19,2,140,73,241,136,109,38,73,89,9,161,
-166,36,251,73,137,157,67,105,50,74,200,78,10,49,39,201,16,78,104,229,100,
-39,134,152,147,237,38,41,116,130,115,71,43,33,64,60,196,159,24,133,173,18,
-32,156,209,202,200,81,18,49,39,218,76,76,234,22,180,72,130,115,71,43,33,72,
-68,196,159,38,134,19,46,105,56,226,150,68,157,160,1,228,73,242,104,97,46,
-16,31,34,79,140,66,214,137,16,78,104,229,108,169,137,72,147,237,38,38,117,
-11,90,36,65,57,163,149,178,168,21,34,79,146,32,156,209,202,218,250,161,178,
-36,251,73,138,93,32,156,209,202,218,250,193,82,36,248,196,54,147,36,173,
-191,174,27,34,79,180,152,153,212,54,147,36,173,191,176,17,34,79,135,117,35,
-43,115,236,133,200,147,237,38,35,245,212,140,173,207,180,15,34,79,131,4,
-201,108,173,133,72,147,237,38,33,244,19,37,178,184,17,34,79,140,115,102,
-123,107,238,133,200,147,237,38,38,117,205,153,237,175,188,23,34,79,133,162,
-215,204,16,17,182,254,248,116,137,62,210,98,47,104,181,243,4,4,109,191,192,
-131,152,147,230,8,8,217,12,16,60,137,62,96,128,141,178,193,181,55,136,200,
-51,128,114,108,28,100,128,0,0,0,0,0,0,0,12,110,127,32,98,115,249,73,117,
-243,249,67,21,159,202,38,47,63,148,86,8,75,144,94,50,1,38,73,79,204,67,95,
-231,1,6,128,14,79,129,185,40,249,18,149,181,207,142,199,155,172,248,172,89,
-183,207,140,198,137,175,200,0,159,72,10,5,21,220,138,120,74,129,124,36,98,
-232,228,74,81,62,160,20,10,107,185,21,114,32,105,137,194,70,46,142,68,165,
-19,235,1,64,170,187,145,119,34,66,146,36,104,137,194,70,46,142,68,165,19,
-236,1,64,174,187,145,95,37,134,204,23,225,35,23,71,34,82,137,246,128,160,
-89,93,200,167,147,195,201,194,70,46,142,68,165,19,238,1,64,182,187,145,71,
-105,20,19,177,139,163,145,41,68,16,7,6,15,82,70,72,115,96,32,105,246,0,0,0,
-0,0,91,60,165,195,201,194,8,134,149,216,130,0,192,41,224,136,2,48,176,228,
-1,149,13,195,15,0,200,209,97,71,128,99,32,176,131,192,113,57,143,0,167,131,
-32,230,80,28,202,139,175,237,2,48,189,160,20,1,119,48,87,193,186,129,89,56,
-72,197,209,200,193,185,35,23,71,109,13,219,36,98,232,237,156,13,26,208,211,
-14,102,19,87,137,91,95,128,0,10,64,24,92,0,0,82,2,53,63,240,49,204,202,10,
-14,38,78,44,141,52,207,31,0,0,22,32,129,100,180,8,148,145,78,102,152,80,
-113,50,113,100,105,166,120,248,0,0,177,1,65,196,201,199,20,178,36,227,224,
-0,2,200,3,6,133,41,35,31,0,0,22,1,44,57,137,62,33,179,216,162,152,192,131,
-18,124,162,27,61,138,41,108,32,196,159,16,217,232,235,81,76,104,73,137,62,
-81,13,158,142,181,20,184,16,98,79,136,108,244,244,168,166,56,36,196,159,40,
-134,207,79,74,138,93,10,49,39,194,173,192,158,158,149,20,188,20,98,79,133,
-91,129,61,109,74,41,124,30,68,159,16,217,236,83,108,96,68,137,62,81,13,158,
-197,54,182,17,34,79,136,108,244,117,169,182,52,38,68,159,40,134,207,71,90,
-155,92,8,145,39,196,54,122,122,84,219,28,19,34,79,148,67,103,167,165,77,
-174,133,72,147,225,86,224,79,79,74,155,94,10,145,39,194,173,192,158,182,
-165,54,190,206,25,212,35,208,226,100,150,211,201,29,162,44,140,35,103,0,
-255,192,0,0,0,0,0,0,206,25,228,35,208,226,100,150,211,201,29,162,44,140,35,
-103,0,255,192,0,0,0,0,0,0,206,25,244,35,208,226,100,150,211,201,29,162,44,
-140,35,103,0,255,192,0,0,0,0,0,0,206,26,4,35,208,226,100,150,211,201,29,
-162,44,140,35,103,1,0,0,0,0,0,0,0,0,206,26,20,35,208,226,100,150,211,201,
-29,162,44,140,35,103,1,0,0,0,0,0,0,0,0,206,26,36,35,208,226,100,150,211,
-201,29,162,44,140,35,103,1,0,64,0,0,0,0,0,0,206,26,52,35,208,226,100,150,
-211,201,29,162,44,140,35,103,1,0,64,0,0,0,0,0,0,206,26,68,35,208,226,100,
-150,211,201,29,162,44,140,35,103,1,0,64,0,0,0,0,0,0,206,26,84,35,208,226,
-100,150,211,201,29,162,44,140,35,103,1,0,128,0,0,0,0,0,0,195,154,99,16,38,
-36,0,251,68,117,179,216,162,128,68,72,1,241,13,158,197,20,150,25,18,0,125,
-162,58,217,232,235,117,100,162,136,25,18,0,125,162,58,217,232,235,116,36,
-162,145,2,226,64,15,136,108,244,117,186,178,81,73,129,113,32,7,196,54,122,
-58,221,9,40,165,64,200,144,3,237,17,214,207,79,75,171,37,20,80,200,144,3,
-237,17,214,207,79,75,161,37,20,138,23,18,0,124,67,103,167,165,213,146,138,
-77,11,137,0,62,33,179,211,210,232,73,69,42,133,196,128,31,10,183,2,125,89,
-40,163,5,196,128,31,10,183,2,125,9,40,164,96,200,144,3,224,221,64,172,157,
-89,40,163,134,68,128,31,6,234,5,100,232,73,69,35,133,68,128,31,104,142,182,
-125,89,40,180,0,168,144,3,237,17,214,207,161,37,22,144,19,18,0,124,67,103,
-213,146,139,80,9,137,0,62,33,179,232,73,69,172,5,90,40,153,59,68,117,179,
-216,166,192,77,162,137,147,136,108,246,41,180,176,219,69,19,39,104,142,182,
-122,58,221,89,41,178,6,218,40,153,59,68,117,179,209,214,232,73,77,162,6,90,
-40,153,56,134,207,71,91,171,37,54,152,25,104,162,100,226,27,61,29,110,132,
-148,218,160,109,162,137,147,180,71,91,61,61,46,172,148,217,67,109,20,76,
-157,162,58,217,233,233,116,36,166,209,67,45,20,76,156,67,103,167,165,213,
-146,155,77,12,180,81,50,113,13,158,158,151,66,74,109,84,50,209,68,201,194,
-173,192,159,86,74,108,193,150,138,38,78,21,110,4,250,18,83,104,193,182,138,
-38,78,13,212,10,201,213,146,155,56,109,162,137,147,131,117,2,178,116,36,
-166,209,194,237,20,76,157,162,58,217,245,100,167,16,2,237,20,76,157,162,58,
-217,244,36,167,18,2,173,20,76,156,67,103,213,146,156,80,10,180,81,50,113,
-13,159,66,74,113,97,175,220,48,216,109,192,4,42,22,189,163,0,196,133,0,185,
-80,32,28,78,99,193,18,80,36,4,19,159,141,156,0,178,90,4,74,73,0,22,209,68,
-201,185,129,4,2,8,3,132,64,60,36,4,0,91,240,168,177,69,118,144,157,91,116,
-116,32,32,1,53,216,221,218,170,139,3,234,219,165,0,255,152,185,11,251,232,
-231,188,47,86,227,105,18,1,255,184,170,59,41,92,23,240,110,173,198,209,208,
-36,3,253,188,183,177,82,110,80,224,93,122,32,32,4,144,253,170,34,22,140,7,
-236,161,25,232,237,105,64,63,230,160,158,102,127,59,205,11,217,66,51,210,
-128,127,237,65,60,204,254,119,155,171,197,34,168,48,6,90,162,1,0,39,75,84,
-72,8,9,33,186,162,80,64,76,13,213,19,2,130,96,110,150,181,0,65,6,51,213,20,
-128,65,17,11,213,19,130,137,121,211,210,210,144,6,39,75,84,80,0,201,119,
-234,138,8,41,86,231,71,84,80,129,79,135,186,122,101,224,34,25,69,233,208,3,
-91,141,170,40,96,139,113,180,181,69,36,21,110,54,142,134,168,165,1,176,23,
-212,47,0,216,134,234,87,128,111,117,181,168,128,209,3,70,230,106,192,5,139,
-168,209,234,138,32,36,144,102,235,8,3,146,27,170,40,160,146,132,103,170,40,
-192,115,3,117,69,28,22,113,163,69,170,41,103,1,66,188,17,145,52,104,4,202,
-113,67,76,130,227,72,194,13,240,108,0,0,83,96,0,2,185,0,104,146,84,97,48,0,
-1,90,192,56,169,24,145,179,192,0,5,96,8,56,16,32,128,56,18,52,125,198,86,
-147,186,140,28,50,21,13,39,31,23,60,145,158,56,204,141,47,121,6,155,190,
-188,24,49,39,199,89,188,124,92,242,70,120,224,201,33,69,15,155,163,199,68,
-14,49,39,199,197,211,116,240,242,113,197,231,18,180,254,4,3,17,46,18,243,
-35,100,128,172,156,146,70,163,150,76,34,248,146,164,108,248,75,204,141,146,
-28,217,115,9,27,79,11,241,173,235,162,160,224,200,2,206,9,113,13,148,192,
-209,18,22,164,146,37,193,57,162,4,249,39,196,128,24,2,178,66,213,136,68,
-201,16,77,209,131,31,192,242,88,96,92,191,151,34,100,136,38,232,255,252,92,
-221,199,197,12,68,209,82,66,212,11,155,185,41,197,13,55,38,3,66,213,47,131,
-250,72,12,162,99,133,116,127,196,32,225,1,3,34,92,170,9,105,164,32,225,64,
-131,156,1,193,133,7,19,39,22,70,154,103,143,128,0,11,16,20,28,76,156,113,
-75,34,78,62,0,0,44,128,48,104,82,146,49,240,0,1,96,11,180,192,0,5,162,1,18,
-160,65,24,131,20,145,25,188,48,132,122,28,76,146,218,121,35,180,69,145,132,
-108,224,31,248,0,0,0,0,0,0,25,188,56,132,122,28,76,146,218,121,35,180,69,
-145,132,108,224,31,248,0,0,0,0,0,0,40,160,45,110,23,30,176,33,184,0,0,181,
-32,29,235,2,27,199,23,0,0,22,196,51,120,129,8,244,56,153,37,180,242,71,104,
-139,35,8,217,192,63,240,0,0,0,0,0,0,51,120,145,8,244,56,153,37,180,242,71,
-104,139,35,8,217,192,64,0,0,0,0,0,0,0,51,120,161,8,244,56,153,37,180,242,
-71,104,139,35,8,217,192,64,0,0,0,0,0,0,0,51,120,177,8,244,56,153,37,180,
-242,71,104,139,35,8,217,192,64,16,0,0,0,0,0,0,51,120,193,8,244,56,153,37,
-180,242,71,104,139,35,8,217,192,64,16,0,0,0,0,0,0,51,120,209,8,244,56,153,
-37,180,242,71,104,139,35,8,217,192,64,16,0,0,0,0,0,0,51,120,225,8,244,56,
-153,37,180,242,71,104,139,35,8,217,192,64,32,0,0,0,0,0,0,32,227,194,0,97,
-57,162,4,246,40,5,34,92,35,68,225,161,166,219,16,16,137,112,52,41,73,29,
-169,1,65,196,201,197,145,166,153,246,8,3,137,204,120,34,74,8,200,58,128,28,
-211,160,130,52,78,26,26,110,248,0,0,170,4,12,70,137,195,38,0,0,42,68,159,7,
-84,3,154,150,16,70,137,195,67,77,223,0,0,20,224,20,160,152,23,223,0,0,20,
-226,9,65,154,232,147,161,115,59,224,0,2,156,84,12,50,9,195,38,0,0,41,133,
-30,224,32,54,186,221,128,60,
+DUK_INTERNAL const duk_uint8_t duk_builtins_data[4281] = {
+144,148,105,226,32,68,52,228,254,12,104,202,37,132,52,167,194,138,105,245,
+124,57,28,211,57,18,64,52,239,126,44,138,111,175,241,164,19,87,145,30,33,
+167,22,145,159,8,211,139,9,225,42,5,240,145,139,163,163,8,211,139,10,228,
+64,211,19,132,140,93,29,56,70,156,88,119,34,66,146,36,104,137,194,70,46,
+142,172,35,78,44,47,146,195,102,11,240,145,139,163,175,8,211,139,9,228,240,
+242,112,145,139,163,179,8,211,139,8,237,34,130,118,49,116,118,225,26,48,0,
+1,98,29,201,158,46,183,39,135,147,132,140,93,16,132,76,66,33,8,66,16,132,
+33,8,66,26,180,105,97,167,68,150,34,33,154,112,0,1,91,247,35,79,111,237,
+198,174,232,47,31,23,95,17,13,31,249,96,211,49,50,53,214,77,141,24,0,0,181,
+10,228,240,242,15,128,140,65,128,134,188,0,0,90,167,97,181,224,0,2,213,62,
+53,224,0,2,213,66,237,120,0,0,181,81,204,107,192,0,5,170,150,67,94,0,0,45,
+84,245,90,240,0,1,106,169,162,215,128,0,11,85,93,150,188,0,0,90,171,111,53,
+109,22,162,26,48,0,1,84,23,201,146,243,225,26,39,12,145,136,104,192,0,5,61,
+11,228,201,121,240,100,19,134,72,196,33,195,14,40,203,112,64,190,76,232,
+145,153,136,15,255,0,0,0,0,0,0,25,152,15,254,0,0,0,0,0,0,25,120,144,13,96,
+155,194,56,80,206,36,67,141,20,228,70,57,81,206,100,131,156,39,132,168,23,
+194,70,46,137,208,21,200,129,166,39,9,24,186,39,72,119,34,66,146,36,104,
+137,194,70,46,137,212,23,201,97,179,5,248,72,197,209,58,194,121,60,60,156,
+36,98,232,157,129,29,164,80,78,198,46,137,218,146,121,25,71,146,9,209,5,
+209,61,48,126,14,138,152,30,67,186,23,143,139,175,131,202,135,228,72,85,
+144,83,60,179,30,94,209,233,102,30,98,105,230,103,30,114,121,231,104,30,
+122,137,231,233,30,130,153,232,106,30,138,169,232,235,30,144,67,193,25,19,
+136,108,207,30,41,224,140,137,194,173,192,153,228,5,242,100,188,248,70,137,
+195,36,79,78,47,147,37,231,193,144,78,25,34,122,145,111,36,74,232,176,13,
+17,61,234,226,93,207,148,160,84,75,141,7,27,161,32,33,18,225,80,212,76,154,
+2,2,70,65,56,100,237,34,140,209,2,67,32,156,50,118,145,64,186,230,61,205,
+35,103,155,32,36,141,19,134,78,210,40,206,16,36,70,137,195,39,105,20,11,
+174,99,220,210,54,121,210,1,137,33,1,228,207,16,17,70,146,66,3,201,164,32,
+0,65,112,152,56,196,159,31,23,77,211,195,201,199,23,160,72,214,246,81,6,12,
+73,241,214,111,31,23,60,145,158,56,50,72,81,67,230,232,242,80,19,49,39,199,
+89,188,124,92,242,70,120,227,64,194,75,154,72,12,9,73,6,111,21,120,12,40,
+144,19,39,25,0,225,144,168,105,56,248,185,228,140,241,200,96,64,100,42,26,
+78,62,46,121,35,52,18,92,116,1,36,64,47,158,64,49,98,66,100,156,242,65,23,
+196,149,35,103,194,94,100,108,144,230,203,156,64,66,37,201,16,11,32,249,
+132,4,34,92,44,93,146,55,152,72,24,137,112,151,153,27,36,5,100,229,144,8,
+162,98,92,210,5,76,73,241,214,111,31,23,60,145,158,57,44,48,46,92,185,164,
+160,72,151,41,0,50,107,179,244,59,36,93,127,92,6,19,172,3,11,216,0,56,224,
+151,29,102,241,241,115,201,25,227,164,64,106,37,199,197,211,116,240,242,
+113,197,233,144,40,248,185,228,140,241,196,75,132,109,24,72,128,43,39,84,
+129,13,173,161,144,168,105,56,98,78,100,142,214,215,69,1,13,173,161,144,
+168,105,57,34,78,100,142,214,215,69,16,67,107,105,110,114,168,254,24,147,
+153,35,181,181,212,32,67,107,105,110,114,168,254,72,147,153,35,181,181,212,
+36,65,130,3,144,8,26,252,200,13,30,85,16,16,64,90,242,231,192,64,161,163,
+203,31,26,172,193,17,4,23,105,159,96,27,172,251,16,32,196,4,14,137,112,17,
+136,48,164,28,134,80,215,202,1,132,130,8,12,39,52,64,155,31,24,56,36,1,189,
+207,132,0,35,233,35,195,62,3,196,149,36,100,72,160,2,200,232,44,227,0,11,
+37,160,68,142,128,36,157,25,200,32,26,79,90,4,73,43,192,122,54,71,65,103,
+44,248,14,134,140,151,227,138,231,208,45,96,148,248,134,140,151,227,138,
+231,240,1,255,254,10,74,146,56,128,104,4,147,152,72,6,144,28,174,143,8,1,
+30,1,165,3,96,31,0,211,3,21,11,153,35,0,211,131,68,131,160,137,16,250,5,
+196,131,160,137,200,160,199,156,67,248,0,255,255,65,140,10,48,177,115,56,
+35,130,60,19,134,79,89,240,52,177,115,56,39,12,156,123,144,217,251,15,135,
+34,167,30,20,170,154,255,232,12,47,244,0,97,28,17,224,39,238,32,40,71,4,
+120,39,12,156,4,253,228,5,137,195,39,30,228,54,124,4,253,228,128,194,115,
+68,9,252,15,128,232,104,201,126,56,191,35,64,90,193,41,241,13,25,47,199,23,
+228,105,3,86,225,1,100,224,156,199,130,36,249,144,10,192,76,71,250,16,15,
+18,61,96,17,62,200,3,72,128,136,143,247,32,22,75,64,137,248,64,22,79,90,39,
+249,64,38,84,12,167,20,52,223,196,2,230,238,45,214,36,120,32,72,158,208,4,
+102,238,45,194,2,201,197,186,196,143,4,9,19,218,0,92,221,202,61,228,143,4,
+9,19,218,8,35,55,113,110,16,22,78,81,239,36,120,32,72,158,208,64,73,197,12,
+255,0,13,18,60,128,159,212,128,169,76,17,156,185,100,76,255,163,64,65,26,
+57,114,200,153,255,70,144,33,13,18,232,50,75,226,104,6,149,3,41,199,246,
+130,12,128,28,142,156,120,203,175,158,8,194,207,1,6,81,20,79,88,11,237,84,
+11,161,32,63,247,255,255,255,255,255,255,137,235,16,221,170,129,116,36,0,0,
+0,0,0,0,0,0,28,196,7,255,128,0,0,0,0,0,2,61,123,164,137,162,164,218,67,74,
+134,162,120,128,255,224,0,0,0,0,0,0,71,173,33,129,52,84,155,72,105,80,212,
+79,16,63,252,0,0,0,0,0,0,3,244,143,146,22,230,192,60,176,0,0,0,0,0,0,33,
+214,2,251,82,1,73,180,134,204,134,36,96,33,159,255,255,255,255,255,255,144,
+235,16,221,169,0,164,218,67,102,67,18,48,48,207,255,255,255,255,255,255,
+196,60,17,145,56,134,204,241,226,158,8,200,156,42,220,9,158,65,196,34,92,
+42,26,137,147,120,64,74,37,196,54,100,49,35,188,36,5,68,184,208,113,187,
+194,80,212,75,146,1,73,196,54,100,49,35,188,38,57,37,56,240,0,0,0,0,0,0,0,
+0,32,235,248,68,48,156,2,24,94,24,0,243,119,10,139,144,123,242,3,102,238,
+18,239,115,72,217,160,11,223,16,23,55,113,241,32,145,36,57,188,18,16,102,3,
+5,120,35,34,89,32,15,180,152,173,127,0,218,235,88,0,228,180,227,200,127,
+248,0,0,0,0,0,0,197,107,240,64,6,77,220,24,38,78,74,113,67,77,130,4,12,155,
+185,52,48,156,148,226,134,155,4,10,194,96,129,132,166,238,45,194,2,201,193,
+130,100,228,167,20,52,216,32,113,41,187,139,112,128,178,114,104,97,57,41,
+197,13,54,8,32,48,216,32,130,195,224,130,19,97,124,134,23,6,0,57,137,62,77,
+12,38,12,0,179,18,124,45,22,190,96,128,141,176,134,28,98,79,180,152,139,
+218,45,124,193,1,27,97,16,32,196,159,24,230,204,246,194,40,89,137,62,210,
+98,103,92,217,158,216,70,7,49,39,193,130,100,182,17,194,140,73,246,147,16,
+250,9,146,216,72,6,49,39,193,131,22,194,72,73,137,62,210,98,31,65,139,97,
+40,32,196,159,14,234,70,86,194,88,89,137,62,210,98,63,93,72,202,216,76,10,
+49,39,198,33,180,153,37,108,38,134,152,147,237,38,38,117,13,164,201,43,97,
+56,40,196,159,36,65,57,163,149,176,158,26,98,79,180,152,165,210,9,205,28,
+173,133,0,243,18,124,98,22,180,72,130,115,71,43,97,68,72,196,159,105,49,51,
+168,90,209,34,9,205,28,173,133,33,19,18,124,154,24,76,185,164,227,138,89,
+18,119,0,7,145,39,201,161,132,188,64,124,137,62,49,11,90,36,65,57,163,149,
+210,166,37,34,79,180,152,153,212,45,104,145,4,230,142,87,74,160,84,137,62,
+72,130,115,71,43,171,234,134,200,147,237,38,41,116,130,115,71,43,171,235,5,
+72,147,227,16,218,76,146,186,254,184,108,137,62,210,98,103,80,218,76,146,
+186,254,192,68,137,62,29,212,140,174,207,178,23,34,79,180,152,143,215,82,
+50,187,62,208,60,137,62,12,19,37,210,182,21,34,79,180,152,135,208,76,151,
+74,224,68,137,62,49,205,153,238,175,186,23,34,79,180,152,153,215,54,103,
+186,190,240,92,137,62,22,139,95,48,64,70,235,251,225,210,36,251,73,136,189,
+162,215,204,16,17,186,255,2,14,98,79,152,32,35,108,48,64,242,36,249,130,2,
+55,75,6,212,224,72,200,51,128,114,108,28,100,128,0,0,0,0,0,0,0,12,110,127,
+48,98,115,249,201,117,243,249,195,21,159,206,38,47,63,156,86,8,75,144,94,
+82,1,38,73,79,208,67,95,233,1,6,128,14,79,129,186,40,249,18,149,182,207,
+144,200,155,188,248,204,105,184,207,142,199,137,175,201,0,159,72,10,5,21,
+221,10,120,74,129,124,36,98,232,228,74,81,62,160,20,10,107,186,21,114,32,
+105,137,194,70,46,142,68,165,19,235,1,64,170,187,161,119,34,66,146,36,104,
+137,194,70,46,142,68,165,19,236,1,64,174,187,161,95,37,134,204,23,225,35,
+23,71,34,82,137,246,128,160,89,93,208,167,147,195,201,194,70,46,142,68,165,
+19,238,1,64,182,187,161,71,105,20,19,177,139,163,145,41,68,16,7,6,15,82,70,
+72,115,96,32,106,15,0,0,0,0,0,91,60,165,195,201,194,8,134,149,216,162,0,
+192,41,225,8,2,48,177,36,1,149,13,196,15,0,200,209,97,199,128,99,32,176,
+195,192,113,57,143,0,167,133,32,230,80,28,202,139,175,238,2,48,189,192,20,
+1,119,80,87,193,186,129,89,56,72,197,209,200,193,185,35,23,71,109,13,219,
+36,98,232,237,156,13,26,208,211,14,102,19,87,137,91,95,128,0,10,96,24,92,0,
+0,83,2,53,56,0,0,165,3,28,204,160,160,226,100,226,200,211,76,241,240,0,1,
+102,8,22,75,64,137,73,20,230,105,133,7,19,39,22,70,154,103,143,128,0,11,48,
+20,28,76,156,113,75,34,78,62,0,0,45,3,103,31,0,0,22,65,44,57,137,62,33,179,
+216,162,152,192,131,18,124,162,27,61,138,41,108,32,196,159,16,217,232,235,
+81,76,104,73,137,62,81,13,158,142,181,20,184,16,98,79,136,108,244,244,168,
+166,56,36,196,159,40,134,207,79,74,138,93,10,49,39,194,173,192,158,158,149,
+20,188,20,98,79,133,91,129,61,109,74,41,124,30,68,159,16,217,236,83,108,96,
+68,137,62,81,13,158,197,54,182,17,34,79,136,108,244,117,169,182,52,38,68,
+159,40,134,207,71,90,155,92,8,145,39,196,54,122,122,84,219,28,19,34,79,148,
+67,103,167,165,77,174,133,72,147,225,86,224,79,79,74,155,94,10,145,39,194,
+173,192,158,182,165,54,190,206,25,212,35,208,226,100,150,211,201,29,162,44,
+140,35,103,0,255,192,0,0,0,0,0,0,206,25,228,35,208,226,100,150,211,201,29,
+162,44,140,35,103,0,255,192,0,0,0,0,0,0,206,25,244,35,208,226,100,150,211,
+201,29,162,44,140,35,103,0,255,192,0,0,0,0,0,0,206,26,4,35,208,226,100,150,
+211,201,29,162,44,140,35,103,1,0,0,0,0,0,0,0,0,206,26,20,35,208,226,100,
+150,211,201,29,162,44,140,35,103,1,0,0,0,0,0,0,0,0,206,26,36,35,208,226,
+100,150,211,201,29,162,44,140,35,103,1,0,64,0,0,0,0,0,0,206,26,52,35,208,
+226,100,150,211,201,29,162,44,140,35,103,1,0,64,0,0,0,0,0,0,206,26,68,35,
+208,226,100,150,211,201,29,162,44,140,35,103,1,0,64,0,0,0,0,0,0,206,26,84,
+35,208,226,100,150,211,201,29,162,44,140,35,103,1,0,128,0,0,0,0,0,0,195,
+154,99,16,38,36,0,251,68,117,179,216,162,128,68,72,1,241,13,158,197,20,150,
+25,18,0,125,162,58,217,232,235,117,100,162,136,25,18,0,125,162,58,217,232,
+235,116,36,162,145,2,226,64,15,136,108,244,117,186,178,81,73,129,113,32,7,
+196,54,122,58,221,9,40,165,64,200,144,3,237,17,214,207,79,75,171,37,20,80,
+200,144,3,237,17,214,207,79,75,161,37,20,138,23,18,0,124,67,103,167,165,
+213,146,138,77,11,137,0,62,33,179,211,210,232,73,69,42,133,196,128,31,10,
+183,2,125,89,40,163,5,196,128,31,10,183,2,125,9,40,164,96,200,144,3,224,
+221,64,172,157,89,40,163,134,68,128,31,6,234,5,100,232,73,69,35,133,68,128,
+31,104,142,182,125,89,40,180,0,168,144,3,237,17,214,207,161,37,22,144,19,
+18,0,124,67,103,213,146,139,80,9,137,0,62,33,179,232,73,69,172,5,90,40,153,
+59,68,117,179,216,166,192,77,162,137,147,136,108,246,41,180,176,219,69,19,
+39,104,142,182,122,58,221,89,41,178,6,218,40,153,59,68,117,179,209,214,232,
+73,77,162,6,90,40,153,56,134,207,71,91,171,37,54,152,25,104,162,100,226,27,
+61,29,110,132,148,218,160,109,162,137,147,180,71,91,61,61,46,172,148,217,
+67,109,20,76,157,162,58,217,233,233,116,36,166,209,67,45,20,76,156,67,103,
+167,165,213,146,155,77,12,180,81,50,113,13,158,158,151,66,74,109,84,50,209,
+68,201,194,173,192,159,86,74,108,193,150,138,38,78,21,110,4,250,18,83,104,
+193,182,138,38,78,13,212,10,201,213,146,155,56,109,162,137,147,131,117,2,
+178,116,36,166,209,194,237,20,76,157,162,58,217,245,100,167,16,2,237,20,76,
+157,162,58,217,244,36,167,18,2,173,20,76,156,67,103,213,146,156,80,10,180,
+81,50,113,13,159,66,74,113,97,175,221,48,216,110,64,4,42,22,189,179,0,196,
+133,0,185,80,32,28,78,99,193,18,80,36,4,19,159,141,172,0,178,90,4,74,73,0,
+22,209,68,201,187,129,4,2,8,3,132,64,60,36,4,0,91,240,168,177,69,118,144,
+157,91,116,116,32,32,1,53,216,221,218,170,139,3,234,219,165,0,255,152,185,
+11,251,232,231,188,47,86,227,105,18,1,255,184,170,59,41,92,23,240,110,173,
+198,209,208,36,3,253,188,183,177,82,110,80,224,93,122,32,32,4,144,253,170,
+34,22,140,7,236,161,25,232,237,105,64,63,230,160,158,102,127,59,205,11,217,
+66,51,210,128,127,237,65,60,204,254,119,155,171,197,34,168,48,6,90,194,1,0,
+39,75,88,72,8,9,33,186,194,80,64,76,13,214,19,2,130,96,110,150,189,0,65,6,
+51,214,20,128,65,17,11,214,19,130,137,121,211,210,211,144,6,39,75,88,80,0,
+201,119,235,10,8,41,86,231,71,88,80,129,79,135,186,122,133,224,34,25,69,
+234,80,3,91,141,172,40,96,139,113,180,181,133,36,21,110,54,142,134,176,165,
+1,176,23,213,47,0,216,134,234,215,128,111,117,181,232,128,209,3,70,230,107,
+64,5,139,168,209,235,10,32,36,144,102,235,136,3,146,27,172,40,160,146,132,
+103,172,40,192,115,3,117,133,28,22,113,163,69,172,41,103,1,66,188,17,145,
+52,168,4,202,113,67,76,130,227,76,194,13,240,108,0,0,83,224,0,2,193,0,104,
+146,84,97,48,0,1,94,192,56,169,24,145,179,192,0,5,112,8,56,16,32,128,56,18,
+52,125,230,86,147,190,140,28,50,21,13,39,31,23,60,145,158,57,12,141,47,129,
+6,155,194,188,24,49,39,199,89,188,124,92,242,70,120,224,201,33,69,15,155,
+163,201,68,14,49,39,199,197,211,116,240,242,113,197,232,18,180,254,36,3,17,
+46,18,243,35,100,128,172,156,178,70,163,154,76,34,248,146,164,108,248,75,
+204,141,146,28,217,115,137,27,95,27,241,173,236,162,160,224,200,2,206,9,
+113,13,148,192,209,18,22,164,146,37,193,57,162,4,249,39,196,128,24,2,178,
+66,213,136,68,201,16,77,209,131,31,192,242,88,96,92,191,151,34,100,136,38,
+232,255,252,92,221,199,197,12,68,209,82,66,212,11,155,185,41,197,13,55,38,
+3,66,213,47,135,254,72,12,162,99,133,116,112,0,1,72,66,14,16,16,50,37,202,
+160,150,154,66,14,20,8,57,192,28,24,80,113,50,113,100,105,166,120,248,0,0,
+179,1,65,196,201,199,20,178,36,227,224,0,2,208,54,113,240,0,1,100,11,181,
+192,0,5,178,1,18,160,65,24,131,20,145,25,188,48,132,122,28,76,146,218,121,
+35,180,69,145,132,108,224,31,248,0,0,0,0,0,0,25,188,56,132,122,28,76,146,
+218,121,35,180,69,145,132,108,224,31,248,0,0,0,0,0,0,40,160,45,110,23,30,
+176,33,184,0,0,183,32,29,235,2,27,199,23,0,0,23,4,51,120,129,8,244,56,153,
+37,180,242,71,104,139,35,8,217,192,63,240,0,0,0,0,0,0,51,120,145,8,244,56,
+153,37,180,242,71,104,139,35,8,217,192,64,0,0,0,0,0,0,0,51,120,161,8,244,
+56,153,37,180,242,71,104,139,35,8,217,192,64,0,0,0,0,0,0,0,51,120,177,8,
+244,56,153,37,180,242,71,104,139,35,8,217,192,64,16,0,0,0,0,0,0,51,120,193,
+8,244,56,153,37,180,242,71,104,139,35,8,217,192,64,16,0,0,0,0,0,0,51,120,
+209,8,244,56,153,37,180,242,71,104,139,35,8,217,192,64,16,0,0,0,0,0,0,51,
+120,225,8,244,56,153,37,180,242,71,104,139,35,8,217,192,64,32,0,0,0,0,0,0,
+32,227,194,0,97,57,162,4,246,104,5,34,92,35,68,225,161,166,220,16,16,137,
+112,52,41,73,29,185,1,65,196,201,197,145,166,153,246,72,3,137,204,120,34,
+74,8,199,1,67,17,162,112,201,84,128,97,144,78,25,42,16,131,169,1,205,66,8,
+35,68,225,161,166,239,128,0,10,192,64,196,104,156,50,96,0,2,172,73,240,117,
+96,57,170,97,4,104,156,52,52,221,240,0,1,82,1,74,9,129,125,240,0,1,82,32,
+148,25,174,137,58,23,51,190,0,0,42,69,64,195,32,156,50,96,0,2,160,81,238,2,
+3,107,173,218,3,192,
 };
 #elif defined(DUK_USE_DOUBLE_ME)
-DUK_INTERNAL const duk_uint8_t duk_builtins_data[4251] = {
-144,148,105,225,32,68,52,228,126,12,104,201,37,132,52,167,194,138,105,244,
-124,57,28,211,57,18,64,52,238,254,44,138,111,171,241,164,19,87,137,30,33,
-167,18,145,159,8,211,137,9,225,42,5,240,145,139,163,163,8,211,137,10,228,
-64,211,19,132,140,93,29,56,70,156,72,119,34,66,146,36,104,137,194,70,46,
-142,172,35,78,36,47,146,195,102,11,240,145,139,163,175,8,211,137,9,228,240,
-242,112,145,139,163,179,8,211,137,8,237,34,130,118,49,116,118,225,26,48,0,
-1,94,29,201,158,46,183,39,135,147,132,140,93,16,132,76,66,33,8,66,16,132,
-33,8,66,26,180,41,97,167,64,150,34,33,154,112,0,1,87,247,35,79,103,237,198,
-174,216,47,31,23,95,17,13,31,217,96,211,49,50,53,212,77,141,24,0,0,179,10,
-228,240,242,15,128,140,65,128,134,188,0,0,89,167,97,181,224,0,2,205,62,53,
-224,0,2,205,66,237,120,0,0,179,81,204,107,192,0,5,154,150,67,94,0,0,44,212,
-245,90,240,0,1,102,169,162,215,128,0,11,53,93,150,188,0,0,89,171,111,53,
-108,150,163,70,0,0,42,2,249,50,94,124,35,68,225,146,49,13,24,0,0,165,161,
-124,153,47,62,12,130,112,201,24,132,56,97,115,16,0,0,62,31,192,0,0,0,51,48,
-0,0,60,31,192,0,0,0,50,241,32,26,193,55,132,112,161,156,72,135,26,41,200,
-140,114,163,156,201,7,56,79,9,80,47,132,140,93,19,160,43,145,3,76,78,18,49,
-116,78,144,238,68,133,36,72,209,19,132,140,93,19,168,47,146,195,102,11,240,
-145,139,162,117,132,242,120,121,56,72,197,209,59,2,59,72,160,157,140,93,19,
-181,36,242,50,143,36,31,131,162,166,7,144,238,133,227,226,235,224,242,161,
-249,18,21,100,20,207,44,199,151,180,122,89,135,152,154,121,153,199,156,158,
-121,218,7,158,162,121,250,71,160,166,122,26,135,162,170,122,58,199,164,16,
-240,70,68,226,27,51,199,138,120,35,34,112,171,112,38,121,1,124,153,47,62,
-17,162,112,201,19,211,11,228,201,121,240,100,19,134,72,158,160,91,201,18,
-186,44,3,68,79,122,168,151,115,165,40,21,18,227,65,198,231,200,8,68,184,84,
-53,19,38,120,128,145,144,78,25,59,72,163,48,64,144,200,39,12,157,164,80,46,
-185,143,115,72,217,230,72,9,35,68,225,147,180,138,51,68,9,17,162,112,201,
-218,69,2,235,152,247,52,141,158,108,128,98,72,64,121,51,132,4,81,164,144,
-128,242,104,136,0,16,92,38,14,49,39,199,197,211,116,240,242,113,197,231,18,
-53,189,116,65,131,18,124,117,155,199,197,207,36,103,142,12,146,20,80,249,
-186,60,116,4,204,73,241,214,111,31,23,60,145,158,56,208,48,146,229,146,3,2,
-82,65,155,195,94,3,10,36,4,201,196,64,56,100,42,26,78,62,46,121,35,60,113,
-152,16,25,10,134,147,143,139,158,72,205,4,151,21,0,73,16,11,230,144,12,88,
-144,153,39,52,144,69,241,37,72,217,240,151,153,27,36,57,178,230,16,16,137,
-114,68,2,200,62,81,1,8,151,11,23,100,141,229,18,6,34,92,37,230,70,201,1,89,
-57,36,2,40,152,151,44,129,83,18,124,117,155,199,197,207,36,103,142,75,12,
-11,151,46,89,40,18,37,200,64,12,154,236,252,238,185,23,95,213,1,132,234,0,
-194,245,128,14,56,37,199,89,188,124,92,242,70,120,232,16,26,137,113,241,
-116,221,60,60,156,113,122,36,10,62,46,121,35,60,113,18,225,27,70,18,32,10,
-201,211,32,67,107,104,100,42,26,78,24,147,153,35,181,181,207,64,67,107,104,
-100,42,26,78,72,147,153,35,181,181,207,68,16,218,218,91,156,170,63,134,36,
-230,72,237,109,116,136,16,218,218,91,156,170,63,146,36,230,72,237,109,116,
-137,16,96,128,228,2,6,191,46,3,71,147,68,4,16,22,188,169,240,16,40,104,242,
-135,198,171,44,68,65,5,217,231,215,6,231,62,188,8,49,1,3,162,92,4,98,12,41,
-7,33,148,53,242,128,97,32,130,3,9,205,16,38,199,198,14,9,0,111,115,225,0,8,
-250,72,240,207,128,241,37,73,25,18,40,0,178,58,11,56,192,2,201,104,17,35,
-160,9,39,70,114,8,6,147,214,129,18,74,240,30,141,145,208,89,203,62,3,161,
-163,37,248,226,185,244,11,88,37,62,33,163,37,248,226,185,252,0,127,255,130,
-146,164,142,32,26,1,36,230,18,1,164,7,43,163,194,0,71,128,105,64,216,7,192,
-52,192,197,66,230,72,192,52,224,209,32,232,34,68,62,129,113,32,232,34,114,
-40,49,231,16,254,0,63,255,208,99,2,140,44,92,206,8,224,143,4,225,147,210,
-124,13,44,92,206,9,195,39,30,228,54,126,163,225,200,169,198,133,42,166,191,
-246,3,11,251,0,24,71,4,120,9,251,8,10,17,193,30,9,195,39,1,63,105,1,98,112,
-201,199,185,13,159,1,63,105,32,48,156,209,2,126,227,224,58,26,50,95,142,47,
-192,208,22,176,74,124,67,70,75,241,197,248,26,64,213,184,64,89,56,39,49,
-224,137,62,36,2,176,19,17,254,68,3,196,143,88,4,79,162,0,210,32,34,35,253,
-72,5,146,208,34,125,144,5,147,214,137,253,208,9,149,3,41,197,13,55,233,0,
-185,187,139,117,137,30,8,18,39,172,1,25,187,139,112,128,178,113,110,177,35,
-193,2,68,245,128,23,55,114,143,121,35,193,2,68,245,130,8,205,220,91,132,5,
-147,148,123,201,30,8,18,39,172,16,18,113,67,63,128,3,68,143,32,39,243,32,
-42,83,4,103,46,89,19,63,224,208,16,70,142,92,178,38,127,193,164,8,67,68,
-186,12,146,247,154,1,165,64,202,113,252,160,131,32,7,35,167,26,50,235,231,
-130,48,179,192,65,148,69,19,214,2,251,85,2,232,72,31,255,253,239,255,255,
-255,255,226,122,196,55,106,160,93,9,0,0,0,0,0,4,0,0,3,49,0,0,3,225,252,0,0,
-0,0,143,94,233,34,104,169,54,144,210,161,168,158,32,0,0,120,63,128,0,0,0,
-17,235,72,96,77,21,38,210,26,84,53,19,196,0,0,15,15,240,0,0,0,0,253,35,228,
-133,185,176,0,0,44,15,0,0,0,0,8,117,128,190,212,128,82,109,33,179,33,137,
-24,31,255,231,232,127,255,255,255,228,58,196,55,106,64,41,54,144,217,144,
-196,140,15,255,243,252,63,255,255,255,241,15,4,100,78,33,179,60,120,167,
-130,50,39,10,183,2,103,144,113,8,151,10,134,162,100,221,16,18,137,113,13,
-153,12,72,238,137,1,81,46,52,28,110,232,148,53,18,228,128,82,113,13,153,12,
-72,238,137,142,73,78,52,0,0,0,0,0,0,0,0,8,58,254,1,12,38,248,134,23,130,0,
-60,221,194,162,228,30,244,128,217,187,132,187,220,210,54,104,2,247,132,5,
-205,220,124,72,36,73,14,110,252,132,25,128,193,94,8,200,149,200,3,237,38,
-43,31,192,54,186,213,128,57,45,56,210,0,0,62,31,192,0,0,0,49,90,251,224,6,
-77,220,24,38,78,74,113,67,77,124,16,50,110,228,208,194,114,83,138,26,107,
-224,172,37,240,97,41,187,139,112,128,178,112,96,153,57,41,197,13,53,240,
-113,41,187,139,112,128,178,114,104,97,57,41,197,13,53,240,128,195,95,8,44,
-61,240,132,216,93,33,133,192,128,14,98,79,147,67,9,129,0,44,196,159,11,69,
-175,152,32,35,100,33,135,24,147,237,38,34,246,139,95,48,64,70,200,68,8,49,
-39,198,57,179,61,144,138,22,98,79,180,152,153,215,54,103,178,17,129,204,73,
-240,96,153,44,132,112,163,18,125,164,196,62,130,100,178,18,1,140,73,240,96,
-197,144,146,18,98,79,180,152,135,208,98,200,74,8,49,39,195,186,145,149,144,
-150,22,98,79,180,152,143,215,82,50,178,19,2,140,73,241,136,109,38,73,89,9,
-161,166,36,251,73,137,157,67,105,50,74,200,78,10,49,39,201,16,78,104,229,
-100,39,134,152,147,237,38,41,116,130,115,71,43,33,64,60,196,159,24,133,173,
-18,32,156,209,202,200,81,18,49,39,218,76,76,234,22,180,72,130,115,71,43,33,
-72,68,196,159,38,134,19,46,105,56,226,150,68,157,160,1,228,73,242,104,97,
-46,16,31,34,79,140,66,214,137,16,78,104,229,108,169,137,72,147,237,38,38,
-117,11,90,36,65,57,163,149,178,168,21,34,79,146,32,156,209,202,218,250,161,
-178,36,251,73,138,93,32,156,209,202,218,250,193,82,36,248,196,54,147,36,
-173,191,174,27,34,79,180,152,153,212,54,147,36,173,191,176,17,34,79,135,
-117,35,43,115,236,133,200,147,237,38,35,245,212,140,173,207,180,15,34,79,
-131,4,201,108,173,133,72,147,237,38,33,244,19,37,178,184,17,34,79,140,115,
-102,123,107,238,133,200,147,237,38,38,117,205,153,237,175,188,23,34,79,133,
-162,215,204,16,17,182,254,248,116,137,62,210,98,47,104,181,243,4,4,109,191,
-192,131,152,147,230,8,8,217,12,16,60,137,62,96,128,141,178,193,181,55,136,
-200,51,128,114,108,28,100,128,0,0,0,0,0,0,0,12,110,127,32,98,115,249,73,
-117,243,249,67,21,159,202,38,47,63,148,86,8,75,144,94,50,1,38,73,79,204,67,
-95,231,1,6,128,14,79,129,185,40,249,18,149,181,207,142,199,155,172,248,172,
-89,183,207,140,198,137,175,200,0,159,72,10,5,21,220,138,120,74,129,124,36,
-98,232,228,74,81,62,160,20,10,107,185,21,114,32,105,137,194,70,46,142,68,
-165,19,235,1,64,170,187,145,119,34,66,146,36,104,137,194,70,46,142,68,165,
-19,236,1,64,174,187,145,95,37,134,204,23,225,35,23,71,34,82,137,246,128,
-160,89,93,200,167,147,195,201,194,70,46,142,68,165,19,238,1,64,182,187,145,
-71,105,20,19,177,139,163,145,41,68,16,7,6,15,82,70,72,115,96,0,118,105,160,
-0,0,0,0,91,60,165,195,201,194,8,134,149,216,130,0,192,41,224,136,2,48,176,
-228,1,149,13,195,15,0,200,209,97,71,128,99,32,176,131,192,113,57,143,0,167,
-131,32,230,80,28,202,139,175,237,2,48,189,160,20,1,119,48,87,193,186,129,
-89,56,72,197,209,200,193,185,35,23,71,109,13,219,36,98,232,237,156,13,26,
-208,211,14,102,19,87,137,91,95,128,0,10,64,24,92,0,0,82,2,53,63,240,49,204,
-202,10,14,38,78,44,141,52,207,31,0,0,22,32,129,100,180,8,148,145,78,102,
-152,80,113,50,113,100,105,166,120,248,0,0,177,1,65,196,201,199,20,178,36,
-227,224,0,2,200,3,6,133,41,35,31,0,0,22,1,44,57,137,62,33,179,216,162,152,
-192,131,18,124,162,27,61,138,41,108,32,196,159,16,217,232,235,81,76,104,73,
-137,62,81,13,158,142,181,20,184,16,98,79,136,108,244,244,168,166,56,36,196,
-159,40,134,207,79,74,138,93,10,49,39,194,173,192,158,158,149,20,188,20,98,
-79,133,91,129,61,109,74,41,124,30,68,159,16,217,236,83,108,96,68,137,62,81,
-13,158,197,54,182,17,34,79,136,108,244,117,169,182,52,38,68,159,40,134,207,
-71,90,155,92,8,145,39,196,54,122,122,84,219,28,19,34,79,148,67,103,167,165,
-77,174,133,72,147,225,86,224,79,79,74,155,94,10,145,39,194,173,192,158,182,
-165,54,190,206,25,212,35,208,226,100,150,211,201,29,162,44,140,35,103,0,0,
-3,192,252,0,0,0,0,206,25,228,35,208,226,100,150,211,201,29,162,44,140,35,
-103,0,0,3,192,252,0,0,0,0,206,25,244,35,208,226,100,150,211,201,29,162,44,
-140,35,103,0,0,3,192,252,0,0,0,0,206,26,4,35,208,226,100,150,211,201,29,
-162,44,140,35,103,0,0,0,1,0,0,0,0,0,206,26,20,35,208,226,100,150,211,201,
-29,162,44,140,35,103,0,0,0,1,0,0,0,0,0,206,26,36,35,208,226,100,150,211,
-201,29,162,44,140,35,103,0,0,0,65,0,0,0,0,0,206,26,52,35,208,226,100,150,
-211,201,29,162,44,140,35,103,0,0,0,65,0,0,0,0,0,206,26,68,35,208,226,100,
-150,211,201,29,162,44,140,35,103,0,0,0,65,0,0,0,0,0,206,26,84,35,208,226,
-100,150,211,201,29,162,44,140,35,103,0,0,0,129,0,0,0,0,0,195,154,99,16,38,
-36,0,251,68,117,179,216,162,128,68,72,1,241,13,158,197,20,150,25,18,0,125,
-162,58,217,232,235,117,100,162,136,25,18,0,125,162,58,217,232,235,116,36,
-162,145,2,226,64,15,136,108,244,117,186,178,81,73,129,113,32,7,196,54,122,
-58,221,9,40,165,64,200,144,3,237,17,214,207,79,75,171,37,20,80,200,144,3,
-237,17,214,207,79,75,161,37,20,138,23,18,0,124,67,103,167,165,213,146,138,
-77,11,137,0,62,33,179,211,210,232,73,69,42,133,196,128,31,10,183,2,125,89,
-40,163,5,196,128,31,10,183,2,125,9,40,164,96,200,144,3,224,221,64,172,157,
-89,40,163,134,68,128,31,6,234,5,100,232,73,69,35,133,68,128,31,104,142,182,
-125,89,40,180,0,168,144,3,237,17,214,207,161,37,22,144,19,18,0,124,67,103,
-213,146,139,80,9,137,0,62,33,179,232,73,69,172,5,90,40,153,59,68,117,179,
-216,166,192,77,162,137,147,136,108,246,41,180,176,219,69,19,39,104,142,182,
-122,58,221,89,41,178,6,218,40,153,59,68,117,179,209,214,232,73,77,162,6,90,
-40,153,56,134,207,71,91,171,37,54,152,25,104,162,100,226,27,61,29,110,132,
-148,218,160,109,162,137,147,180,71,91,61,61,46,172,148,217,67,109,20,76,
-157,162,58,217,233,233,116,36,166,209,67,45,20,76,156,67,103,167,165,213,
-146,155,77,12,180,81,50,113,13,158,158,151,66,74,109,84,50,209,68,201,194,
-173,192,159,86,74,108,193,150,138,38,78,21,110,4,250,18,83,104,193,182,138,
-38,78,13,212,10,201,213,146,155,56,109,162,137,147,131,117,2,178,116,36,
-166,209,194,237,20,76,157,162,58,217,245,100,167,16,2,237,20,76,157,162,58,
-217,244,36,167,18,2,173,20,76,156,67,103,213,146,156,80,10,180,81,50,113,
-13,159,66,74,113,97,175,220,48,216,109,192,4,42,22,189,163,0,196,133,0,185,
-80,32,28,78,99,193,18,80,36,4,19,159,141,156,0,178,90,4,74,73,0,22,209,68,
-201,185,129,4,2,8,3,132,64,60,36,0,171,240,84,6,149,113,72,176,157,91,116,
-116,32,88,181,129,32,11,42,218,221,131,234,219,165,1,8,187,152,255,188,231,
-235,248,47,86,227,105,18,2,56,175,185,255,244,17,91,40,110,173,198,209,208,
-36,7,188,189,179,240,238,82,97,80,93,122,32,125,144,132,160,12,22,162,42,7,
-236,161,25,232,237,105,64,158,160,230,63,205,59,127,102,11,217,66,51,210,
-129,61,65,236,127,154,118,254,205,171,197,34,168,48,6,90,162,1,0,39,75,84,
-72,8,9,33,186,162,80,64,76,13,213,19,2,130,96,110,150,181,0,65,6,51,213,20,
-128,65,17,11,213,19,130,137,121,211,210,210,144,6,39,75,84,80,0,201,119,
-234,138,8,41,86,231,71,84,80,129,79,135,186,122,101,224,34,25,69,233,208,3,
-91,141,170,40,96,139,113,180,181,69,36,21,110,54,142,134,168,165,1,176,23,
-212,47,0,216,134,234,87,128,111,117,181,168,128,209,3,70,230,106,192,5,139,
-168,209,234,138,32,36,144,102,235,8,3,146,27,170,40,160,146,132,103,170,40,
-192,115,3,117,69,28,22,113,163,69,170,41,103,1,66,188,17,145,52,104,4,202,
-113,67,76,130,227,72,194,13,240,108,0,0,83,96,0,2,185,0,104,146,84,97,48,0,
-1,90,192,56,169,24,145,179,192,0,5,96,8,56,16,32,128,56,18,52,125,198,86,
-147,186,140,28,50,21,13,39,31,23,60,145,158,56,204,141,47,121,6,155,190,
-188,24,49,39,199,89,188,124,92,242,70,120,224,201,33,69,15,155,163,199,68,
-14,49,39,199,197,211,116,240,242,113,197,231,18,180,254,4,3,17,46,18,243,
-35,100,128,172,156,146,70,163,150,76,34,248,146,164,108,248,75,204,141,146,
-28,217,115,9,27,79,11,241,173,235,162,160,224,200,2,206,9,113,13,148,192,
-209,18,22,164,146,37,193,57,162,4,249,39,196,128,24,2,178,66,213,136,68,
-201,16,77,209,131,31,192,242,88,96,92,191,151,34,100,136,38,232,255,252,92,
-221,199,197,12,68,209,82,66,212,11,155,185,41,197,13,55,38,3,66,213,47,131,
-250,72,12,162,99,133,116,127,196,32,225,1,3,34,92,170,9,105,164,32,225,64,
-131,156,1,193,133,7,19,39,22,70,154,103,143,128,0,11,16,20,28,76,156,113,
-75,34,78,62,0,0,44,128,48,104,82,146,49,240,0,1,96,11,180,192,0,5,162,1,18,
-160,65,24,131,20,145,25,188,48,132,122,28,76,146,218,121,35,180,69,145,132,
-108,224,0,0,120,31,128,0,0,0,25,188,56,132,122,28,76,146,218,121,35,180,69,
-145,132,108,224,0,0,120,31,128,0,0,0,40,160,45,110,23,30,176,33,184,0,0,
-181,32,29,235,2,27,199,23,0,0,22,196,51,120,129,8,244,56,153,37,180,242,71,
-104,139,35,8,217,192,0,0,240,63,0,0,0,0,51,120,145,8,244,56,153,37,180,242,
-71,104,139,35,8,217,192,0,0,0,64,0,0,0,0,51,120,161,8,244,56,153,37,180,
-242,71,104,139,35,8,217,192,0,0,0,64,0,0,0,0,51,120,177,8,244,56,153,37,
-180,242,71,104,139,35,8,217,192,0,0,16,64,0,0,0,0,51,120,193,8,244,56,153,
-37,180,242,71,104,139,35,8,217,192,0,0,16,64,0,0,0,0,51,120,209,8,244,56,
-153,37,180,242,71,104,139,35,8,217,192,0,0,16,64,0,0,0,0,51,120,225,8,244,
-56,153,37,180,242,71,104,139,35,8,217,192,0,0,32,64,0,0,0,0,32,227,194,0,
-97,57,162,4,246,40,5,34,92,35,68,225,161,166,219,16,16,137,112,52,41,73,29,
-169,1,65,196,201,197,145,166,153,246,8,3,137,204,120,34,74,8,200,58,128,28,
-211,160,130,52,78,26,26,110,248,0,0,170,4,12,70,137,195,38,0,0,42,68,159,7,
-84,3,154,150,16,70,137,195,67,77,223,0,0,20,224,20,160,152,23,223,0,0,20,
-226,9,65,154,232,147,161,115,59,224,0,2,156,84,12,50,9,195,38,0,0,41,133,
-30,224,32,54,186,221,128,60,
+DUK_INTERNAL const duk_uint8_t duk_builtins_data[4281] = {
+144,148,105,226,32,68,52,228,254,12,104,202,37,132,52,167,194,138,105,245,
+124,57,28,211,57,18,64,52,239,126,44,138,111,175,241,164,19,87,145,30,33,
+167,22,145,159,8,211,139,9,225,42,5,240,145,139,163,163,8,211,139,10,228,
+64,211,19,132,140,93,29,56,70,156,88,119,34,66,146,36,104,137,194,70,46,
+142,172,35,78,44,47,146,195,102,11,240,145,139,163,175,8,211,139,9,228,240,
+242,112,145,139,163,179,8,211,139,8,237,34,130,118,49,116,118,225,26,48,0,
+1,98,29,201,158,46,183,39,135,147,132,140,93,16,132,76,66,33,8,66,16,132,
+33,8,66,26,180,105,97,167,68,150,34,33,154,112,0,1,91,247,35,79,111,237,
+198,174,232,47,31,23,95,17,13,31,249,96,211,49,50,53,214,77,141,24,0,0,181,
+10,228,240,242,15,128,140,65,128,134,188,0,0,90,167,97,181,224,0,2,213,62,
+53,224,0,2,213,66,237,120,0,0,181,81,204,107,192,0,5,170,150,67,94,0,0,45,
+84,245,90,240,0,1,106,169,162,215,128,0,11,85,93,150,188,0,0,90,171,111,53,
+109,22,162,26,48,0,1,84,23,201,146,243,225,26,39,12,145,136,104,192,0,5,61,
+11,228,201,121,240,100,19,134,72,196,33,195,14,40,203,112,64,190,76,232,
+145,153,136,0,0,31,15,224,0,0,0,25,152,0,0,30,15,224,0,0,0,25,120,144,13,
+96,155,194,56,80,206,36,67,141,20,228,70,57,81,206,100,131,156,39,132,168,
+23,194,70,46,137,208,21,200,129,166,39,9,24,186,39,72,119,34,66,146,36,104,
+137,194,70,46,137,212,23,201,97,179,5,248,72,197,209,58,194,121,60,60,156,
+36,98,232,157,129,29,164,80,78,198,46,137,218,146,121,25,71,146,9,209,5,
+209,61,48,126,14,138,152,30,67,186,23,143,139,175,131,202,135,228,72,85,
+144,83,60,179,30,94,209,233,102,30,98,105,230,103,30,114,121,231,104,30,
+122,137,231,233,30,130,153,232,106,30,138,169,232,235,30,144,67,193,25,19,
+136,108,207,30,41,224,140,137,194,173,192,153,228,5,242,100,188,248,70,137,
+195,36,79,78,47,147,37,231,193,144,78,25,34,122,145,111,36,74,232,176,13,
+17,61,234,226,93,207,148,160,84,75,141,7,27,161,32,33,18,225,80,212,76,154,
+2,2,70,65,56,100,237,34,140,209,2,67,32,156,50,118,145,64,186,230,61,205,
+35,103,155,32,36,141,19,134,78,210,40,206,16,36,70,137,195,39,105,20,11,
+174,99,220,210,54,121,210,1,137,33,1,228,207,16,17,70,146,66,3,201,164,32,
+0,65,112,152,56,196,159,31,23,77,211,195,201,199,23,160,72,214,246,81,6,12,
+73,241,214,111,31,23,60,145,158,56,50,72,81,67,230,232,242,80,19,49,39,199,
+89,188,124,92,242,70,120,227,64,194,75,154,72,12,9,73,6,111,21,120,12,40,
+144,19,39,25,0,225,144,168,105,56,248,185,228,140,241,200,96,64,100,42,26,
+78,62,46,121,35,52,18,92,116,1,36,64,47,158,64,49,98,66,100,156,242,65,23,
+196,149,35,103,194,94,100,108,144,230,203,156,64,66,37,201,16,11,32,249,
+132,4,34,92,44,93,146,55,152,72,24,137,112,151,153,27,36,5,100,229,144,8,
+162,98,92,210,5,76,73,241,214,111,31,23,60,145,158,57,44,48,46,92,185,164,
+160,72,151,41,0,50,107,179,244,59,36,93,127,92,6,19,172,3,11,216,0,56,224,
+151,29,102,241,241,115,201,25,227,164,64,106,37,199,197,211,116,240,242,
+113,197,233,144,40,248,185,228,140,241,196,75,132,109,24,72,128,43,39,84,
+129,13,173,161,144,168,105,56,98,78,100,142,214,215,69,1,13,173,161,144,
+168,105,57,34,78,100,142,214,215,69,16,67,107,105,110,114,168,254,24,147,
+153,35,181,181,212,32,67,107,105,110,114,168,254,72,147,153,35,181,181,212,
+36,65,130,3,144,8,26,252,200,13,30,85,16,16,64,90,242,231,192,64,161,163,
+203,31,26,172,193,17,4,23,105,159,96,27,172,251,16,32,196,4,14,137,112,17,
+136,48,164,28,134,80,215,202,1,132,130,8,12,39,52,64,155,31,24,56,36,1,189,
+207,132,0,35,233,35,195,62,3,196,149,36,100,72,160,2,200,232,44,227,0,11,
+37,160,68,142,128,36,157,25,200,32,26,79,90,4,73,43,192,122,54,71,65,103,
+44,248,14,134,140,151,227,138,231,208,45,96,148,248,134,140,151,227,138,
+231,240,1,255,254,10,74,146,56,128,104,4,147,152,72,6,144,28,174,143,8,1,
+30,1,165,3,96,31,0,211,3,21,11,153,35,0,211,131,68,131,160,137,16,250,5,
+196,131,160,137,200,160,199,156,67,248,0,255,255,65,140,10,48,177,115,56,
+35,130,60,19,134,79,89,240,52,177,115,56,39,12,156,123,144,217,251,15,135,
+34,167,30,20,170,154,255,232,12,47,244,0,97,28,17,224,39,238,32,40,71,4,
+120,39,12,156,4,253,228,5,137,195,39,30,228,54,124,4,253,228,128,194,115,
+68,9,252,15,128,232,104,201,126,56,191,35,64,90,193,41,241,13,25,47,199,23,
+228,105,3,86,225,1,100,224,156,199,130,36,249,144,10,192,76,71,250,16,15,
+18,61,96,17,62,200,3,72,128,136,143,247,32,22,75,64,137,248,64,22,79,90,39,
+249,64,38,84,12,167,20,52,223,196,2,230,238,45,214,36,120,32,72,158,208,4,
+102,238,45,194,2,201,197,186,196,143,4,9,19,218,0,92,221,202,61,228,143,4,
+9,19,218,8,35,55,113,110,16,22,78,81,239,36,120,32,72,158,208,64,73,197,12,
+255,0,13,18,60,128,159,212,128,169,76,17,156,185,100,76,255,163,64,65,26,
+57,114,200,153,255,70,144,33,13,18,232,50,75,226,104,6,149,3,41,199,246,
+130,12,128,28,142,156,120,203,175,158,8,194,207,1,6,81,20,79,88,11,237,84,
+11,161,32,127,255,247,191,255,255,255,255,137,235,16,221,170,129,116,36,0,
+0,0,0,0,16,0,0,12,196,0,0,15,135,240,0,0,0,2,61,123,164,137,162,164,218,67,
+74,134,162,120,128,0,1,224,254,0,0,0,0,71,173,33,129,52,84,155,72,105,80,
+212,79,16,0,0,60,63,192,0,0,0,3,244,143,146,22,230,192,0,0,176,60,0,0,0,0,
+33,214,2,251,82,1,73,180,134,204,134,36,96,127,255,159,161,255,255,255,255,
+144,235,16,221,169,0,164,218,67,102,67,18,48,63,255,207,240,255,255,255,
+255,196,60,17,145,56,134,204,241,226,158,8,200,156,42,220,9,158,65,196,34,
+92,42,26,137,147,120,64,74,37,196,54,100,49,35,188,36,5,68,184,208,113,187,
+194,80,212,75,146,1,73,196,54,100,49,35,188,38,57,37,56,240,0,0,0,0,0,0,0,
+0,32,235,248,68,48,156,2,24,94,24,0,243,119,10,139,144,123,242,3,102,238,
+18,239,115,72,217,160,11,223,16,23,55,113,241,32,145,36,57,188,18,16,102,3,
+5,120,35,34,89,32,15,180,152,173,127,0,218,235,88,0,228,180,227,200,0,0,
+248,127,0,0,0,0,197,107,240,64,6,77,220,24,38,78,74,113,67,77,130,4,12,155,
+185,52,48,156,148,226,134,155,4,10,194,96,129,132,166,238,45,194,2,201,193,
+130,100,228,167,20,52,216,32,113,41,187,139,112,128,178,114,104,97,57,41,
+197,13,54,8,32,48,216,32,130,195,224,130,19,97,124,134,23,6,0,57,137,62,77,
+12,38,12,0,179,18,124,45,22,190,96,128,141,176,134,28,98,79,180,152,139,
+218,45,124,193,1,27,97,16,32,196,159,24,230,204,246,194,40,89,137,62,210,
+98,103,92,217,158,216,70,7,49,39,193,130,100,182,17,194,140,73,246,147,16,
+250,9,146,216,72,6,49,39,193,131,22,194,72,73,137,62,210,98,31,65,139,97,
+40,32,196,159,14,234,70,86,194,88,89,137,62,210,98,63,93,72,202,216,76,10,
+49,39,198,33,180,153,37,108,38,134,152,147,237,38,38,117,13,164,201,43,97,
+56,40,196,159,36,65,57,163,149,176,158,26,98,79,180,152,165,210,9,205,28,
+173,133,0,243,18,124,98,22,180,72,130,115,71,43,97,68,72,196,159,105,49,51,
+168,90,209,34,9,205,28,173,133,33,19,18,124,154,24,76,185,164,227,138,89,
+18,119,0,7,145,39,201,161,132,188,64,124,137,62,49,11,90,36,65,57,163,149,
+210,166,37,34,79,180,152,153,212,45,104,145,4,230,142,87,74,160,84,137,62,
+72,130,115,71,43,171,234,134,200,147,237,38,41,116,130,115,71,43,171,235,5,
+72,147,227,16,218,76,146,186,254,184,108,137,62,210,98,103,80,218,76,146,
+186,254,192,68,137,62,29,212,140,174,207,178,23,34,79,180,152,143,215,82,
+50,187,62,208,60,137,62,12,19,37,210,182,21,34,79,180,152,135,208,76,151,
+74,224,68,137,62,49,205,153,238,175,186,23,34,79,180,152,153,215,54,103,
+186,190,240,92,137,62,22,139,95,48,64,70,235,251,225,210,36,251,73,136,189,
+162,215,204,16,17,186,255,2,14,98,79,152,32,35,108,48,64,242,36,249,130,2,
+55,75,6,212,224,72,200,51,128,114,108,28,100,128,0,0,0,0,0,0,0,12,110,127,
+48,98,115,249,201,117,243,249,195,21,159,206,38,47,63,156,86,8,75,144,94,
+82,1,38,73,79,208,67,95,233,1,6,128,14,79,129,186,40,249,18,149,182,207,
+144,200,155,188,248,204,105,184,207,142,199,137,175,201,0,159,72,10,5,21,
+221,10,120,74,129,124,36,98,232,228,74,81,62,160,20,10,107,186,21,114,32,
+105,137,194,70,46,142,68,165,19,235,1,64,170,187,161,119,34,66,146,36,104,
+137,194,70,46,142,68,165,19,236,1,64,174,187,161,95,37,134,204,23,225,35,
+23,71,34,82,137,246,128,160,89,93,208,167,147,195,201,194,70,46,142,68,165,
+19,238,1,64,182,187,161,71,105,20,19,177,139,163,145,41,68,16,7,6,15,82,70,
+72,115,96,0,15,106,32,0,0,0,0,91,60,165,195,201,194,8,134,149,216,162,0,
+192,41,225,8,2,48,177,36,1,149,13,196,15,0,200,209,97,199,128,99,32,176,
+195,192,113,57,143,0,167,133,32,230,80,28,202,139,175,238,2,48,189,192,20,
+1,119,80,87,193,186,129,89,56,72,197,209,200,193,185,35,23,71,109,13,219,
+36,98,232,237,156,13,26,208,211,14,102,19,87,137,91,95,128,0,10,96,24,92,0,
+0,83,2,53,56,0,0,165,3,28,204,160,160,226,100,226,200,211,76,241,240,0,1,
+102,8,22,75,64,137,73,20,230,105,133,7,19,39,22,70,154,103,143,128,0,11,48,
+20,28,76,156,113,75,34,78,62,0,0,45,3,103,31,0,0,22,65,44,57,137,62,33,179,
+216,162,152,192,131,18,124,162,27,61,138,41,108,32,196,159,16,217,232,235,
+81,76,104,73,137,62,81,13,158,142,181,20,184,16,98,79,136,108,244,244,168,
+166,56,36,196,159,40,134,207,79,74,138,93,10,49,39,194,173,192,158,158,149,
+20,188,20,98,79,133,91,129,61,109,74,41,124,30,68,159,16,217,236,83,108,96,
+68,137,62,81,13,158,197,54,182,17,34,79,136,108,244,117,169,182,52,38,68,
+159,40,134,207,71,90,155,92,8,145,39,196,54,122,122,84,219,28,19,34,79,148,
+67,103,167,165,77,174,133,72,147,225,86,224,79,79,74,155,94,10,145,39,194,
+173,192,158,182,165,54,190,206,25,212,35,208,226,100,150,211,201,29,162,44,
+140,35,103,0,0,3,192,252,0,0,0,0,206,25,228,35,208,226,100,150,211,201,29,
+162,44,140,35,103,0,0,3,192,252,0,0,0,0,206,25,244,35,208,226,100,150,211,
+201,29,162,44,140,35,103,0,0,3,192,252,0,0,0,0,206,26,4,35,208,226,100,150,
+211,201,29,162,44,140,35,103,0,0,0,1,0,0,0,0,0,206,26,20,35,208,226,100,
+150,211,201,29,162,44,140,35,103,0,0,0,1,0,0,0,0,0,206,26,36,35,208,226,
+100,150,211,201,29,162,44,140,35,103,0,0,0,65,0,0,0,0,0,206,26,52,35,208,
+226,100,150,211,201,29,162,44,140,35,103,0,0,0,65,0,0,0,0,0,206,26,68,35,
+208,226,100,150,211,201,29,162,44,140,35,103,0,0,0,65,0,0,0,0,0,206,26,84,
+35,208,226,100,150,211,201,29,162,44,140,35,103,0,0,0,129,0,0,0,0,0,195,
+154,99,16,38,36,0,251,68,117,179,216,162,128,68,72,1,241,13,158,197,20,150,
+25,18,0,125,162,58,217,232,235,117,100,162,136,25,18,0,125,162,58,217,232,
+235,116,36,162,145,2,226,64,15,136,108,244,117,186,178,81,73,129,113,32,7,
+196,54,122,58,221,9,40,165,64,200,144,3,237,17,214,207,79,75,171,37,20,80,
+200,144,3,237,17,214,207,79,75,161,37,20,138,23,18,0,124,67,103,167,165,
+213,146,138,77,11,137,0,62,33,179,211,210,232,73,69,42,133,196,128,31,10,
+183,2,125,89,40,163,5,196,128,31,10,183,2,125,9,40,164,96,200,144,3,224,
+221,64,172,157,89,40,163,134,68,128,31,6,234,5,100,232,73,69,35,133,68,128,
+31,104,142,182,125,89,40,180,0,168,144,3,237,17,214,207,161,37,22,144,19,
+18,0,124,67,103,213,146,139,80,9,137,0,62,33,179,232,73,69,172,5,90,40,153,
+59,68,117,179,216,166,192,77,162,137,147,136,108,246,41,180,176,219,69,19,
+39,104,142,182,122,58,221,89,41,178,6,218,40,153,59,68,117,179,209,214,232,
+73,77,162,6,90,40,153,56,134,207,71,91,171,37,54,152,25,104,162,100,226,27,
+61,29,110,132,148,218,160,109,162,137,147,180,71,91,61,61,46,172,148,217,
+67,109,20,76,157,162,58,217,233,233,116,36,166,209,67,45,20,76,156,67,103,
+167,165,213,146,155,77,12,180,81,50,113,13,158,158,151,66,74,109,84,50,209,
+68,201,194,173,192,159,86,74,108,193,150,138,38,78,21,110,4,250,18,83,104,
+193,182,138,38,78,13,212,10,201,213,146,155,56,109,162,137,147,131,117,2,
+178,116,36,166,209,194,237,20,76,157,162,58,217,245,100,167,16,2,237,20,76,
+157,162,58,217,244,36,167,18,2,173,20,76,156,67,103,213,146,156,80,10,180,
+81,50,113,13,159,66,74,113,97,175,221,48,216,110,64,4,42,22,189,179,0,196,
+133,0,185,80,32,28,78,99,193,18,80,36,4,19,159,141,172,0,178,90,4,74,73,0,
+22,209,68,201,187,129,4,2,8,3,132,64,60,36,0,171,240,84,6,149,113,72,176,
+157,91,116,116,32,88,181,129,32,11,42,218,221,131,234,219,165,1,8,187,152,
+255,188,231,235,248,47,86,227,105,18,2,56,175,185,255,244,17,91,40,110,173,
+198,209,208,36,7,188,189,179,240,238,82,97,80,93,122,32,125,144,132,160,12,
+22,162,42,7,236,161,25,232,237,105,64,158,160,230,63,205,59,127,102,11,217,
+66,51,210,129,61,65,236,127,154,118,254,205,171,197,34,168,48,6,90,194,1,0,
+39,75,88,72,8,9,33,186,194,80,64,76,13,214,19,2,130,96,110,150,189,0,65,6,
+51,214,20,128,65,17,11,214,19,130,137,121,211,210,211,144,6,39,75,88,80,0,
+201,119,235,10,8,41,86,231,71,88,80,129,79,135,186,122,133,224,34,25,69,
+234,80,3,91,141,172,40,96,139,113,180,181,133,36,21,110,54,142,134,176,165,
+1,176,23,213,47,0,216,134,234,215,128,111,117,181,232,128,209,3,70,230,107,
+64,5,139,168,209,235,10,32,36,144,102,235,136,3,146,27,172,40,160,146,132,
+103,172,40,192,115,3,117,133,28,22,113,163,69,172,41,103,1,66,188,17,145,
+52,168,4,202,113,67,76,130,227,76,194,13,240,108,0,0,83,224,0,2,193,0,104,
+146,84,97,48,0,1,94,192,56,169,24,145,179,192,0,5,112,8,56,16,32,128,56,18,
+52,125,230,86,147,190,140,28,50,21,13,39,31,23,60,145,158,57,12,141,47,129,
+6,155,194,188,24,49,39,199,89,188,124,92,242,70,120,224,201,33,69,15,155,
+163,201,68,14,49,39,199,197,211,116,240,242,113,197,232,18,180,254,36,3,17,
+46,18,243,35,100,128,172,156,178,70,163,154,76,34,248,146,164,108,248,75,
+204,141,146,28,217,115,137,27,95,27,241,173,236,162,160,224,200,2,206,9,
+113,13,148,192,209,18,22,164,146,37,193,57,162,4,249,39,196,128,24,2,178,
+66,213,136,68,201,16,77,209,131,31,192,242,88,96,92,191,151,34,100,136,38,
+232,255,252,92,221,199,197,12,68,209,82,66,212,11,155,185,41,197,13,55,38,
+3,66,213,47,135,254,72,12,162,99,133,116,112,0,1,72,66,14,16,16,50,37,202,
+160,150,154,66,14,20,8,57,192,28,24,80,113,50,113,100,105,166,120,248,0,0,
+179,1,65,196,201,199,20,178,36,227,224,0,2,208,54,113,240,0,1,100,11,181,
+192,0,5,178,1,18,160,65,24,131,20,145,25,188,48,132,122,28,76,146,218,121,
+35,180,69,145,132,108,224,0,0,120,31,128,0,0,0,25,188,56,132,122,28,76,146,
+218,121,35,180,69,145,132,108,224,0,0,120,31,128,0,0,0,40,160,45,110,23,30,
+176,33,184,0,0,183,32,29,235,2,27,199,23,0,0,23,4,51,120,129,8,244,56,153,
+37,180,242,71,104,139,35,8,217,192,0,0,240,63,0,0,0,0,51,120,145,8,244,56,
+153,37,180,242,71,104,139,35,8,217,192,0,0,0,64,0,0,0,0,51,120,161,8,244,
+56,153,37,180,242,71,104,139,35,8,217,192,0,0,0,64,0,0,0,0,51,120,177,8,
+244,56,153,37,180,242,71,104,139,35,8,217,192,0,0,16,64,0,0,0,0,51,120,193,
+8,244,56,153,37,180,242,71,104,139,35,8,217,192,0,0,16,64,0,0,0,0,51,120,
+209,8,244,56,153,37,180,242,71,104,139,35,8,217,192,0,0,16,64,0,0,0,0,51,
+120,225,8,244,56,153,37,180,242,71,104,139,35,8,217,192,0,0,32,64,0,0,0,0,
+32,227,194,0,97,57,162,4,246,104,5,34,92,35,68,225,161,166,220,16,16,137,
+112,52,41,73,29,185,1,65,196,201,197,145,166,153,246,72,3,137,204,120,34,
+74,8,199,1,67,17,162,112,201,84,128,97,144,78,25,42,16,131,169,1,205,66,8,
+35,68,225,161,166,239,128,0,10,192,64,196,104,156,50,96,0,2,172,73,240,117,
+96,57,170,97,4,104,156,52,52,221,240,0,1,82,1,74,9,129,125,240,0,1,82,32,
+148,25,174,137,58,23,51,190,0,0,42,69,64,195,32,156,50,96,0,2,160,81,238,2,
+3,107,173,218,3,192,
 };
 #else
 #error invalid endianness defines
@@ -12195,6 +12299,90 @@ DUK_INTERNAL duk_size_t duk_unicode_unvalidated_utf8_length(const duk_uint8_t *d
 }
 #endif  /* DUK_USE_PREFER_SIZE */
 
+/* Check whether a string is UTF-8 compatible or not. */
+DUK_INTERNAL duk_bool_t duk_unicode_is_utf8_compatible(const duk_uint8_t *buf, duk_size_t len) {
+	duk_size_t i = 0;
+#if !defined(DUK_USE_PREFER_SIZE)
+	duk_size_t len_safe;
+#endif
+
+	/* Many practical strings are ASCII only, so use a fast path check
+	 * to check chunks of bytes at once with minimal branch cost.
+	 */
+#if !defined(DUK_USE_PREFER_SIZE)
+	len_safe = len & ~0x03UL;
+	for (; i < len_safe; i += 4) {
+		duk_uint8_t t = buf[i] | buf[i + 1] | buf[i + 2] | buf[i + 3];
+		if (DUK_UNLIKELY((t & 0x80U) != 0U)) {
+			/* At least one byte was outside 0x00-0x7f, break
+			 * out to slow path (and remain there).
+			 *
+			 * XXX: We could also deal with the problem character
+			 * and resume fast path later.
+			 */
+			break;
+		}
+	}
+#endif
+
+	for (; i < len;) {
+		duk_uint8_t t;
+		duk_size_t left;
+		duk_size_t ncont;
+		duk_uint32_t cp;
+		duk_uint32_t mincp;
+
+		t = buf[i++];
+		if (DUK_LIKELY((t & 0x80U) == 0U)) {
+			/* Fast path, ASCII. */
+			continue;
+		}
+
+		/* Non-ASCII start byte, slow path.
+		 *
+		 * 10xx xxxx          -> continuation byte
+		 * 110x xxxx + 1*CONT -> [0x80, 0x7ff]
+		 * 1110 xxxx + 2*CONT -> [0x800, 0xffff], must reject [0xd800,0xdfff]
+		 * 1111 0xxx + 3*CONT -> [0x10000, 0x10ffff]
+		 */
+		left = len - i;
+		if (t <= 0xdfU) {  /* 1101 1111 = 0xdf */
+			if (t <= 0xbfU) {  /* 1011 1111 = 0xbf */
+				return 0;
+			}
+			ncont = 1;
+			mincp = 0x80UL;
+			cp = t & 0x1fU;
+		} else if (t <= 0xefU) {  /* 1110 1111 = 0xef */
+			ncont = 2;
+			mincp = 0x800UL;
+			cp = t & 0x0fU;
+		} else if (t <= 0xf7U) {  /* 1111 0111 = 0xf7 */
+			ncont = 3;
+			mincp = 0x10000UL;
+			cp = t & 0x07U;
+		} else {
+			return 0;
+		}
+		if (left < ncont) {
+			return 0;
+		}
+		while (ncont > 0U) {
+			t = buf[i++];
+			if ((t & 0xc0U) != 0x80U) {  /* 10xx xxxx */
+				return 0;
+			}
+			cp = (cp << 6) + (t & 0x3fU);
+			ncont--;
+		}
+		if (cp < mincp || cp > 0x10ffffUL || (cp >= 0xd800UL && cp <= 0xdfffUL)) {
+			return 0;
+		}
+	}
+
+	return 1;
+}
+
 /*
  *  Unicode range matcher
  *
@@ -12977,6 +13165,154 @@ DUK_INTERNAL const duk_uint16_t duk_unicode_re_ranges_not_wordchar[10] = {
 };
 
 #endif  /* DUK_USE_REGEXP_SUPPORT */
+/*
+ *  Macro support functions for reading/writing raw data.
+ *
+ *  These are done using memcpy to ensure they're valid even for unaligned
+ *  reads/writes on platforms where alignment counts.  On x86 at least gcc
+ *  is able to compile these into a bswap+mov.  "Always inline" is used to
+ *  ensure these macros compile to minimal code.
+ */
+
+/* #include duk_internal.h -> already included */
+
+union duk__u16_union {
+	duk_uint8_t b[2];
+	duk_uint16_t x;
+};
+typedef union duk__u16_union duk__u16_union;
+
+union duk__u32_union {
+	duk_uint8_t b[4];
+	duk_uint32_t x;
+};
+typedef union duk__u32_union duk__u32_union;
+
+#if defined(DUK_USE_64BIT_OPS)
+union duk__u64_union {
+	duk_uint8_t b[8];
+	duk_uint64_t x;
+};
+typedef union duk__u64_union duk__u64_union;
+#endif
+
+DUK_INTERNAL DUK_ALWAYS_INLINE duk_uint16_t duk_raw_read_u16_be(const duk_uint8_t *p) {
+	duk__u16_union u;
+	duk_memcpy((void *) u.b, (const void *) p, (size_t) 2);
+	u.x = DUK_NTOH16(u.x);
+	return u.x;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE duk_uint32_t duk_raw_read_u32_be(const duk_uint8_t *p) {
+	duk__u32_union u;
+	duk_memcpy((void *) u.b, (const void *) p, (size_t) 4);
+	u.x = DUK_NTOH32(u.x);
+	return u.x;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE duk_float_t duk_raw_read_float_be(const duk_uint8_t *p) {
+	duk_float_union fu;
+	duk_memcpy((void *) fu.uc, (const void *) p, (size_t) 4);
+	duk_fltunion_big_to_host(&fu);
+	return fu.f;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE duk_double_t duk_raw_read_double_be(const duk_uint8_t *p) {
+	duk_double_union du;
+	duk_memcpy((void *) du.uc, (const void *) p, (size_t) 8);
+	duk_dblunion_big_to_host(&du);
+	return du.d;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE duk_uint16_t duk_raw_readinc_u16_be(const duk_uint8_t **p) {
+	duk_uint16_t res = duk_raw_read_u16_be(*p);
+	*p += 2;
+	return res;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE duk_uint32_t duk_raw_readinc_u32_be(const duk_uint8_t **p) {
+	duk_uint32_t res = duk_raw_read_u32_be(*p);
+	*p += 4;
+	return res;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE duk_float_t duk_raw_readinc_float_be(const duk_uint8_t **p) {
+	duk_float_t res = duk_raw_read_float_be(*p);
+	*p += 4;
+	return res;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE duk_double_t duk_raw_readinc_double_be(const duk_uint8_t **p) {
+	duk_double_t res = duk_raw_read_double_be(*p);
+	*p += 8;
+	return res;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE void duk_raw_write_u16_be(duk_uint8_t *p, duk_uint16_t val) {
+	duk__u16_union u;
+	u.x = DUK_HTON16(val);
+	duk_memcpy((void *) p, (const void *) u.b, (size_t) 2);
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE void duk_raw_write_u32_be(duk_uint8_t *p, duk_uint32_t val) {
+	duk__u32_union u;
+	u.x = DUK_HTON32(val);
+	duk_memcpy((void *) p, (const void *) u.b, (size_t) 4);
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE void duk_raw_write_float_be(duk_uint8_t *p, duk_float_t val) {
+	duk_float_union fu;
+	fu.f = val;
+	duk_fltunion_host_to_big(&fu);
+	duk_memcpy((void *) p, (const void *) fu.uc, (size_t) 4);
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE void duk_raw_write_double_be(duk_uint8_t *p, duk_double_t val) {
+	duk_double_union du;
+	du.d = val;
+	duk_dblunion_host_to_big(&du);
+	duk_memcpy((void *) p, (const void *) du.uc, (size_t) 8);
+}
+
+DUK_INTERNAL duk_small_int_t duk_raw_write_xutf8(duk_uint8_t *p, duk_ucodepoint_t val) {
+	duk_small_int_t len = duk_unicode_encode_xutf8(val, p);
+	return len;
+}
+
+DUK_INTERNAL duk_small_int_t duk_raw_write_cesu8(duk_uint8_t *p, duk_ucodepoint_t val) {
+	duk_small_int_t len = duk_unicode_encode_cesu8(val, p);
+	return len;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE void duk_raw_writeinc_u16_be(duk_uint8_t **p, duk_uint16_t val) {
+	duk_raw_write_u16_be(*p, val);
+	*p += 2;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE void duk_raw_writeinc_u32_be(duk_uint8_t **p, duk_uint32_t val) {
+	duk_raw_write_u32_be(*p, val);
+	*p += 4;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE void duk_raw_writeinc_float_be(duk_uint8_t **p, duk_float_t val) {
+	duk_raw_write_float_be(*p, val);
+	*p += 4;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE void duk_raw_writeinc_double_be(duk_uint8_t **p, duk_double_t val) {
+	duk_raw_write_double_be(*p, val);
+	*p += 8;
+}
+
+DUK_INTERNAL void duk_raw_writeinc_xutf8(duk_uint8_t **p, duk_ucodepoint_t val) {
+	duk_small_int_t len = duk_unicode_encode_xutf8(val, *p);
+	*p += len;
+}
+
+DUK_INTERNAL void duk_raw_writeinc_cesu8(duk_uint8_t **p, duk_ucodepoint_t val) {
+	duk_small_int_t len = duk_unicode_encode_cesu8(val, *p);
+	*p += len;
+}
 /*
  *  Misc util stuff.
  */
@@ -13169,13 +13505,13 @@ DUK_INTERNAL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len) {
 #if (DUK_STRIDX_UC_ARGUMENTS > 255)
 #error constant too large
 #endif
-#if (DUK_STRIDX_ARRAY > 255)
+#if (DUK_STRIDX_UC_ARRAY > 255)
 #error constant too large
 #endif
 #if (DUK_STRIDX_UC_BOOLEAN > 255)
 #error constant too large
 #endif
-#if (DUK_STRIDX_DATE > 255)
+#if (DUK_STRIDX_UC_DATE > 255)
 #error constant too large
 #endif
 #if (DUK_STRIDX_UC_ERROR > 255)
@@ -13258,11 +13594,11 @@ DUK_INTERNAL void duk_byteswap_bytes(duk_uint8_t *p, duk_small_uint_t len) {
 DUK_INTERNAL duk_uint8_t duk_class_number_to_stridx[32] = {
 	DUK_STRIDX_EMPTY_STRING,  /* NONE, intentionally empty */
 	DUK_STRIDX_UC_OBJECT,
-	DUK_STRIDX_ARRAY,
+	DUK_STRIDX_UC_ARRAY,
 	DUK_STRIDX_UC_FUNCTION,
 	DUK_STRIDX_UC_ARGUMENTS,
 	DUK_STRIDX_UC_BOOLEAN,
-	DUK_STRIDX_DATE,
+	DUK_STRIDX_UC_DATE,
 	DUK_STRIDX_UC_ERROR,
 	DUK_STRIDX_JSON,
 	DUK_STRIDX_MATH,
@@ -13422,20 +13758,20 @@ DUK_EXTERNAL void duk_config_buffer(duk_hthread *thr, duk_idx_t idx, void *ptr,
  *  Dump/load helpers, xxx_raw() helpers do no buffer checks
  */
 
-DUK_LOCAL duk_uint8_t *duk__load_string_raw(duk_hthread *thr, duk_uint8_t *p) {
+DUK_LOCAL const duk_uint8_t *duk__load_string_raw(duk_hthread *thr, const duk_uint8_t *p) {
 	duk_uint32_t len;
 
-	len = DUK_RAW_READ_U32_BE(p);
+	len = DUK_RAW_READINC_U32_BE(p);
 	duk_push_lstring(thr, (const char *) p, len);
 	p += len;
 	return p;
 }
 
-DUK_LOCAL duk_uint8_t *duk__load_buffer_raw(duk_hthread *thr, duk_uint8_t *p) {
+DUK_LOCAL const duk_uint8_t *duk__load_buffer_raw(duk_hthread *thr, const duk_uint8_t *p) {
 	duk_uint32_t len;
 	duk_uint8_t *buf;
 
-	len = DUK_RAW_READ_U32_BE(p);
+	len = DUK_RAW_READINC_U32_BE(p);
 	buf = (duk_uint8_t *) duk_push_fixed_buffer_nozero(thr, (duk_size_t) len);
 	DUK_ASSERT(buf != NULL);
 	duk_memcpy((void *) buf, (const void *) p, (size_t) len);
@@ -13452,7 +13788,7 @@ DUK_LOCAL duk_uint8_t *duk__dump_hstring_raw(duk_uint8_t *p, duk_hstring *h) {
 	len = DUK_HSTRING_GET_BYTELEN(h);
 	DUK_ASSERT(len <= 0xffffffffUL);  /* string limits */
 	tmp32 = (duk_uint32_t) len;
-	DUK_RAW_WRITE_U32_BE(p, tmp32);
+	DUK_RAW_WRITEINC_U32_BE(p, tmp32);
 	duk_memcpy((void *) p,
 	           (const void *) DUK_HSTRING_GET_DATA(h),
 	           len);
@@ -13471,7 +13807,7 @@ DUK_LOCAL duk_uint8_t *duk__dump_hbuffer_raw(duk_hthread *thr, duk_uint8_t *p, d
 	len = DUK_HBUFFER_GET_SIZE(h);
 	DUK_ASSERT(len <= 0xffffffffUL);  /* buffer limits */
 	tmp32 = (duk_uint32_t) len;
-	DUK_RAW_WRITE_U32_BE(p, tmp32);
+	DUK_RAW_WRITEINC_U32_BE(p, tmp32);
 	/* When len == 0, buffer data pointer may be NULL. */
 	duk_memcpy_unsafe((void *) p,
 	                  (const void *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h),
@@ -13511,7 +13847,7 @@ DUK_LOCAL duk_uint8_t *duk__dump_buffer_prop(duk_hthread *thr, duk_uint8_t *p, d
 		p = duk__dump_hbuffer_raw(thr, p, h_buf);
 	} else {
 		p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U, p);
-		DUK_RAW_WRITE_U32_BE(p, 0);
+		DUK_RAW_WRITEINC_U32_BE(p, 0);
 	}
 	return p;
 }
@@ -13527,7 +13863,7 @@ DUK_LOCAL duk_uint8_t *duk__dump_uint32_prop(duk_hthread *thr, duk_uint8_t *p, d
 		val = def_value;
 	}
 	p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U, p);
-	DUK_RAW_WRITE_U32_BE(p, val);
+	DUK_RAW_WRITEINC_U32_BE(p, val);
 	return p;
 }
 
@@ -13565,11 +13901,11 @@ DUK_LOCAL duk_uint8_t *duk__dump_varmap(duk_hthread *thr, duk_uint8_t *p, duk_bu
 			DUK_ASSERT(DUK_HSTRING_MAX_BYTELEN <= 0x7fffffffUL);  /* ensures no overflow */
 			p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U + DUK_HSTRING_GET_BYTELEN(key) + 4U, p);
 			p = duk__dump_hstring_raw(p, key);
-			DUK_RAW_WRITE_U32_BE(p, val);
+			DUK_RAW_WRITEINC_U32_BE(p, val);
 		}
 	}
 	p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U, p);
-	DUK_RAW_WRITE_U32_BE(p, 0);  /* end of _Varmap */
+	DUK_RAW_WRITEINC_U32_BE(p, 0);  /* end of _Varmap */
 	return p;
 }
 
@@ -13588,7 +13924,7 @@ DUK_LOCAL duk_uint8_t *duk__dump_formals(duk_hthread *thr, duk_uint8_t *p, duk_b
 
 		p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U, p);
 		DUK_ASSERT(h->length != DUK__NO_FORMALS);  /* limits */
-		DUK_RAW_WRITE_U32_BE(p, h->length);
+		DUK_RAW_WRITEINC_U32_BE(p, h->length);
 
 		for (i = 0; i < h->length; i++) {
 			duk_tval *tv_val;
@@ -13609,7 +13945,7 @@ DUK_LOCAL duk_uint8_t *duk__dump_formals(duk_hthread *thr, duk_uint8_t *p, duk_b
 	} else {
 		DUK_DD(DUK_DDPRINT("dumping function without _Formals, emit marker to indicate missing _Formals"));
 		p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 4U, p);
-		DUK_RAW_WRITE_U32_BE(p, DUK__NO_FORMALS);  /* marker: no formals */
+		DUK_RAW_WRITEINC_U32_BE(p, DUK__NO_FORMALS);  /* marker: no formals */
 	}
 	return p;
 }
@@ -13649,27 +13985,27 @@ static duk_uint8_t *duk__dump_func(duk_hthread *thr, duk_hcompfunc *func, duk_bu
 
 	/* Fixed header info. */
 	tmp32 = count_instr;
-	DUK_RAW_WRITE_U32_BE(p, tmp32);
+	DUK_RAW_WRITEINC_U32_BE(p, tmp32);
 	tmp32 = (duk_uint32_t) DUK_HCOMPFUNC_GET_CONSTS_COUNT(thr->heap, func);
-	DUK_RAW_WRITE_U32_BE(p, tmp32);
+	DUK_RAW_WRITEINC_U32_BE(p, tmp32);
 	tmp32 = (duk_uint32_t) DUK_HCOMPFUNC_GET_FUNCS_COUNT(thr->heap, func);
-	DUK_RAW_WRITE_U32_BE(p, tmp32);
+	DUK_RAW_WRITEINC_U32_BE(p, tmp32);
 	tmp16 = func->nregs;
-	DUK_RAW_WRITE_U16_BE(p, tmp16);
+	DUK_RAW_WRITEINC_U16_BE(p, tmp16);
 	tmp16 = func->nargs;
-	DUK_RAW_WRITE_U16_BE(p, tmp16);
+	DUK_RAW_WRITEINC_U16_BE(p, tmp16);
 #if defined(DUK_USE_DEBUGGER_SUPPORT)
 	tmp32 = func->start_line;
-	DUK_RAW_WRITE_U32_BE(p, tmp32);
+	DUK_RAW_WRITEINC_U32_BE(p, tmp32);
 	tmp32 = func->end_line;
-	DUK_RAW_WRITE_U32_BE(p, tmp32);
+	DUK_RAW_WRITEINC_U32_BE(p, tmp32);
 #else
-	DUK_RAW_WRITE_U32_BE(p, 0);
-	DUK_RAW_WRITE_U32_BE(p, 0);
+	DUK_RAW_WRITEINC_U32_BE(p, 0);
+	DUK_RAW_WRITEINC_U32_BE(p, 0);
 #endif
 	tmp32 = DUK_HEAPHDR_GET_FLAGS((duk_heaphdr *) func);  /* masks flags, only duk_hobject flags */
 	tmp32 &= ~(DUK_HOBJECT_FLAG_HAVE_FINALIZER);  /* finalizer flag is lost */
-	DUK_RAW_WRITE_U32_BE(p, tmp32);
+	DUK_RAW_WRITEINC_U32_BE(p, tmp32);
 
 	/* Bytecode instructions: endian conversion needed unless
 	 * platform is big endian.
@@ -13683,7 +14019,7 @@ static duk_uint8_t *duk__dump_func(duk_hthread *thr, duk_hcompfunc *func, duk_bu
 #else
 	while (ins != ins_end) {
 		tmp32 = (duk_uint32_t) (*ins);
-		DUK_RAW_WRITE_U32_BE(p, tmp32);
+		DUK_RAW_WRITEINC_U32_BE(p, tmp32);
 		ins++;
 	}
 #endif
@@ -13708,7 +14044,7 @@ static duk_uint8_t *duk__dump_func(duk_hthread *thr, duk_hcompfunc *func, duk_bu
 			p = DUK_BW_ENSURE_RAW(thr, bw_ctx, 1U + 8U, p);
 			*p++ = DUK__SER_NUMBER;
 			d = DUK_TVAL_GET_NUMBER(tv);
-			DUK_RAW_WRITE_DOUBLE_BE(p, d);
+			DUK_RAW_WRITEINC_DOUBLE_BE(p, d);
 		}
 		tv++;
 	}
@@ -13769,7 +14105,7 @@ static duk_uint8_t *duk__dump_func(duk_hthread *thr, duk_hcompfunc *func, duk_bu
 		DUK_ASSERT((duk_size_t) (p_end - p) >= (duk_size_t) (n)); \
 	} while (0)
 
-static duk_uint8_t *duk__load_func(duk_hthread *thr, duk_uint8_t *p, duk_uint8_t *p_end) {
+static const duk_uint8_t *duk__load_func(duk_hthread *thr, const duk_uint8_t *p, const duk_uint8_t *p_end) {
 	duk_hcompfunc *h_fun;
 	duk_hbuffer *h_data;
 	duk_size_t data_size;
@@ -13793,12 +14129,12 @@ static duk_uint8_t *duk__load_func(duk_hthread *thr, duk_uint8_t *p, duk_uint8_t
 
 	DUK_ASSERT(thr != NULL);
 
-	DUK_DD(DUK_DDPRINT("loading function, p=%p, p_end=%p", (void *) p, (void *) p_end));
+	DUK_DD(DUK_DDPRINT("loading function, p=%p, p_end=%p", (const void *) p, (const void *) p_end));
 
 	DUK__ASSERT_LEFT(3 * 4);
-	count_instr = DUK_RAW_READ_U32_BE(p);
-	count_const = DUK_RAW_READ_U32_BE(p);
-	count_funcs = DUK_RAW_READ_U32_BE(p);
+	count_instr = DUK_RAW_READINC_U32_BE(p);
+	count_const = DUK_RAW_READINC_U32_BE(p);
+	count_funcs = DUK_RAW_READINC_U32_BE(p);
 
 	data_size = sizeof(duk_tval) * count_const +
 	            sizeof(duk_hobject *) * count_funcs +
@@ -13826,17 +14162,17 @@ static duk_uint8_t *duk__load_func(duk_hthread *thr, duk_uint8_t *p, duk_uint8_t
 	DUK_ASSERT(DUK_HCOMPFUNC_GET_BYTECODE(thr->heap, h_fun) == NULL);
 	DUK_ASSERT(DUK_HOBJECT_GET_PROTOTYPE(thr->heap, (duk_hobject *) h_fun) == thr->builtins[DUK_BIDX_FUNCTION_PROTOTYPE]);
 
-	h_fun->nregs = DUK_RAW_READ_U16_BE(p);
-	h_fun->nargs = DUK_RAW_READ_U16_BE(p);
+	h_fun->nregs = DUK_RAW_READINC_U16_BE(p);
+	h_fun->nargs = DUK_RAW_READINC_U16_BE(p);
 #if defined(DUK_USE_DEBUGGER_SUPPORT)
-	h_fun->start_line = DUK_RAW_READ_U32_BE(p);
-	h_fun->end_line = DUK_RAW_READ_U32_BE(p);
+	h_fun->start_line = DUK_RAW_READINC_U32_BE(p);
+	h_fun->end_line = DUK_RAW_READINC_U32_BE(p);
 #else
 	p += 8;  /* skip line info */
 #endif
 
 	/* duk_hcompfunc flags; quite version specific */
-	tmp32 = DUK_RAW_READ_U32_BE(p);
+	tmp32 = DUK_RAW_READINC_U32_BE(p);
 	DUK_HEAPHDR_SET_FLAGS((duk_heaphdr *) h_fun, tmp32);  /* masks flags to only change duk_hobject flags */
 
 	/* standard prototype (no need to set here, already set) */
@@ -13872,7 +14208,7 @@ static duk_uint8_t *duk__load_func(duk_hthread *thr, duk_uint8_t *p, duk_uint8_t
 #else
 	q = fun_data + sizeof(duk_tval) * count_const + sizeof(duk_hobject *) * count_funcs;
 	for (n = count_instr; n > 0; n--) {
-		*((duk_instr_t *) (void *) q) = DUK_RAW_READ_U32_BE(p);
+		*((duk_instr_t *) (void *) q) = DUK_RAW_READINC_U32_BE(p);
 		q += sizeof(duk_instr_t);
 	}
 #endif
@@ -13880,7 +14216,7 @@ static duk_uint8_t *duk__load_func(duk_hthread *thr, duk_uint8_t *p, duk_uint8_t
 	/* Load constants onto value stack but don't yet copy to buffer. */
 	for (n = count_const; n > 0; n--) {
 		DUK__ASSERT_LEFT(1);
-		const_type = DUK_RAW_READ_U8(p);
+		const_type = DUK_RAW_READINC_U8(p);
 		switch (const_type) {
 		case DUK__SER_STRING: {
 			p = duk__load_string_raw(thr, p);
@@ -13893,7 +14229,7 @@ static duk_uint8_t *duk__load_func(duk_hthread *thr, duk_uint8_t *p, duk_uint8_t
 			duk_tval tv_tmp;
 			duk_double_t val;
 			DUK__ASSERT_LEFT(8);
-			val = DUK_RAW_READ_DOUBLE_BE(p);
+			val = DUK_RAW_READINC_DOUBLE_BE(p);
 			DUK_TVAL_SET_NUMBER_CHKFAST_SLOW(&tv_tmp, val);
 			duk_push_tval(thr, &tv_tmp);
 			break;
@@ -13960,7 +14296,7 @@ static duk_uint8_t *duk__load_func(duk_hthread *thr, duk_uint8_t *p, duk_uint8_t
 	duk_set_top(thr, idx_base + 1);
 
 	/* Setup function properties. */
-	tmp32 = DUK_RAW_READ_U32_BE(p);
+	tmp32 = DUK_RAW_READINC_U32_BE(p);
 	duk_push_u32(thr, tmp32);
 	duk_xdef_prop_stridx_short(thr, -2, DUK_STRIDX_LENGTH, DUK_PROPDESC_FLAGS_C);
 
@@ -14040,7 +14376,7 @@ static duk_uint8_t *duk__load_func(duk_hthread *thr, duk_uint8_t *p, duk_uint8_t
 			duk_pop(thr);
 			break;
 		}
-		tmp32 = DUK_RAW_READ_U32_BE(p);
+		tmp32 = DUK_RAW_READINC_U32_BE(p);
 		duk_push_u32(thr, tmp32);
 		duk_put_prop(thr, -3);
 	}
@@ -14050,7 +14386,7 @@ static duk_uint8_t *duk__load_func(duk_hthread *thr, duk_uint8_t *p, duk_uint8_t
 	/* _Formals may have been missing in the original function, which is
 	 * handled using a marker length.
 	 */
-	arr_limit = DUK_RAW_READ_U32_BE(p);
+	arr_limit = DUK_RAW_READINC_U32_BE(p);
 	if (arr_limit != DUK__NO_FORMALS) {
 		duk_push_bare_array(thr);  /* _Formals */
 		for (arr_idx = 0; arr_idx < arr_limit; arr_idx++) {
@@ -14104,7 +14440,7 @@ DUK_EXTERNAL void duk_dump_function(duk_hthread *thr) {
 }
 
 DUK_EXTERNAL void duk_load_function(duk_hthread *thr) {
-	duk_uint8_t *p_buf, *p, *p_end;
+	const duk_uint8_t *p_buf, *p, *p_end;
 	duk_size_t sz;
 
 	DUK_ASSERT_API_ENTRY(thr);
@@ -15370,7 +15706,7 @@ DUK_EXTERNAL void duk_base64_decode(duk_hthread *thr, duk_idx_t idx) {
 DUK_EXTERNAL const char *duk_base64_encode(duk_hthread *thr, duk_idx_t idx) {
 	DUK_UNREF(idx);
 	DUK_ERROR_UNSUPPORTED(thr);
-	DUK_WO_NORETURN(return;);
+	DUK_WO_NORETURN(return NULL;);
 }
 
 DUK_EXTERNAL void duk_base64_decode(duk_hthread *thr, duk_idx_t idx) {
@@ -16051,6 +16387,7 @@ struct duk_internal_thread_state {
 	duk_ljstate lj;
 	duk_bool_t creating_error;
 	duk_hthread *curr_thread;
+	duk_uint8_t thread_state;
 	duk_int_t call_recursion_depth;
 };
 
@@ -16149,6 +16486,7 @@ DUK_EXTERNAL void duk_suspend(duk_hthread *thr, duk_thread_state *state) {
 	duk_memcpy((void *) &snapshot->lj, (const void *) lj, sizeof(duk_ljstate));
 	snapshot->creating_error = heap->creating_error;
 	snapshot->curr_thread = heap->curr_thread;
+	snapshot->thread_state = thr->state;
 	snapshot->call_recursion_depth = heap->call_recursion_depth;
 
 	lj->jmpbuf_ptr = NULL;
@@ -16158,6 +16496,8 @@ DUK_EXTERNAL void duk_suspend(duk_hthread *thr, duk_thread_state *state) {
 	heap->creating_error = 0;
 	heap->curr_thread = NULL;
 	heap->call_recursion_depth = 0;
+
+	thr->state = DUK_HTHREAD_STATE_INACTIVE;
 }
 
 DUK_EXTERNAL void duk_resume(duk_hthread *thr, const duk_thread_state *state) {
@@ -16174,6 +16514,8 @@ DUK_EXTERNAL void duk_resume(duk_hthread *thr, const duk_thread_state *state) {
 	DUK_ASSERT(thr->heap->pf_prevent_count == 0);
 	DUK_ASSERT(thr->heap->creating_error == 0);
 
+	thr->state = snapshot->thread_state;
+
 	heap = thr->heap;
 
 	duk_memcpy((void *) &heap->lj, (const void *) &snapshot->lj, sizeof(duk_ljstate));
@@ -18802,7 +19144,7 @@ DUK_EXTERNAL void duk_insert(duk_hthread *thr, duk_idx_t to_idx) {
 	 * => [ ... | q | p | x | x ]
 	 */
 
-	nbytes = (duk_size_t) (((duk_uint8_t *) q) - ((duk_uint8_t *) p));  /* Note: 'q' is top-1 */
+	nbytes = (duk_size_t) (((duk_uint8_t *) q) - ((duk_uint8_t *) p));
 
 	DUK_DDD(DUK_DDDPRINT("duk_insert: to_idx=%ld, p=%p, q=%p, nbytes=%lu",
 	                     (long) to_idx, (void *) p, (void *) q, (unsigned long) nbytes));
@@ -18838,6 +19180,40 @@ DUK_INTERNAL void duk_insert_undefined_n(duk_hthread *thr, duk_idx_t idx, duk_id
 	}
 }
 
+DUK_EXTERNAL void duk_pull(duk_hthread *thr, duk_idx_t from_idx) {
+	duk_tval *p;
+	duk_tval *q;
+	duk_tval tv_tmp;
+	duk_size_t nbytes;
+
+	DUK_ASSERT_API_ENTRY(thr);
+
+	/*                         nbytes
+	 *                       <--------->
+	 *    [ ... | x | x | p | y | y | q ]
+	 * => [ ... | x | x | y | y | q | p ]
+	 */
+
+	p = duk_require_tval(thr, from_idx);
+	DUK_ASSERT(p != NULL);
+	q = duk_require_tval(thr, -1);
+	DUK_ASSERT(q != NULL);
+
+	DUK_ASSERT(q >= p);
+
+	nbytes = (duk_size_t) (((duk_uint8_t *) q) - ((duk_uint8_t *) p));
+
+	DUK_DDD(DUK_DDDPRINT("duk_pull: from_idx=%ld, p=%p, q=%p, nbytes=%lu",
+	                     (long) from_idx, (void *) p, (void *) q, (unsigned long) nbytes));
+
+	/* No net refcount changes.  No need to special case nbytes == 0
+	 * (p == q).
+	 */
+	DUK_TVAL_SET_TVAL(&tv_tmp, p);
+	duk_memmove((void *) p, (const void *) (p + 1), (size_t) nbytes);
+	DUK_TVAL_SET_TVAL(q, &tv_tmp);
+}
+
 DUK_EXTERNAL void duk_replace(duk_hthread *thr, duk_idx_t to_idx) {
 	duk_tval *tv1;
 	duk_tval *tv2;
@@ -20634,7 +21010,7 @@ DUK_INTERNAL duk_uint8_t duk_to_uint8clamped(duk_hthread *thr, duk_idx_t idx) {
 	}
 
 	t = d - DUK_FLOOR(d);
-	if (t == 0.5) {
+	if (duk_double_equals(t, 0.5)) {
 		/* Exact halfway, round to even. */
 		ret = (duk_uint8_t) d;
 		ret = (ret + 1) & 0xfe;  /* Example: d=3.5, t=0.5 -> ret = (3 + 1) & 0xfe = 4 & 0xfe = 4
@@ -20782,134 +21158,6 @@ DUK_INTERNAL duk_hstring *duk_safe_to_hstring(duk_hthread *thr, duk_idx_t idx) {
 #endif
 
 /* Push Object.prototype.toString() output for 'tv'. */
-#if 0  /* See XXX note why this variant doesn't work. */
-DUK_INTERNAL void duk_push_class_string_tval(duk_hthread *thr, duk_tval *tv, duk_bool_t avoid_side_effects) {
-	duk_uint_t stridx_bidx = 0;  /* (prototype_bidx << 16) + default_tag_stridx */
-
-	DUK_ASSERT_API_ENTRY(thr);
-
-	/* Conceptually for any non-undefined/null value we should do a
-	 * ToObject() coercion and look up @@toStringTag (from the object
-	 * prototype) to see if a custom tag should be used.  Avoid the
-	 * actual conversion by doing a prototype lookup without the object
-	 * coercion.  However, see problem below.
-	 */
-
-	duk_push_literal(thr, "[object ");  /* -> [ ... "[object" ] */
-
-	switch (DUK_TVAL_GET_TAG(tv)) {
-	case DUK_TAG_UNUSED:  /* Treat like 'undefined', shouldn't happen. */
-	case DUK_TAG_UNDEFINED: {
-		stridx_bidx = DUK_STRIDX_UC_UNDEFINED;
-		goto use_stridx;
-	}
-	case DUK_TAG_NULL: {
-		stridx_bidx = DUK_STRIDX_UC_NULL;
-		goto use_stridx;
-	}
-	case DUK_TAG_BOOLEAN: {
-		stridx_bidx = (DUK_BIDX_BOOLEAN_PROTOTYPE << 16) + DUK_STRIDX_UC_BOOLEAN;
-		goto use_proto_bidx;
-	}
-	case DUK_TAG_POINTER: {
-		stridx_bidx = (DUK_BIDX_POINTER_PROTOTYPE << 16) + DUK_STRIDX_UC_POINTER;
-		goto use_proto_bidx;
-	}
-	case DUK_TAG_LIGHTFUNC: {
-		stridx_bidx = (DUK_BIDX_FUNCTION_PROTOTYPE << 16) + DUK_STRIDX_UC_FUNCTION;
-		goto use_proto_bidx;
-	}
-	case DUK_TAG_STRING: {
-		duk_hstring *h;
-		h = DUK_TVAL_GET_STRING(tv);
-		DUK_ASSERT(h != NULL);
-		if (DUK_UNLIKELY(DUK_HSTRING_HAS_SYMBOL(h))) {
-			/* Even without DUK_USE_SYMBOL_BUILTIN the Symbol
-			 * prototype exists so we can lookup @@toStringTag
-			 * and provide [object Symbol] for symbol values
-			 * created from C code.
-			 */
-			stridx_bidx = (DUK_BIDX_SYMBOL_PROTOTYPE << 16) + DUK_STRIDX_UC_SYMBOL;
-		} else {
-			stridx_bidx = (DUK_BIDX_STRING_PROTOTYPE << 16) + DUK_STRIDX_UC_STRING;
-		}
-		goto use_proto_bidx;
-	}
-	case DUK_TAG_OBJECT: {
-		duk_push_tval(thr, tv);
-		stridx_bidx = 0xffffffffUL;  /* Marker value. */
-		goto use_pushed_object;
-	}
-	case DUK_TAG_BUFFER: {
-		stridx_bidx = (DUK_BIDX_UINT8ARRAY_PROTOTYPE << 16) + DUK_STRIDX_UINT8_ARRAY;
-		goto use_proto_bidx;
-	}
-#if defined(DUK_USE_FASTINT)
-	case DUK_TAG_FASTINT:
-		/* Fall through to generic number case. */
-#endif
-	default: {
-		DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv));  /* number (maybe fastint) */
-		stridx_bidx = (DUK_BIDX_NUMBER_PROTOTYPE << 16) + DUK_STRIDX_UC_NUMBER;
-		goto use_proto_bidx;
-	}
-	}
-	DUK_ASSERT(0);  /* Never here. */
-
- use_proto_bidx:
-	DUK_ASSERT_BIDX_VALID((stridx_bidx >> 16) & 0xffffUL);
-	duk_push_hobject(thr, thr->builtins[(stridx_bidx >> 16) & 0xffffUL]);
-	/* Fall through. */
-
- use_pushed_object:
-	/* [ ... "[object" obj ] */
-
-#if defined(DUK_USE_SYMBOL_BUILTIN)
-	/* XXX: better handling with avoid_side_effects == 1; lookup tval
-	 * without Proxy or getter side effects, and use it in sanitized
-	 * form if it's a string.
-	 */
-	if (!avoid_side_effects) {
-		/* XXX: The problem with using the prototype object as the
-		 * lookup base is that if @@toStringTag is a getter, its
-		 * 'this' binding must be the ToObject() coerced input value,
-		 * not the prototype object of the type.
-		 */
-		(void) duk_get_prop_stridx(thr, -1, DUK_STRIDX_WELLKNOWN_SYMBOL_TO_STRING_TAG);
-		if (duk_is_string_notsymbol(thr, -1)) {
-			duk_remove_m2(thr);
-			goto finish;
-		}
-		duk_pop_unsafe(thr);
-	}
-#endif
-
-	if (stridx_bidx == 0xffffffffUL) {
-		duk_hobject *h_obj;
-		duk_small_uint_t classnum;
-
-		h_obj = duk_known_hobject(thr, -1);
-		DUK_ASSERT(h_obj != NULL);
-		classnum = DUK_HOBJECT_GET_CLASS_NUMBER(h_obj);
-		stridx_bidx = DUK_HOBJECT_CLASS_NUMBER_TO_STRIDX(classnum);
-	} else {
-		/* stridx_bidx already has the desired fallback stridx. */
-		;
-	}
-	duk_pop_unsafe(thr);
-	/* Fall through. */
-
- use_stridx:
-	/* [ ... "[object" ] */
-	duk_push_hstring_stridx(thr, stridx_bidx & 0xffffUL);
-
- finish:
-	/* [ ... "[object" tag ] */
-	duk_push_literal(thr, "]");
-	duk_concat(thr, 3);  /* [ ... "[object" tag "]" ] -> [ ... res ] */
-}
-#endif  /* 0 */
-
 DUK_INTERNAL void duk_push_class_string_tval(duk_hthread *thr, duk_tval *tv, duk_bool_t avoid_side_effects) {
 	duk_hobject *h_obj;
 	duk_small_uint_t classnum;
@@ -20925,11 +21173,13 @@ DUK_INTERNAL void duk_push_class_string_tval(duk_hthread *thr, duk_tval *tv, duk
 
 	/* Conceptually for any non-undefined/null value we should do a
 	 * ToObject() coercion and look up @@toStringTag (from the object
-	 * prototype) to see if a custom result should be used.  We'd like to
-	 * avoid the actual conversion, but even for primitive types the
-	 * prototype may have @@toStringTag.  What's worse, the @@toStringTag
-	 * property may be a getter that must get the object coerced value
-	 * (not the prototype) as its 'this' binding.
+	 * prototype) to see if a custom result should be used, with the
+	 * exception of Arrays which are handled specially first.
+	 *
+	 * We'd like to avoid the actual conversion, but even for primitive
+	 * types the prototype may have @@toStringTag.  What's worse, the
+	 * @@toStringTag property may be a getter that must get the object
+	 * coerced value (not the prototype) as its 'this' binding.
 	 *
 	 * For now, do an actual object coercion.  This could be avoided by
 	 * doing a side effect free lookup to see if a getter would be invoked.
@@ -20954,31 +21204,33 @@ DUK_INTERNAL void duk_push_class_string_tval(duk_hthread *thr, duk_tval *tv, duk
 
 	duk_push_tval(thr, tv);
 	tv = NULL;  /* Invalidated by ToObject(). */
-	duk_to_object(thr, -1);
-
-	/* [ ... "[object" obj ] */
+	h_obj = duk_to_hobject(thr, -1);
+	DUK_ASSERT(h_obj != NULL);
+	if (duk_js_isarray_hobject(h_obj)) {
+		stridx = DUK_STRIDX_UC_ARRAY;
+	} else {
+		/* [ ... "[object" obj ] */
 
 #if defined(DUK_USE_SYMBOL_BUILTIN)
-	/* XXX: better handling with avoid_side_effects == 1; lookup tval
-	 * without Proxy or getter side effects, and use it in sanitized
-	 * form if it's a string.
-	 */
-	if (!avoid_side_effects) {
-		(void) duk_get_prop_stridx(thr, -1, DUK_STRIDX_WELLKNOWN_SYMBOL_TO_STRING_TAG);
-		if (duk_is_string_notsymbol(thr, -1)) {
-			duk_remove_m2(thr);
-			goto finish;
+		/* XXX: better handling with avoid_side_effects == 1; lookup tval
+		 * without Proxy or getter side effects, and use it in sanitized
+		 * form if it's a string.
+		 */
+		if (!avoid_side_effects) {
+			(void) duk_get_prop_stridx(thr, -1, DUK_STRIDX_WELLKNOWN_SYMBOL_TO_STRING_TAG);
+			if (duk_is_string_notsymbol(thr, -1)) {
+				duk_remove_m2(thr);
+				goto finish;
+			}
+			duk_pop_unsafe(thr);
 		}
-		duk_pop_unsafe(thr);
-	}
 #else
-	DUK_UNREF(avoid_side_effects);
+		DUK_UNREF(avoid_side_effects);
 #endif
 
-	h_obj = duk_known_hobject(thr, -1);
-	DUK_ASSERT(h_obj != NULL);
-	classnum = DUK_HOBJECT_GET_CLASS_NUMBER(h_obj);
-	stridx = DUK_HOBJECT_CLASS_NUMBER_TO_STRIDX(classnum);
+		classnum = DUK_HOBJECT_GET_CLASS_NUMBER(h_obj);
+		stridx = DUK_HOBJECT_CLASS_NUMBER_TO_STRIDX(classnum);
+	}
 	duk_pop_unsafe(thr);
 	duk_push_hstring_stridx(thr, stridx);
 
@@ -21817,14 +22069,15 @@ DUK_EXTERNAL duk_bool_t duk_is_symbol(duk_hthread *thr, duk_idx_t idx) {
 	return 0;
 }
 
+/* IsArray(), returns true for Array instance or Proxy of Array instance. */
 DUK_EXTERNAL duk_bool_t duk_is_array(duk_hthread *thr, duk_idx_t idx) {
-	duk_hobject *obj;
+	duk_tval *tv;
 
 	DUK_ASSERT_API_ENTRY(thr);
 
-	obj = duk_get_hobject(thr, idx);
-	if (obj) {
-		return (DUK_HOBJECT_GET_CLASS_NUMBER(obj) == DUK_HOBJECT_CLASS_ARRAY ? 1 : 0);
+	tv = duk_get_tval(thr, idx);
+	if (tv) {
+		return duk_js_isarray(tv);
 	}
 	return 0;
 }
@@ -24032,6 +24285,13 @@ DUK_INTERNAL duk_idx_t duk_unpack_array_like(duk_hthread *thr, duk_idx_t idx) {
  *  Error throwing
  */
 
+#if defined(DUK_USE_GCC_PRAGMAS)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn"
+#elif defined(DUK_USE_CLANG_PRAGMAS)
+#pragma clang diagnostic push
+#endif
+
 DUK_EXTERNAL void duk_throw_raw(duk_hthread *thr) {
 	duk_tval *tv_val;
 
@@ -24121,6 +24381,12 @@ DUK_EXTERNAL void duk_error_raw(duk_hthread *thr, duk_errcode_t err_code, const
 	DUK_WO_NORETURN(return;);
 }
 
+#if defined(DUK_USE_GCC_PRAGMAS)
+#pragma GCC diagnostic pop
+#elif defined(DUK_USE_CLANG_PRAGMAS)
+#pragma clang diagnostic pop
+#endif
+
 #if !defined(DUK_USE_VARIADIC_MACROS)
 DUK_NORETURN(DUK_LOCAL_DECL void duk__throw_error_from_stash(duk_hthread *thr, duk_errcode_t err_code, const char *fmt, va_list ap));
 
@@ -25227,7 +25493,7 @@ DUK_INTERNAL duk_ret_t duk_bi_array_constructor(duk_hthread *thr) {
 		/* XXX: expensive check (also shared elsewhere - so add a shared internal API call?) */
 		d = duk_get_number(thr, 0);
 		len = duk_to_uint32(thr, 0);
-		if (((duk_double_t) len) != d) {
+		if (!duk_double_equals((duk_double_t) len, d)) {
 			DUK_DCERROR_RANGE_INVALID_LENGTH(thr);
 		}
 
@@ -25251,10 +25517,8 @@ DUK_INTERNAL duk_ret_t duk_bi_array_constructor(duk_hthread *thr) {
  */
 
 DUK_INTERNAL duk_ret_t duk_bi_array_constructor_is_array(duk_hthread *thr) {
-	duk_hobject *h;
-
-	h = duk_get_hobject_with_class(thr, 0, DUK_HOBJECT_CLASS_ARRAY);
-	duk_push_boolean(thr, (h != NULL));
+	DUK_ASSERT_TOP(thr, 1);
+	duk_push_boolean(thr, duk_js_isarray(DUK_GET_TVAL_POSIDX(thr, 0)));
 	return 1;
 }
 
@@ -25347,13 +25611,13 @@ DUK_INTERNAL duk_ret_t duk_bi_array_prototype_concat(duk_hthread *thr) {
 #if defined(DUK_USE_SYMBOL_BUILTIN)
 			duk_get_prop_stridx(thr, i, DUK_STRIDX_WELLKNOWN_SYMBOL_IS_CONCAT_SPREADABLE);
 			if (duk_is_undefined(thr, -1)) {
-				spreadable = (DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_ARRAY);
+				spreadable = duk_js_isarray_hobject(h);
 			} else {
 				spreadable = duk_to_boolean(thr, -1);
 			}
 			duk_pop_nodecref_unsafe(thr);
 #else
-			spreadable = (DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_ARRAY);
+			spreadable = duk_js_isarray_hobject(h);
 #endif
 		}
 
@@ -29061,12 +29325,12 @@ DUK_INTERNAL duk_ret_t duk_bi_nodejs_buffer_concat(duk_hthread *thr) {
 
 /* XXX: split into separate functions for each field type? */
 DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) {
-	duk_small_int_t magic = (duk_small_int_t) duk_get_current_magic(thr);
-	duk_small_int_t magic_ftype;
-	duk_small_int_t magic_bigendian;
-	duk_small_int_t magic_signed;
-	duk_small_int_t magic_typedarray;
-	duk_small_int_t endswap;
+	duk_small_uint_t magic = (duk_small_uint_t) duk_get_current_magic(thr);
+	duk_small_uint_t magic_ftype;
+	duk_small_uint_t magic_bigendian;
+	duk_small_uint_t magic_signed;
+	duk_small_uint_t magic_typedarray;
+	duk_small_uint_t endswap;
 	duk_hbufobj *h_this;
 	duk_bool_t no_assert;
 	duk_int_t offset_signed;
@@ -29076,10 +29340,10 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) {
 	duk_uint8_t *buf;
 	duk_double_union du;
 
-	magic_ftype = magic & 0x0007;
-	magic_bigendian = magic & 0x0008;
-	magic_signed = magic & 0x0010;
-	magic_typedarray = magic & 0x0020;
+	magic_ftype = magic & 0x0007U;
+	magic_bigendian = magic & 0x0008U;
+	magic_signed = magic & 0x0010U;
+	magic_typedarray = magic & 0x0020U;
 
 	h_this = duk__require_bufobj_this(thr);  /* XXX: very inefficient for plain buffers */
 	DUK_ASSERT(h_this != NULL);
@@ -29118,7 +29382,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) {
 
 	DUK_DDD(DUK_DDDPRINT("readfield, buffer_length=%ld, offset=%ld, no_assert=%d, "
 	                     "magic=%04x, magic_fieldtype=%d, magic_bigendian=%d, magic_signed=%d, "
-	                     "endswap=%d",
+	                     "endswap=%u",
 	                     (long) buffer_length, (long) offset, (int) no_assert,
 	                     (unsigned int) magic, (int) magic_ftype, (int) (magic_bigendian >> 3),
 	                     (int) (magic_signed >> 4), (int) endswap));
@@ -29320,12 +29584,12 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_readfield(duk_hthread *thr) {
 #if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
 /* XXX: split into separate functions for each field type? */
 DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) {
-	duk_small_int_t magic = (duk_small_int_t) duk_get_current_magic(thr);
-	duk_small_int_t magic_ftype;
-	duk_small_int_t magic_bigendian;
-	duk_small_int_t magic_signed;
-	duk_small_int_t magic_typedarray;
-	duk_small_int_t endswap;
+	duk_small_uint_t magic = (duk_small_uint_t) duk_get_current_magic(thr);
+	duk_small_uint_t magic_ftype;
+	duk_small_uint_t magic_bigendian;
+	duk_small_uint_t magic_signed;
+	duk_small_uint_t magic_typedarray;
+	duk_small_uint_t endswap;
 	duk_hbufobj *h_this;
 	duk_bool_t no_assert;
 	duk_int_t offset_signed;
@@ -29336,10 +29600,10 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) {
 	duk_double_union du;
 	duk_int_t nbytes = 0;
 
-	magic_ftype = magic & 0x0007;
-	magic_bigendian = magic & 0x0008;
-	magic_signed = magic & 0x0010;
-	magic_typedarray = magic & 0x0020;
+	magic_ftype = magic & 0x0007U;
+	magic_bigendian = magic & 0x0008U;
+	magic_signed = magic & 0x0010U;
+	magic_typedarray = magic & 0x0020U;
 	DUK_UNREF(magic_signed);
 
 	h_this = duk__require_bufobj_this(thr);  /* XXX: very inefficient for plain buffers */
@@ -29379,7 +29643,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) {
 	 * (offset + nbytes) even when write fails due to invalid offset.
 	 */
 	if (magic_ftype != DUK__FLD_VARINT) {
-		DUK_ASSERT(magic_ftype >= 0 && magic_ftype < (duk_small_int_t) (sizeof(duk__buffer_nbytes_from_fldtype) / sizeof(duk_uint8_t)));
+		DUK_ASSERT(magic_ftype < (duk_small_uint_t) (sizeof(duk__buffer_nbytes_from_fldtype) / sizeof(duk_uint8_t)));
 		nbytes = duk__buffer_nbytes_from_fldtype[magic_ftype];
 	} else {
 		nbytes = duk_get_int(thr, 2);
@@ -29396,7 +29660,7 @@ DUK_INTERNAL duk_ret_t duk_bi_buffer_writefield(duk_hthread *thr) {
 
 	DUK_DDD(DUK_DDDPRINT("writefield, value=%!T, buffer_length=%ld, offset=%ld, no_assert=%d, "
 	                     "magic=%04x, magic_fieldtype=%d, magic_bigendian=%d, magic_signed=%d, "
-	                     "endswap=%d",
+	                     "endswap=%u",
 	                     duk_get_tval(thr, 0), (long) buffer_length, (long) offset, (int) no_assert,
 	                     (unsigned int) magic, (int) magic_ftype, (int) (magic_bigendian >> 3),
 	                     (int) (magic_signed >> 4), (int) endswap));
@@ -29732,6 +29996,1746 @@ DUK_INTERNAL duk_ret_t duk_bi_typedarray_bytelength_getter(duk_hthread *thr) {
 #undef DUK__FLD_SIGNED
 #undef DUK__FLD_TYPEDARRAY
 #undef DUK__FLD_VARINT
+/*
+ *  CBOR bindings.
+ *
+ *  http://cbor.io/
+ *  https://tools.ietf.org/html/rfc7049
+ */
+
+/* #include duk_internal.h -> already included */
+
+#if defined(DUK_USE_CBOR_SUPPORT)
+
+/* #define DUK_CBOR_STRESS */
+
+/* Default behavior for encoding strings: use CBOR text string if string
+ * is UTF-8 compatible, otherwise use CBOR byte string.  These defines
+ * can be used to force either type for all strings.  Using text strings
+ * for non-UTF-8 data is technically invalid CBOR.
+ */
+/* #define DUK_CBOR_TEXT_STRINGS */
+/* #define DUK_CBOR_BYTE_STRINGS */
+
+/* Misc. defines. */
+/* #define DUK_CBOR_PREFER_SIZE */
+/* #define DUK_CBOR_DOUBLE_AS_IS */
+/* #define DUK_CBOR_DECODE_FASTPATH */
+
+typedef struct {
+	duk_hthread *thr;
+	duk_uint8_t *ptr;
+	duk_uint8_t *buf;
+	duk_uint8_t *buf_end;
+	duk_size_t len;
+	duk_idx_t idx_buf;
+	duk_uint_t recursion_depth;
+	duk_uint_t recursion_limit;
+} duk_cbor_encode_context;
+
+typedef struct {
+	duk_hthread *thr;
+	const duk_uint8_t *buf;
+	duk_size_t off;
+	duk_size_t len;
+	duk_uint_t recursion_depth;
+	duk_uint_t recursion_limit;
+} duk_cbor_decode_context;
+
+DUK_LOCAL void duk__cbor_encode_value(duk_cbor_encode_context *enc_ctx);
+DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx);
+
+/*
+ *  Misc
+ */
+
+DUK_LOCAL duk_uint32_t duk__cbor_double_to_uint32(double d) {
+	/* Out of range casts are undefined behavior, so caller must avoid. */
+	DUK_ASSERT(d >= 0.0 && d <= 4294967295.0);
+	return (duk_uint32_t) d;
+}
+
+/*
+ *  Encoding
+ */
+
+DUK_LOCAL void duk__cbor_encode_error(duk_cbor_encode_context *enc_ctx) {
+	(void) duk_type_error(enc_ctx->thr, "cbor encode error");
+}
+
+DUK_LOCAL void duk__cbor_encode_req_stack(duk_cbor_encode_context *enc_ctx) {
+	duk_require_stack(enc_ctx->thr, 4);
+}
+
+DUK_LOCAL void duk__cbor_encode_objarr_entry(duk_cbor_encode_context *enc_ctx) {
+	duk_hthread *thr = enc_ctx->thr;
+
+	/* Native stack check in object/array recursion. */
+	duk_native_stack_check(thr);
+
+	/* When working with deeply recursive structures, this is important
+	 * to ensure there's no effective depth limit.
+	 */
+	duk__cbor_encode_req_stack(enc_ctx);
+
+	DUK_ASSERT(enc_ctx->recursion_depth <= enc_ctx->recursion_limit);
+	if (enc_ctx->recursion_depth >= enc_ctx->recursion_limit) {
+		DUK_ERROR_RANGE(thr, DUK_STR_ENC_RECLIMIT);
+		DUK_WO_NORETURN(return;);
+	}
+	enc_ctx->recursion_depth++;
+}
+
+DUK_LOCAL void duk__cbor_encode_objarr_exit(duk_cbor_encode_context *enc_ctx) {
+	DUK_ASSERT(enc_ctx->recursion_depth > 0);
+	enc_ctx->recursion_depth--;
+}
+
+/* Check that a size_t is in uint32 range to avoid out-of-range casts. */
+DUK_LOCAL void duk__cbor_encode_sizet_uint32_check(duk_cbor_encode_context *enc_ctx, duk_size_t len) {
+	if (DUK_UNLIKELY(sizeof(duk_size_t) > sizeof(duk_uint32_t) && len > (duk_size_t) DUK_UINT32_MAX)) {
+		duk__cbor_encode_error(enc_ctx);
+	}
+}
+
+DUK_LOCAL DUK_NOINLINE void duk__cbor_encode_ensure_slowpath(duk_cbor_encode_context *enc_ctx, duk_size_t len) {
+	duk_size_t oldlen;
+	duk_size_t minlen;
+	duk_size_t newlen;
+	duk_uint8_t *p_new;
+	duk_size_t old_data_len;
+
+	DUK_ASSERT(enc_ctx->ptr >= enc_ctx->buf);
+	DUK_ASSERT(enc_ctx->buf_end >= enc_ctx->ptr);
+	DUK_ASSERT(enc_ctx->buf_end >= enc_ctx->buf);
+
+	/* Overflow check.
+	 *
+	 * Limit example: 0xffffffffUL / 2U = 0x7fffffffUL, we reject >= 0x80000000UL.
+	 */
+	oldlen = enc_ctx->len;
+	minlen = oldlen + len;
+	if (DUK_UNLIKELY(oldlen > DUK_SIZE_MAX / 2U || minlen < oldlen)) {
+		duk__cbor_encode_error(enc_ctx);
+	}
+
+#if defined(DUK_CBOR_STRESS)
+	newlen = oldlen + 1U;
+#else
+	newlen = oldlen * 2U;
+#endif
+	DUK_ASSERT(newlen >= oldlen);
+
+	if (minlen > newlen) {
+		newlen = minlen;
+	}
+	DUK_ASSERT(newlen >= oldlen);
+	DUK_ASSERT(newlen >= minlen);
+	DUK_ASSERT(newlen > 0U);
+
+	DUK_DD(DUK_DDPRINT("cbor encode buffer resized to %ld", (long) newlen));
+
+	p_new = (duk_uint8_t *) duk_resize_buffer(enc_ctx->thr, enc_ctx->idx_buf, newlen);
+	DUK_ASSERT(p_new != NULL);
+	old_data_len = (duk_size_t) (enc_ctx->ptr - enc_ctx->buf);
+	enc_ctx->buf = p_new;
+	enc_ctx->buf_end = p_new + newlen;
+	enc_ctx->ptr = p_new + old_data_len;
+	enc_ctx->len = newlen;
+}
+
+DUK_LOCAL DUK_INLINE void duk__cbor_encode_ensure(duk_cbor_encode_context *enc_ctx, duk_size_t len) {
+	if (DUK_LIKELY((duk_size_t) (enc_ctx->buf_end - enc_ctx->ptr) >= len)) {
+		return;
+	}
+	duk__cbor_encode_ensure_slowpath(enc_ctx, len);
+}
+
+DUK_LOCAL duk_size_t duk__cbor_get_reserve(duk_cbor_encode_context *enc_ctx) {
+	DUK_ASSERT(enc_ctx->ptr >= enc_ctx->buf);
+	DUK_ASSERT(enc_ctx->ptr <= enc_ctx->buf_end);
+	return (duk_size_t) (enc_ctx->buf_end - enc_ctx->ptr);
+}
+
+DUK_LOCAL void duk__cbor_encode_uint32(duk_cbor_encode_context *enc_ctx, duk_uint32_t u, duk_uint8_t base) {
+	duk_uint8_t *p;
+
+	/* Caller must ensure space. */
+	DUK_ASSERT(duk__cbor_get_reserve(enc_ctx) >= 1 + 4);
+
+	p = enc_ctx->ptr;
+	if (DUK_LIKELY(u <= 23U)) {
+		*p++ = (duk_uint8_t) (base + (duk_uint8_t) u);
+	} else if (u <= 0xffUL) {
+		*p++ = base + 0x18U;
+		*p++ = (duk_uint8_t) u;
+	} else if (u <= 0xffffUL) {
+		*p++ = base + 0x19U;
+		DUK_RAW_WRITEINC_U16_BE(p, (duk_uint16_t) u);
+	} else {
+		*p++ = base + 0x1aU;
+		DUK_RAW_WRITEINC_U32_BE(p, u);
+	}
+	enc_ctx->ptr = p;
+}
+
+#if defined(DUK_CBOR_DOUBLE_AS_IS)
+DUK_LOCAL void duk__cbor_encode_double(duk_cbor_encode_context *enc_ctx, double d) {
+	duk_uint8_t *p;
+
+	/* Caller must ensure space. */
+	DUK_ASSERT(duk__cbor_get_reserve(enc_ctx) >= 1 + 8);
+
+	p = enc_ctx->ptr;
+	*p++ = 0xfbU;
+	DUK_RAW_WRITEINC_DOUBLE_BE(p, d);
+	p += 8;
+	enc_ctx->ptr = p;
+}
+#else  /* DUK_CBOR_DOUBLE_AS_IS */
+DUK_LOCAL void duk__cbor_encode_double_fp(duk_cbor_encode_context *enc_ctx, double d) {
+	duk_double_union u;
+	duk_uint16_t u16;
+	duk_int16_t expt;
+	duk_uint8_t *p;
+
+	DUK_ASSERT(DUK_FPCLASSIFY(d) != DUK_FP_ZERO);
+
+	/* Caller must ensure space. */
+	DUK_ASSERT(duk__cbor_get_reserve(enc_ctx) >= 1 + 8);
+
+	/* Organize into little endian (no-op if platform is little endian). */
+	u.d = d;
+	duk_dblunion_host_to_little(&u);
+
+	/* Check if 'd' can represented as a normal half-float.
+	 * Denormal half-floats could also be used, but that check
+	 * isn't done now (denormal half-floats are decoded of course).
+	 * So just check exponent range and that at most 10 significant
+	 * bits (excluding implicit leading 1) are used in 'd'.
+	 */
+	u16 = (((duk_uint16_t) u.uc[7]) << 8) | ((duk_uint16_t) u.uc[6]);
+	expt = (duk_int16_t) ((u16 & 0x7ff0U) >> 4) - 1023;
+
+	if (expt >= -14 && expt <= 15) {
+		/* Half-float normal exponents (excl. denormals).
+		 *
+		 *          7        6        5        4        3        2        1        0  (LE index)
+		 * double: seeeeeee eeeemmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm
+		 * half:         seeeee mmmm mmmmmm00 00000000 00000000 00000000 00000000 00000000
+		 */
+		duk_bool_t use_half_float;
+
+		use_half_float =
+		    (u.uc[0] == 0 && u.uc[1] == 0 && u.uc[2] == 0 && u.uc[3] == 0 &&
+		     u.uc[4] == 0 && (u.uc[5] & 0x03U) == 0);
+
+		if (use_half_float) {
+			duk_uint32_t t;
+
+			expt += 15;
+			t = (duk_uint32_t) (u.uc[7] & 0x80U) << 8;
+			t += (duk_uint32_t) expt << 10;
+			t += ((duk_uint32_t) u.uc[6] & 0x0fU) << 6;
+			t += ((duk_uint32_t) u.uc[5]) >> 2;
+
+			/* seeeeemm mmmmmmmm */
+			p = enc_ctx->ptr;
+			*p++ = 0xf9U;
+			DUK_RAW_WRITEINC_U16_BE(p, (duk_uint16_t) t);
+			enc_ctx->ptr = p;
+			return;
+		}
+	}
+
+	/* Same check for plain float.  Also no denormal support here. */
+	if (expt >= -126 && expt <= 127) {
+		/* Float normal exponents (excl. denormals).
+		 *
+		 * double: seeeeeee eeeemmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm mmmmmmmm
+		 * float:     seeee eeeemmmm mmmmmmmm mmmmmmmm mmm00000 00000000 00000000 00000000
+		 */
+		duk_bool_t use_float;
+		duk_float_t d_float;
+
+		/* We could do this explicit mantissa check, but doing
+		 * a double-float-double cast is fine because we've
+		 * already verified that the exponent is in range so
+		 * that the narrower cast is not undefined behavior.
+		 */
+#if 0
+		use_float =
+		    (u.uc[0] == 0 && u.uc[1] == 0 && u.uc[2] == 0 && (u.uc[3] & 0xe0U) == 0);
+#endif
+		d_float = (duk_float_t) d;
+		use_float = duk_double_equals((duk_double_t) d_float, d);
+		if (use_float) {
+			p = enc_ctx->ptr;
+			*p++ = 0xfaU;
+			DUK_RAW_WRITEINC_FLOAT_BE(p, d_float);
+			enc_ctx->ptr = p;
+			return;
+		}
+	}
+
+	/* Special handling for NaN and Inf which we want to encode as
+	 * half-floats.  They share the same (maximum) exponent.
+	 */
+	if (expt == 1024) {
+		DUK_ASSERT(DUK_ISNAN(d) || DUK_ISINF(d));
+		p = enc_ctx->ptr;
+		*p++ = 0xf9U;
+		if (DUK_ISNAN(d)) {
+			/* Shortest NaN encoding is using a half-float.  Lose the
+			 * exact NaN bits in the process.  IEEE double would be
+			 * 7ff8 0000 0000 0000, i.e. a quiet NaN in most architectures
+			 * (https://en.wikipedia.org/wiki/NaN#Encoding).  The
+			 * equivalent half float is 7e00.
+			 */
+			*p++ = 0x7eU;
+		} else {
+			/* Shortest +/- Infinity encoding is using a half-float. */
+			if (DUK_SIGNBIT(d)) {
+				*p++ = 0xfcU;
+			} else {
+				*p++ = 0x7cU;
+			}
+		}
+		*p++ = 0x00U;
+		enc_ctx->ptr = p;
+		return;
+	}
+
+	/* Cannot use half-float or float, encode as full IEEE double. */
+	p = enc_ctx->ptr;
+	*p++ = 0xfbU;
+	DUK_RAW_WRITEINC_DOUBLE_BE(p, d);
+	enc_ctx->ptr = p;
+}
+
+DUK_LOCAL void duk__cbor_encode_double(duk_cbor_encode_context *enc_ctx, double d) {
+	duk_uint8_t *p;
+	double d_floor;
+
+	/* Integers and floating point values of all types are conceptually
+	 * equivalent in CBOR.  Try to always choose the shortest encoding
+	 * which is not always immediately obvious.  For example, NaN and Inf
+	 * can be most compactly represented as a half-float (assuming NaN
+	 * bits are not preserved), and 0x1'0000'0000 as a single precision
+	 * float.  Shortest forms in preference order (prefer integer over
+	 * float when equal length):
+	 *
+	 *   uint        1 byte    [0,23] (not -0)
+	 *   sint        1 byte    [-24,-1]
+	 *   uint+1      2 bytes   [24,255]
+	 *   sint+1      2 bytes   [-256,-25]
+	 *   uint+2      3 bytes   [256,65535]
+	 *   sint+2      3 bytes   [-65536,-257]
+	 *   half-float  3 bytes   -0, NaN, +/- Infinity, range [-65504,65504]
+	 *   uint+4      5 bytes   [65536,4294967295]
+	 *   sint+4      5 bytes   [-4294967296,-258]
+	 *   float       5 bytes   range [-(1 - 2^(-24)) * 2^128, (1 - 2^(-24)) * 2^128]
+	 *   uint+8      9 bytes   [4294967296,18446744073709551615]
+	 *   sint+8      9 bytes   [-18446744073709551616,-4294967297]
+	 *   double      9 bytes
+	 *
+	 * For whole numbers (compatible with integers):
+	 *   - 1-byte or 2-byte uint/sint representation is preferred for
+	 *     [-256,255].
+	 *   - 3-byte uint/sint is preferred for [-65536,65535].  Half floats
+	 *     are never preferred because they have the same length.
+	 *   - 5-byte uint/sint is preferred for [-4294967296,4294967295].
+	 *     Single precision floats are never preferred, and half-floats
+	 *     don't reach above the 3-byte uint/sint range so they're never
+	 *     preferred.
+	 *   - So, for all integers up to signed/unsigned 32-bit range the
+	 *     preferred encoding is always an integer uint/sint.
+	 *   - For integers above 32 bits the situation is more complicated.
+	 *     Half-floats are never useful for them because of their limited
+	 *     range, but IEEE single precision floats (5 bytes encoded) can
+	 *     represent some integers between the 32-bit and 64-bit ranges
+	 *     which require 9 bytes as a uint/sint.
+	 *
+	 * For floating point values not compatible with integers, the
+	 * preferred encoding is quite clear:
+	 *   - For +Inf/-Inf use half-float.
+	 *   - For NaN use a half-float, assuming NaN bits ("payload") is
+	 *     not worth preserving.  Duktape doesn't in general guarantee
+	 *     preservation of the NaN payload so using a half-float seems
+	 *     consistent with that.
+	 *   - For remaining values, prefer the shortest form which doesn't
+	 *     lose any precision.  For normal half-floats and single precision
+	 *     floats this is simple: just check exponent and mantissa bits
+	 *     using a fixed mask.  For denormal half-floats and single
+	 *     precision floats the check is a bit more complicated: a normal
+	 *     IEEE double can sometimes be represented as a denormal
+	 *     half-float or single precision float.
+	 *
+	 * https://en.wikipedia.org/wiki/Half-precision_floating-point_format#IEEE_754_half-precision_binary_floating-point_format:_binary16
+	 */
+
+	/* Caller must ensure space. */
+	DUK_ASSERT(duk__cbor_get_reserve(enc_ctx) >= 1 + 8);
+
+	/* Most important path is integers.  The floor() test will be true
+	 * for Inf too (but not NaN).
+	 */
+	d_floor = DUK_FLOOR(d);  /* identity if d is +/- 0.0, NaN, or +/- Infinity */
+	if (DUK_LIKELY(duk_double_equals(d_floor, d) != 0)) {
+		DUK_ASSERT(!DUK_ISNAN(d));  /* NaN == NaN compares false. */
+		if (DUK_SIGNBIT(d)) {
+			if (d >= -4294967296.0) {
+				d = -1.0 - d;
+				if (d >= 0.0) {
+					DUK_ASSERT(d >= 0.0);
+					duk__cbor_encode_uint32(enc_ctx, duk__cbor_double_to_uint32(d), 0x20U);
+					return;
+				}
+
+				/* Input was negative zero, d == -1.0 < 0.0.
+				 * Shortest -0 is using half-float.
+				 */
+				p = enc_ctx->ptr;
+				*p++ = 0xf9U;
+				*p++ = 0x80U;
+				*p++ = 0x00U;
+				enc_ctx->ptr = p;
+				return;
+			}
+		} else {
+			if (d <= 4294967295.0) {
+				/* Positive zero needs no special handling. */
+				DUK_ASSERT(d >= 0.0);
+				duk__cbor_encode_uint32(enc_ctx, duk__cbor_double_to_uint32(d), 0x00U);
+				return;
+			}
+		}
+	}
+
+	/* 64-bit integers are not supported at present.  So
+	 * we also don't need to deal with choosing between a
+	 * 64-bit uint/sint representation vs. IEEE double or
+	 * float.
+	 */
+
+	DUK_ASSERT(DUK_FPCLASSIFY(d) != DUK_FP_ZERO);
+	duk__cbor_encode_double_fp(enc_ctx, d);
+}
+#endif  /* DUK_CBOR_DOUBLE_AS_IS */
+
+DUK_LOCAL void duk__cbor_encode_string_top(duk_cbor_encode_context *enc_ctx) {
+	const duk_uint8_t *str;
+	duk_size_t len;
+	duk_uint8_t *p;
+
+	/* CBOR differentiates between UTF-8 text strings and byte strings.
+	 * Text strings MUST be valid UTF-8, so not all Duktape strings can
+	 * be encoded as valid CBOR text strings.  Possible behaviors:
+	 *
+	 *   1. Use text string when input is valid UTF-8, otherwise use
+	 *      byte string (maybe tagged to indicate it was an extended
+	 *      UTF-8 string).
+	 *   2. Always use text strings, but sanitize input string so that
+	 *      invalid UTF-8 is replaced with U+FFFD for example.  Combine
+	 *      surrogates whenever possible.
+	 *   3. Always use byte strings.  This is simple and produces valid
+	 *      CBOR, but isn't ideal for interoperability.
+	 *   4. Always use text strings, even for invalid UTF-8 such as
+	 *      codepoints in the surrogate pair range.  This is simple but
+	 *      produces technically invalid CBOR for non-UTF-8 strings which
+	 *      may affect interoperability.
+	 *
+	 * Current default is 1; can be changed with defines.
+	 */
+
+	/* Caller must ensure space. */
+	DUK_ASSERT(duk__cbor_get_reserve(enc_ctx) >= 1 + 8);
+
+	str = (const duk_uint8_t *) duk_require_lstring(enc_ctx->thr, -1, &len);
+	if (duk_is_symbol(enc_ctx->thr, -1)) {
+		/* Symbols, encode as an empty table for now.  This matches
+		 * the behavior of cbor-js.
+		 *
+		 * XXX: Maybe encode String() coercion with a tag?
+		 * XXX: Option to keep enough information to recover
+		 * Symbols when decoding (this is not always desirable).
+		 */
+		p = enc_ctx->ptr;
+		*p++ = 0xa0U;
+		enc_ctx->ptr = p;
+		return;
+	}
+
+	duk__cbor_encode_sizet_uint32_check(enc_ctx, len);
+#if defined(DUK_CBOR_TEXT_STRINGS)
+	duk__cbor_encode_uint32(enc_ctx, (duk_uint32_t) len, 0x60U);
+#elif defined(DUK_CBOR_BYTE_STRINGS)
+	duk__cbor_encode_uint32(enc_ctx, (duk_uint32_t) len, 0x40U);
+#else
+	duk__cbor_encode_uint32(enc_ctx, (duk_uint32_t) len,
+	                        (DUK_LIKELY(duk_unicode_is_utf8_compatible(str, len) != 0) ? 0x60U : 0x40U));
+#endif
+	duk__cbor_encode_ensure(enc_ctx, len);
+	p = enc_ctx->ptr;
+	duk_memcpy((void *) p, (const void *) str, len);
+	p += len;
+	enc_ctx->ptr = p;
+}
+
+DUK_LOCAL void duk__cbor_encode_object(duk_cbor_encode_context *enc_ctx) {
+	duk_uint8_t *buf;
+	duk_size_t len;
+	duk_uint8_t *p;
+	duk_size_t i;
+	duk_size_t off_ib;
+	duk_uint32_t count;
+
+	/* Caller must ensure space. */
+	DUK_ASSERT(duk__cbor_get_reserve(enc_ctx) >= 1 + 8);
+
+	duk__cbor_encode_objarr_entry(enc_ctx);
+
+	/* XXX: Support for specific built-ins like Date and RegExp. */
+	if (duk_is_array(enc_ctx->thr, -1)) {
+		/* Shortest encoding for arrays >= 256 in length is actually
+		 * the indefinite length one (3 or more bytes vs. 2 bytes).
+		 * We still use the definite length version because it is
+		 * more decoding friendly.
+		 */
+		len = duk_get_length(enc_ctx->thr, -1);
+		duk__cbor_encode_sizet_uint32_check(enc_ctx, len);
+		duk__cbor_encode_uint32(enc_ctx, (duk_uint32_t) len, 0x80U);
+		for (i = 0; i < len; i++) {
+			duk_get_prop_index(enc_ctx->thr, -1, (duk_uarridx_t) i);
+			duk__cbor_encode_value(enc_ctx);
+		}
+	} else if (duk_is_buffer_data(enc_ctx->thr, -1)) {
+		/* XXX: Tag buffer data?
+		 * XXX: Encode typed arrays as integer arrays rather
+		 * than buffer data as is?
+		 */
+		buf = (duk_uint8_t *) duk_require_buffer_data(enc_ctx->thr, -1, &len);
+		duk__cbor_encode_sizet_uint32_check(enc_ctx, len);
+		duk__cbor_encode_uint32(enc_ctx, (duk_uint32_t) len, 0x40U);
+		duk__cbor_encode_ensure(enc_ctx, len);
+		p = enc_ctx->ptr;
+		duk_memcpy_unsafe((void *) p, (const void *) buf, len);
+		p += len;
+		enc_ctx->ptr = p;
+	} else {
+		/* We don't know the number of properties in advance
+		 * but would still like to encode at least small
+		 * objects without indefinite length.  Emit an
+		 * indefinite length byte initially, and if the final
+		 * property count is small enough to also fit in one
+		 * byte, backpatch it later.  Otherwise keep the
+		 * indefinite length.  This works well up to 23
+		 * properties which is practical and good enough.
+		 */
+		off_ib = (duk_size_t) (enc_ctx->ptr - enc_ctx->buf);  /* XXX: get_offset? */
+		count = 0U;
+		p = enc_ctx->ptr;
+		*p++ = 0xa0U + 0x1fU;  /* indefinite length */
+		enc_ctx->ptr = p;
+		duk_enum(enc_ctx->thr, -1, DUK_ENUM_OWN_PROPERTIES_ONLY);
+		while (duk_next(enc_ctx->thr, -1, 1 /*get_value*/)) {
+			duk_insert(enc_ctx->thr, -2);  /* [ ... key value ] -> [ ... value key ] */
+			duk__cbor_encode_value(enc_ctx);
+			duk__cbor_encode_value(enc_ctx);
+			count++;
+			if (count == 0U) {
+				duk__cbor_encode_error(enc_ctx);
+			}
+		}
+		duk_pop(enc_ctx->thr);
+		if (count <= 0x17U) {
+			DUK_ASSERT(off_ib < enc_ctx->len);
+			enc_ctx->buf[off_ib] = 0xa0U + (duk_uint8_t) count;
+		} else {
+			duk__cbor_encode_ensure(enc_ctx, 1);
+			p = enc_ctx->ptr;
+			*p++ = 0xffU;  /* break */
+			enc_ctx->ptr = p;
+		}
+	}
+
+	duk__cbor_encode_objarr_exit(enc_ctx);
+}
+
+DUK_LOCAL void duk__cbor_encode_buffer(duk_cbor_encode_context *enc_ctx) {
+	duk_uint8_t *buf;
+	duk_size_t len;
+	duk_uint8_t *p;
+
+	/* Caller must ensure space. */
+	DUK_ASSERT(duk__cbor_get_reserve(enc_ctx) >= 1 + 8);
+
+	/* Tag buffer data? */
+	buf = (duk_uint8_t *) duk_require_buffer(enc_ctx->thr, -1, &len);
+	duk__cbor_encode_sizet_uint32_check(enc_ctx, len);
+	duk__cbor_encode_uint32(enc_ctx, (duk_uint32_t) len, 0x40U);
+	duk__cbor_encode_ensure(enc_ctx, len);
+	p = enc_ctx->ptr;
+	duk_memcpy_unsafe((void *) p, (const void *) buf, len);
+	p += len;
+	enc_ctx->ptr = p;
+}
+
+DUK_LOCAL void duk__cbor_encode_pointer(duk_cbor_encode_context *enc_ctx) {
+	/* Pointers (void *) are challenging to encode.  They can't
+	 * be relied to be even 64-bit integer compatible (there are
+	 * pointer models larger than that), nor can floats encode
+	 * them.  They could be encoded as strings (%p format) but
+	 * that's not portable.  They could be encoded as direct memory
+	 * representations.  Recovering pointers is non-portable in any
+	 * case but it would be nice to be able to detect and recover
+	 * compatible pointers.
+	 *
+	 * For now, encode as "(%p)" string, matching JX.  There doesn't
+	 * seem to be an appropriate tag, so pointers don't currently
+	 * survive a CBOR encode/decode roundtrip intact.
+	 */
+	const char *ptr;
+
+	ptr = duk_to_string(enc_ctx->thr, -1);
+	DUK_ASSERT(ptr != NULL);
+	duk_push_sprintf(enc_ctx->thr, "(%s)", ptr);
+	duk_remove(enc_ctx->thr, -2);
+	duk__cbor_encode_string_top(enc_ctx);
+}
+
+DUK_LOCAL void duk__cbor_encode_lightfunc(duk_cbor_encode_context *enc_ctx) {
+	duk_uint8_t *p;
+
+	/* Caller must ensure space. */
+	DUK_ASSERT(duk__cbor_get_reserve(enc_ctx) >= 1 + 8);
+
+	/* For now encode as an empty object. */
+	p = enc_ctx->ptr;
+	*p++ = 0xa0U;
+	enc_ctx->ptr = p;
+}
+
+DUK_LOCAL void duk__cbor_encode_value(duk_cbor_encode_context *enc_ctx) {
+	duk_uint8_t *p;
+
+	/* Encode/decode cycle currently loses some type information.
+	 * This can be improved by registering custom tags with IANA.
+	 */
+
+	/* Reserve space for up to 64-bit types (1 initial byte + 8
+	 * followup bytes).  This allows encoding of integers, floats,
+	 * string/buffer length fields, etc without separate checks
+	 * in each code path.
+	 */
+	duk__cbor_encode_ensure(enc_ctx, 1 + 8);
+
+	switch (duk_get_type(enc_ctx->thr, -1)) {
+	case DUK_TYPE_UNDEFINED: {
+		p = enc_ctx->ptr;
+		*p++ = 0xf7;
+		enc_ctx->ptr = p;
+		break;
+	}
+	case DUK_TYPE_NULL: {
+		p = enc_ctx->ptr;
+		*p++ = 0xf6;
+		enc_ctx->ptr = p;
+		break;
+	}
+	case DUK_TYPE_BOOLEAN: {
+		duk_uint8_t u8 = duk_get_boolean(enc_ctx->thr, -1) ? 0xf5U : 0xf4U;
+		p = enc_ctx->ptr;
+		*p++ = u8;
+		enc_ctx->ptr = p;
+		break;
+	}
+	case DUK_TYPE_NUMBER: {
+		duk__cbor_encode_double(enc_ctx, duk_get_number(enc_ctx->thr, -1));
+		break;
+	}
+	case DUK_TYPE_STRING: {
+		duk__cbor_encode_string_top(enc_ctx);
+		break;
+	}
+	case DUK_TYPE_OBJECT: {
+		duk__cbor_encode_object(enc_ctx);
+		break;
+	}
+	case DUK_TYPE_BUFFER: {
+		duk__cbor_encode_buffer(enc_ctx);
+		break;
+	}
+	case DUK_TYPE_POINTER: {
+		duk__cbor_encode_pointer(enc_ctx);
+		break;
+	}
+	case DUK_TYPE_LIGHTFUNC: {
+		duk__cbor_encode_lightfunc(enc_ctx);
+		break;
+	}
+	case DUK_TYPE_NONE:
+	default:
+		goto fail;
+	}
+
+	duk_pop(enc_ctx->thr);
+	return;
+
+ fail:
+	duk__cbor_encode_error(enc_ctx);
+}
+
+/*
+ *  Decoding
+ */
+
+DUK_LOCAL void duk__cbor_decode_error(duk_cbor_decode_context *dec_ctx) {
+	(void) duk_type_error(dec_ctx->thr, "cbor decode error");
+}
+
+DUK_LOCAL void duk__cbor_decode_req_stack(duk_cbor_decode_context *dec_ctx) {
+	duk_require_stack(dec_ctx->thr, 4);
+}
+
+DUK_LOCAL void duk__cbor_decode_objarr_entry(duk_cbor_decode_context *dec_ctx) {
+	duk_hthread *thr = dec_ctx->thr;
+
+	/* Native stack check in object/array recursion. */
+	duk_native_stack_check(thr);
+
+	duk__cbor_decode_req_stack(dec_ctx);
+
+	DUK_ASSERT(dec_ctx->recursion_depth <= dec_ctx->recursion_limit);
+	if (dec_ctx->recursion_depth >= dec_ctx->recursion_limit) {
+		DUK_ERROR_RANGE(thr, DUK_STR_DEC_RECLIMIT);
+		DUK_WO_NORETURN(return;);
+	}
+	dec_ctx->recursion_depth++;
+}
+
+DUK_LOCAL void duk__cbor_decode_objarr_exit(duk_cbor_decode_context *dec_ctx) {
+	DUK_ASSERT(dec_ctx->recursion_depth > 0);
+	dec_ctx->recursion_depth--;
+}
+
+DUK_LOCAL duk_uint8_t duk__cbor_decode_readbyte(duk_cbor_decode_context *dec_ctx) {
+	DUK_ASSERT(dec_ctx->off <= dec_ctx->len);
+	if (DUK_UNLIKELY(dec_ctx->len - dec_ctx->off < 1U)) {
+		duk__cbor_decode_error(dec_ctx);
+	}
+	return dec_ctx->buf[dec_ctx->off++];
+}
+
+DUK_LOCAL duk_uint16_t duk__cbor_decode_read_u16(duk_cbor_decode_context *dec_ctx) {
+	duk_uint16_t res;
+
+	DUK_ASSERT(dec_ctx->off <= dec_ctx->len);
+	if (DUK_UNLIKELY(dec_ctx->len - dec_ctx->off < 2U)) {
+		duk__cbor_decode_error(dec_ctx);
+	}
+	res = DUK_RAW_READ_U16_BE(dec_ctx->buf + dec_ctx->off);
+	dec_ctx->off += 2;
+	return res;
+}
+
+DUK_LOCAL duk_uint32_t duk__cbor_decode_read_u32(duk_cbor_decode_context *dec_ctx) {
+	duk_uint32_t res;
+
+	DUK_ASSERT(dec_ctx->off <= dec_ctx->len);
+	if (DUK_UNLIKELY(dec_ctx->len - dec_ctx->off < 4U)) {
+		duk__cbor_decode_error(dec_ctx);
+	}
+	res = DUK_RAW_READ_U32_BE(dec_ctx->buf + dec_ctx->off);
+	dec_ctx->off += 4;
+	return res;
+}
+
+DUK_LOCAL duk_uint8_t duk__cbor_decode_peekbyte(duk_cbor_decode_context *dec_ctx) {
+	if (DUK_UNLIKELY(dec_ctx->off >= dec_ctx->len)) {
+		duk__cbor_decode_error(dec_ctx);
+	}
+	return dec_ctx->buf[dec_ctx->off];
+}
+
+DUK_LOCAL void duk__cbor_decode_rewind(duk_cbor_decode_context *dec_ctx, duk_size_t len) {
+	DUK_ASSERT(len <= dec_ctx->off);  /* Caller must ensure. */
+	dec_ctx->off -= len;
+}
+
+#if 0
+DUK_LOCAL void duk__cbor_decode_ensure(duk_cbor_decode_context *dec_ctx, duk_size_t len) {
+	if (dec_ctx->off + len > dec_ctx->len) {
+		duk__cbor_decode_error(dec_ctx);
+	}
+}
+#endif
+
+DUK_LOCAL const duk_uint8_t *duk__cbor_decode_consume(duk_cbor_decode_context *dec_ctx, duk_size_t len) {
+	DUK_ASSERT(dec_ctx->off <= dec_ctx->len);
+	if (DUK_LIKELY(dec_ctx->len - dec_ctx->off >= len)) {
+		const duk_uint8_t *res = dec_ctx->buf + dec_ctx->off;
+		dec_ctx->off += len;
+		return res;
+	}
+
+	duk__cbor_decode_error(dec_ctx);  /* Not enough input. */
+	return NULL;
+}
+
+DUK_LOCAL int duk__cbor_decode_checkbreak(duk_cbor_decode_context *dec_ctx) {
+	if (duk__cbor_decode_peekbyte(dec_ctx) == 0xffU) {
+		DUK_ASSERT(dec_ctx->off < dec_ctx->len);
+		dec_ctx->off++;
+#if 0
+		(void) duk__cbor_decode_readbyte(dec_ctx);
+#endif
+		return 1;
+	}
+	return 0;
+}
+
+DUK_LOCAL void duk__cbor_decode_push_aival_int(duk_cbor_decode_context *dec_ctx, duk_uint8_t ib, duk_bool_t negative) {
+	duk_uint8_t ai;
+	duk_uint32_t t, t1, t2;
+#if 0
+	duk_uint64_t t3;
+#endif
+	duk_double_t d1, d2;
+	duk_double_t d;
+
+	ai = ib & 0x1fU;
+	if (ai <= 0x17U) {
+		t = ai;
+		goto shared_exit;
+	}
+
+	switch (ai) {
+	case 0x18U:  /* 1 byte */
+		t = (duk_uint32_t) duk__cbor_decode_readbyte(dec_ctx);
+		goto shared_exit;
+	case 0x19U:  /* 2 byte */
+		t = (duk_uint32_t) duk__cbor_decode_read_u16(dec_ctx);
+		goto shared_exit;
+	case 0x1aU:  /* 4 byte */
+		t = (duk_uint32_t) duk__cbor_decode_read_u32(dec_ctx);
+		goto shared_exit;
+	case 0x1bU:  /* 8 byte */
+		/* For uint64 it's important to handle the -1.0 part before
+		 * casting to double: otherwise the adjustment might be lost
+		 * in the cast.  Uses: -1.0 - d <=> -(d + 1.0).
+		 */
+		t = (duk_uint32_t) duk__cbor_decode_read_u32(dec_ctx);
+		t2 = t;
+		t = (duk_uint32_t) duk__cbor_decode_read_u32(dec_ctx);
+		t1 = t;
+#if 0
+		t3 = (duk_uint64_t) t2 * DUK_U64_CONSTANT(0x100000000) + (duk_uint64_t) t1;
+		if (negative) {
+			if (t3 == DUK_UINT64_MAX) {
+				/* -(0xffff'ffff'ffff'ffffULL + 1) =
+				 * -0x1'0000'0000'0000'0000
+				 *
+				 * >>> -0x10000000000000000
+				 * -18446744073709551616L
+				 */
+				return -18446744073709551616.0;
+			} else {
+				return -((duk_double_t) (t3 + DUK_U64_CONSTANT(1)));
+			}
+		} else {
+			return (duk_double_t) t3;  /* XXX: cast helper */
+		}
+#endif
+#if 0
+		t3 = (duk_uint64_t) t2 * DUK_U64_CONSTANT(0x100000000) + (duk_uint64_t) t1;
+		if (negative) {
+			/* Simpler version: take advantage of the fact that
+			 * 0xffff'ffff'ffff'ffff and 0x1'0000'0000'0000'0000
+			 * both round to 0x1'0000'0000'0000'0000:
+			 * > (0xffffffffffffffff).toString(16)
+			 * '10000000000000000'
+			 * > (0x10000000000000000).toString(16)
+			 * '10000000000000000'
+			 *
+			 * For the DUK_UINT64_MAX case we just skip the +1
+			 * increment to avoid wrapping; the result still
+			 * comes out right for an IEEE double cast.
+			 */
+			if (t3 != DUK_UINT64_MAX) {
+				t3++;
+			}
+			return -((duk_double_t) t3);
+		} else {
+			return (duk_double_t) t3;  /* XXX: cast helper */
+		}
+#endif
+#if 1
+		/* Use two double parts, avoids dependency on 64-bit type.
+		 * Avoid precision loss carefully, especially when dealing
+		 * with the required +1 for negative values.
+		 *
+		 * No fastint check for this path at present.
+		 */
+		d1 = (duk_double_t) t1;  /* XXX: cast helpers */
+		d2 = (duk_double_t) t2 * 4294967296.0;
+		if (negative) {
+			d1 += 1.0;
+		}
+		d = d2 + d1;
+		if (negative) {
+			d = -d;
+		}
+#endif
+		/* XXX: a push and check for fastint API would be nice */
+		duk_push_number(dec_ctx->thr, d);
+		return;
+	}
+
+	duk__cbor_decode_error(dec_ctx);
+	return;
+
+ shared_exit:
+	if (negative) {
+		/* XXX: a push and check for fastint API would be nice */
+		if ((duk_uint_t) t <= (duk_uint_t) -(DUK_INT_MIN + 1)) {
+			duk_push_int(dec_ctx->thr, -1 - ((duk_int_t) t));
+		} else {
+			duk_push_number(dec_ctx->thr, -1.0 - (duk_double_t) t);
+		}
+	} else {
+		duk_push_uint(dec_ctx->thr, (duk_uint_t) t);
+	}
+}
+
+DUK_LOCAL void duk__cbor_decode_skip_aival_int(duk_cbor_decode_context *dec_ctx, duk_uint8_t ib) {
+	const duk_int8_t skips[32] = {
+		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+		0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 8, -1, -1, -1, -1
+	};
+	duk_uint8_t ai;
+	duk_int8_t skip;
+
+	ai = ib & 0x1fU;
+	skip = skips[ai];
+	if (DUK_UNLIKELY(skip < 0)) {
+		duk__cbor_decode_error(dec_ctx);
+	}
+	duk__cbor_decode_consume(dec_ctx, (duk_size_t) skip);
+	return;
+}
+
+DUK_LOCAL duk_uint32_t duk__cbor_decode_aival_uint32(duk_cbor_decode_context *dec_ctx, duk_uint8_t ib) {
+	duk_uint8_t ai;
+	duk_uint32_t t;
+
+	ai = ib & 0x1fU;
+	if (ai <= 0x17U) {
+		return (duk_uint32_t) ai;
+	}
+
+	switch (ai) {
+	case 0x18U:  /* 1 byte */
+		t = (duk_uint32_t) duk__cbor_decode_readbyte(dec_ctx);
+		return t;
+	case 0x19U:  /* 2 byte */
+		t = (duk_uint32_t) duk__cbor_decode_read_u16(dec_ctx);
+		return t;
+	case 0x1aU:  /* 4 byte */
+		t = (duk_uint32_t) duk__cbor_decode_read_u32(dec_ctx);
+		return t;
+	case 0x1bU:  /* 8 byte */
+		t = (duk_uint32_t) duk__cbor_decode_read_u32(dec_ctx);
+		if (t != 0U) {
+			break;
+		}
+		t = (duk_uint32_t) duk__cbor_decode_read_u32(dec_ctx);
+		return t;
+	}
+
+	duk__cbor_decode_error(dec_ctx);
+	return 0U;
+}
+
+DUK_LOCAL void duk__cbor_decode_buffer(duk_cbor_decode_context *dec_ctx, duk_uint8_t expected_base) {
+	duk_uint32_t len;
+	duk_uint8_t *buf;
+	const duk_uint8_t *inp;
+	duk_uint8_t ib;
+
+	ib = duk__cbor_decode_readbyte(dec_ctx);
+	if ((ib & 0xe0U) != expected_base) {
+		duk__cbor_decode_error(dec_ctx);
+	}
+	/* Indefinite format is rejected by the following on purpose. */
+	len = duk__cbor_decode_aival_uint32(dec_ctx, ib);
+	inp = duk__cbor_decode_consume(dec_ctx, len);
+	/* XXX: duk_push_fixed_buffer_with_data() would be a nice API addition. */
+	buf = (duk_uint8_t *) duk_push_fixed_buffer(dec_ctx->thr, (duk_size_t) len);
+	duk_memcpy((void *) buf, (const void *) inp, (size_t) len);
+}
+
+DUK_LOCAL void duk__cbor_decode_join_buffers(duk_cbor_decode_context *dec_ctx, duk_idx_t count) {
+	duk_size_t total_size = 0;
+	duk_idx_t top = duk_get_top(dec_ctx->thr);
+	duk_idx_t base = top - count;  /* count is >= 1 */
+	duk_idx_t idx;
+	duk_uint8_t *p = NULL;
+
+	DUK_ASSERT(count >= 1);
+	DUK_ASSERT(top >= count);
+
+	for (;;) {
+		/* First round: compute total size.
+		 * Second round: copy into place.
+		 */
+		for (idx = base; idx < top; idx++) {
+			duk_uint8_t *buf_data;
+			duk_size_t buf_size;
+
+			buf_data = (duk_uint8_t *) duk_require_buffer(dec_ctx->thr, idx, &buf_size);
+			if (p != NULL) {
+				duk_memcpy_unsafe((void *) p, (const void *) buf_data, buf_size);
+				p += buf_size;
+			} else {
+				total_size += buf_size;
+				if (DUK_UNLIKELY(total_size < buf_size)) {  /* Wrap check. */
+					duk__cbor_decode_error(dec_ctx);
+				}
+			}
+		}
+
+		if (p != NULL) {
+			break;
+		} else {
+			p = (duk_uint8_t *) duk_push_fixed_buffer(dec_ctx->thr, total_size);
+			DUK_ASSERT(p != NULL);
+		}
+	}
+
+	duk_replace(dec_ctx->thr, base);
+	duk_pop_n(dec_ctx->thr, count - 1);
+}
+
+DUK_LOCAL void duk__cbor_decode_and_join_strbuf(duk_cbor_decode_context *dec_ctx, duk_uint8_t expected_base) {
+	duk_idx_t count = 0;
+	for (;;) {
+		if (duk__cbor_decode_checkbreak(dec_ctx)) {
+			break;
+		}
+		duk_require_stack(dec_ctx->thr, 1);
+		duk__cbor_decode_buffer(dec_ctx, expected_base);
+		count++;
+		if (DUK_UNLIKELY(count <= 0)) {  /* Wrap check. */
+			duk__cbor_decode_error(dec_ctx);
+		}
+	}
+	if (count == 0) {
+		(void) duk_push_fixed_buffer(dec_ctx->thr, 0);
+	} else if (count > 1) {
+		duk__cbor_decode_join_buffers(dec_ctx, count);
+	}
+}
+
+DUK_LOCAL duk_double_t duk__cbor_decode_half_float(duk_cbor_decode_context *dec_ctx) {
+	duk_double_union u;
+	const duk_uint8_t *inp;
+	duk_int_t expt;
+	duk_uint_t u16;
+	duk_uint_t tmp;
+	duk_double_t res;
+
+	inp = duk__cbor_decode_consume(dec_ctx, 2);
+	u16 = ((duk_uint_t) inp[0] << 8) + (duk_uint_t) inp[1];
+	expt = (duk_int_t) ((u16 >> 10) & 0x1fU) - 15;
+
+	/* Reconstruct IEEE double into little endian order first, then convert
+	 * to host order.
+	 */
+
+	duk_memzero((void *) &u, sizeof(u));
+
+	if (expt == -15) {
+		/* Zero or denormal; but note that half float
+		 * denormals become double normals.
+		 */
+		if ((u16 & 0x03ffU) == 0) {
+			u.uc[7] = inp[0] & 0x80U;
+		} else {
+			/* Create denormal by first creating a double that
+			 * contains the denormal bits and a leading implicit
+			 * 1-bit.  Then subtract away the implicit 1-bit.
+			 *
+			 *    0.mmmmmmmmmm * 2^-14
+			 *    1.mmmmmmmmmm 0.... * 2^-14
+			 *   -1.0000000000 0.... * 2^-14
+			 *
+			 * Double exponent: -14 + 1023 = 0x3f1
+			 */
+			u.uc[7] = 0x3fU;
+			u.uc[6] = 0x10U + (duk_uint8_t) ((u16 >> 6) & 0x0fU);
+			u.uc[5] = (duk_uint8_t) ((u16 << 2) & 0xffU);  /* Mask is really 0xfcU */
+
+			duk_dblunion_little_to_host(&u);
+			res = u.d - 0.00006103515625;  /* 2^(-14) */
+			if (u16 & 0x8000U) {
+				res = -res;
+			}
+			return res;
+		}
+	} else if (expt == 16) {
+		/* +/- Inf or NaN. */
+		if ((u16 & 0x03ffU) == 0) {
+			u.uc[7] = (inp[0] & 0x80U) + 0x7fU;
+			u.uc[6] = 0xf0U;
+		} else {
+			/* Create a 'quiet NaN' with highest
+			 * bit set (there are some platforms
+			 * where the NaN payload convention is
+			 * the opposite).  Keep sign.
+			 */
+			u.uc[7] = (inp[0] & 0x80U) + 0x7fU;
+			u.uc[6] = 0xf8U;
+		}
+	} else {
+		/* Normal. */
+		tmp = (inp[0] & 0x80U) ? 0x80000000UL : 0UL;
+		tmp += (duk_uint_t) (expt + 1023) << 20;
+		tmp += (duk_uint_t) (inp[0] & 0x03U) << 18;
+		tmp += (duk_uint_t) (inp[1] & 0xffU) << 10;
+		u.uc[7] = (tmp >> 24) & 0xffU;
+		u.uc[6] = (tmp >> 16) & 0xffU;
+		u.uc[5] = (tmp >> 8) & 0xffU;
+		u.uc[4] = (tmp >> 0) & 0xffU;
+	}
+
+	duk_dblunion_little_to_host(&u);
+	return u.d;
+}
+
+DUK_LOCAL void duk__cbor_decode_string(duk_cbor_decode_context *dec_ctx, duk_uint8_t ib, duk_uint8_t ai) {
+	/* If the CBOR string data is not valid UTF-8 it is technically
+	 * invalid CBOR.  Possible behaviors at least:
+	 *
+	 *   1. Reject the input, i.e. throw TypeError.
+	 *
+	 *   2. Accept the input, but sanitize non-UTF-8 data into UTF-8
+	 *      using U+FFFD replacements.  Also it might make sense to
+	 *      decode non-BMP codepoints into surrogates for better
+	 *      ECMAScript compatibility.
+	 *
+	 *   3. Accept the input as a Duktape string (which are not always
+	 *      valid UTF-8), but reject any input that would create a
+	 *      Symbol representation.
+	 *
+	 * Current behavior is 3.
+	 */
+
+	if (ai == 0x1fU) {
+		duk_uint8_t *buf_data;
+		duk_size_t buf_size;
+
+		duk__cbor_decode_and_join_strbuf(dec_ctx, 0x60U);
+		buf_data = (duk_uint8_t *) duk_require_buffer(dec_ctx->thr, -1, &buf_size);
+		(void) duk_push_lstring(dec_ctx->thr, (const char *) buf_data, buf_size);
+		duk_remove(dec_ctx->thr, -2);
+	} else {
+		duk_uint32_t len;
+		const duk_uint8_t *inp;
+
+		len = duk__cbor_decode_aival_uint32(dec_ctx, ib);
+		inp = duk__cbor_decode_consume(dec_ctx, len);
+		(void) duk_push_lstring(dec_ctx->thr, (const char *) inp, (duk_size_t) len);
+	}
+	if (duk_is_symbol(dec_ctx->thr, -1)) {
+		/* Refuse to create Symbols when decoding. */
+		duk__cbor_decode_error(dec_ctx);
+	}
+
+	/* XXX: Here a Duktape API call to convert input -> utf-8 with
+	 * replacements would be nice.
+	 */
+}
+
+DUK_LOCAL duk_bool_t duk__cbor_decode_array(duk_cbor_decode_context *dec_ctx, duk_uint8_t ib, duk_uint8_t ai) {
+	duk_uint32_t idx, len;
+
+	duk__cbor_decode_objarr_entry(dec_ctx);
+
+	/* Support arrays up to 0xfffffffeU in length.  0xffffffff is
+	 * used as an indefinite length marker.
+	 */
+	if (ai == 0x1fU) {
+		len = 0xffffffffUL;
+	} else {
+		len = duk__cbor_decode_aival_uint32(dec_ctx, ib);
+		if (len == 0xffffffffUL) {
+			goto failure;
+		}
+	}
+
+	/* XXX: use bare array? */
+	duk_push_array(dec_ctx->thr);
+	for (idx = 0U; ;) {
+		if (len == 0xffffffffUL && duk__cbor_decode_checkbreak(dec_ctx)) {
+			break;
+		}
+		if (idx == len) {
+			if (ai == 0x1fU) {
+				goto failure;
+			}
+			break;
+		}
+		duk__cbor_decode_value(dec_ctx);
+		duk_put_prop_index(dec_ctx->thr, -2, (duk_uarridx_t) idx);
+		idx++;
+		if (idx == 0U) {
+			goto failure;  /* wrapped */
+		}
+	}
+
+#if 0
+ success:
+#endif
+	duk__cbor_decode_objarr_exit(dec_ctx);
+	return 1;
+
+ failure:
+	/* No need to unwind recursion checks, caller will throw. */
+	return 0;
+}
+
+DUK_LOCAL duk_bool_t duk__cbor_decode_map(duk_cbor_decode_context *dec_ctx, duk_uint8_t ib, duk_uint8_t ai) {
+	duk_uint32_t count;
+
+	duk__cbor_decode_objarr_entry(dec_ctx);
+
+	if (ai == 0x1fU) {
+		count = 0xffffffffUL;
+	} else {
+		count = duk__cbor_decode_aival_uint32(dec_ctx, ib);
+		if (count == 0xffffffffUL) {
+			goto failure;
+		}
+	}
+
+	/* XXX: use bare object? */
+	duk_push_object(dec_ctx->thr);
+	for (;;) {
+		if (count == 0xffffffffUL) {
+			if (duk__cbor_decode_checkbreak(dec_ctx)) {
+				break;
+			}
+		} else {
+			if (count == 0UL) {
+				break;
+			}
+			count--;
+		}
+
+		/* Non-string keys are coerced to strings,
+		 * possibly leading to overwriting previous
+		 * keys.  Last key of a certain coerced name
+		 * wins.  If key is an object, it will coerce
+		 * to '[object Object]' which is consistent
+		 * but potentially misleading.  One alternative
+		 * would be to skip non-string keys.
+		 */
+		duk__cbor_decode_value(dec_ctx);
+		duk__cbor_decode_value(dec_ctx);
+		duk_put_prop(dec_ctx->thr, -3);
+	}
+
+#if 0
+ success:
+#endif
+	duk__cbor_decode_objarr_exit(dec_ctx);
+	return 1;
+
+ failure:
+	/* No need to unwind recursion checks, caller will throw. */
+	return 0;
+}
+
+DUK_LOCAL duk_double_t duk__cbor_decode_float(duk_cbor_decode_context *dec_ctx) {
+	duk_float_union u;
+	const duk_uint8_t *inp;
+	inp = duk__cbor_decode_consume(dec_ctx, 4);
+	duk_memcpy((void *) u.uc, (const void *) inp, 4);
+	duk_fltunion_big_to_host(&u);
+	return (duk_double_t) u.f;
+}
+
+DUK_LOCAL duk_double_t duk__cbor_decode_double(duk_cbor_decode_context *dec_ctx) {
+	duk_double_union u;
+	const duk_uint8_t *inp;
+	inp = duk__cbor_decode_consume(dec_ctx, 8);
+	duk_memcpy((void *) u.uc, (const void *) inp, 8);
+	duk_dblunion_big_to_host(&u);
+	return u.d;
+}
+
+#if defined(DUK_CBOR_DECODE_FASTPATH)
+#define DUK__CBOR_AI  (ib & 0x1fU)
+
+DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) {
+	duk_uint8_t ib;
+
+	/* Any paths potentially recursing back to duk__cbor_decode_value()
+	 * must perform a Duktape value stack growth check.  Avoid the check
+	 * here for simple paths like primitive values.
+	 */
+
+ reread_initial_byte:
+	DUK_DDD(DUK_DDDPRINT("cbor decode off=%ld len=%ld", (long) dec_ctx->off, (long) dec_ctx->len));
+
+	ib = duk__cbor_decode_readbyte(dec_ctx);
+
+	/* Full initial byte switch, footprint cost over baseline is ~+1kB. */
+	/* XXX: Force full switch with no range check. */
+
+	switch (ib) {
+	case 0x00U: case 0x01U: case 0x02U: case 0x03U: case 0x04U: case 0x05U: case 0x06U: case 0x07U:
+	case 0x08U: case 0x09U: case 0x0aU: case 0x0bU: case 0x0cU: case 0x0dU: case 0x0eU: case 0x0fU:
+	case 0x10U: case 0x11U: case 0x12U: case 0x13U: case 0x14U: case 0x15U: case 0x16U: case 0x17U:
+		duk_push_uint(dec_ctx->thr, ib);
+		break;
+	case 0x18U: case 0x19U: case 0x1aU: case 0x1bU:
+		duk__cbor_decode_push_aival_int(dec_ctx, ib, 0 /*negative*/);
+		break;
+	case 0x1cU: case 0x1dU: case 0x1eU: case 0x1fU:
+		goto format_error;
+	case 0x20U: case 0x21U: case 0x22U: case 0x23U: case 0x24U: case 0x25U: case 0x26U: case 0x27U:
+	case 0x28U: case 0x29U: case 0x2aU: case 0x2bU: case 0x2cU: case 0x2dU: case 0x2eU: case 0x2fU:
+	case 0x30U: case 0x31U: case 0x32U: case 0x33U: case 0x34U: case 0x35U: case 0x36U: case 0x37U:
+		duk_push_int(dec_ctx->thr, -((duk_int_t) ((ib - 0x20U) + 1U)));
+		break;
+	case 0x38U: case 0x39U: case 0x3aU: case 0x3bU:
+		duk__cbor_decode_push_aival_int(dec_ctx, ib, 1 /*negative*/);
+		break;
+	case 0x3cU: case 0x3dU: case 0x3eU: case 0x3fU:
+		goto format_error;
+	case 0x40U: case 0x41U: case 0x42U: case 0x43U: case 0x44U: case 0x45U: case 0x46U: case 0x47U:
+	case 0x48U: case 0x49U: case 0x4aU: case 0x4bU: case 0x4cU: case 0x4dU: case 0x4eU: case 0x4fU:
+	case 0x50U: case 0x51U: case 0x52U: case 0x53U: case 0x54U: case 0x55U: case 0x56U: case 0x57U:
+		/* XXX: Avoid rewind, we know the length already. */
+		DUK_ASSERT(dec_ctx->off > 0U);
+		dec_ctx->off--;
+		duk__cbor_decode_buffer(dec_ctx, 0x40U);
+		break;
+	case 0x58U: case 0x59U: case 0x5aU: case 0x5bU:
+		/* XXX: Avoid rewind, decode length inline. */
+		DUK_ASSERT(dec_ctx->off > 0U);
+		dec_ctx->off--;
+		duk__cbor_decode_buffer(dec_ctx, 0x40U);
+		break;
+	case 0x5cU: case 0x5dU: case 0x5eU:
+		goto format_error;
+	case 0x5fU:
+		duk__cbor_decode_and_join_strbuf(dec_ctx, 0x40U);
+		break;
+	case 0x60U: case 0x61U: case 0x62U: case 0x63U: case 0x64U: case 0x65U: case 0x66U: case 0x67U:
+	case 0x68U: case 0x69U: case 0x6aU: case 0x6bU: case 0x6cU: case 0x6dU: case 0x6eU: case 0x6fU:
+	case 0x70U: case 0x71U: case 0x72U: case 0x73U: case 0x74U: case 0x75U: case 0x76U: case 0x77U:
+		/* XXX: Avoid double decode of length. */
+		duk__cbor_decode_string(dec_ctx, ib, DUK__CBOR_AI);
+		break;
+	case 0x78U: case 0x79U: case 0x7aU: case 0x7bU:
+		/* XXX: Avoid double decode of length. */
+		duk__cbor_decode_string(dec_ctx, ib, DUK__CBOR_AI);
+		break;
+	case 0x7cU: case 0x7dU: case 0x7eU:
+		goto format_error;
+	case 0x7fU:
+		duk__cbor_decode_string(dec_ctx, ib, DUK__CBOR_AI);
+		break;
+	case 0x80U: case 0x81U: case 0x82U: case 0x83U: case 0x84U: case 0x85U: case 0x86U: case 0x87U:
+	case 0x88U: case 0x89U: case 0x8aU: case 0x8bU: case 0x8cU: case 0x8dU: case 0x8eU: case 0x8fU:
+	case 0x90U: case 0x91U: case 0x92U: case 0x93U: case 0x94U: case 0x95U: case 0x96U: case 0x97U:
+		if (DUK_UNLIKELY(duk__cbor_decode_array(dec_ctx, ib, DUK__CBOR_AI) == 0)) {
+			goto format_error;
+		}
+		break;
+	case 0x98U: case 0x99U: case 0x9aU: case 0x9bU:
+		if (DUK_UNLIKELY(duk__cbor_decode_array(dec_ctx, ib, DUK__CBOR_AI) == 0)) {
+			goto format_error;
+		}
+		break;
+	case 0x9cU: case 0x9dU: case 0x9eU:
+		goto format_error;
+	case 0x9fU:
+		if (DUK_UNLIKELY(duk__cbor_decode_array(dec_ctx, ib, DUK__CBOR_AI) == 0)) {
+			goto format_error;
+		}
+		break;
+	case 0xa0U: case 0xa1U: case 0xa2U: case 0xa3U: case 0xa4U: case 0xa5U: case 0xa6U: case 0xa7U:
+	case 0xa8U: case 0xa9U: case 0xaaU: case 0xabU: case 0xacU: case 0xadU: case 0xaeU: case 0xafU:
+	case 0xb0U: case 0xb1U: case 0xb2U: case 0xb3U: case 0xb4U: case 0xb5U: case 0xb6U: case 0xb7U:
+		if (DUK_UNLIKELY(duk__cbor_decode_map(dec_ctx, ib, DUK__CBOR_AI) == 0)) {
+			goto format_error;
+		}
+		break;
+	case 0xb8U: case 0xb9U: case 0xbaU: case 0xbbU:
+		if (DUK_UNLIKELY(duk__cbor_decode_map(dec_ctx, ib, DUK__CBOR_AI) == 0)) {
+			goto format_error;
+		}
+		break;
+	case 0xbcU: case 0xbdU: case 0xbeU:
+		goto format_error;
+	case 0xbfU:
+		if (DUK_UNLIKELY(duk__cbor_decode_map(dec_ctx, ib, DUK__CBOR_AI) == 0)) {
+			goto format_error;
+		}
+		break;
+	case 0xc0U: case 0xc1U: case 0xc2U: case 0xc3U: case 0xc4U: case 0xc5U: case 0xc6U: case 0xc7U:
+	case 0xc8U: case 0xc9U: case 0xcaU: case 0xcbU: case 0xccU: case 0xcdU: case 0xceU: case 0xcfU:
+	case 0xd0U: case 0xd1U: case 0xd2U: case 0xd3U: case 0xd4U: case 0xd5U: case 0xd6U: case 0xd7U:
+		/* Tag 0-23: drop. */
+		goto reread_initial_byte;
+	case 0xd8U: case 0xd9U: case 0xdaU: case 0xdbU:
+		duk__cbor_decode_skip_aival_int(dec_ctx, ib);
+		goto reread_initial_byte;
+	case 0xdcU: case 0xddU: case 0xdeU: case 0xdfU:
+		goto format_error;
+	case 0xe0U:
+		goto format_error;
+	case 0xe1U:
+		goto format_error;
+	case 0xe2U:
+		goto format_error;
+	case 0xe3U:
+		goto format_error;
+	case 0xe4U:
+		goto format_error;
+	case 0xe5U:
+		goto format_error;
+	case 0xe6U:
+		goto format_error;
+	case 0xe7U:
+		goto format_error;
+	case 0xe8U:
+		goto format_error;
+	case 0xe9U:
+		goto format_error;
+	case 0xeaU:
+		goto format_error;
+	case 0xebU:
+		goto format_error;
+	case 0xecU:
+		goto format_error;
+	case 0xedU:
+		goto format_error;
+	case 0xeeU:
+		goto format_error;
+	case 0xefU:
+		goto format_error;
+	case 0xf0U:
+		goto format_error;
+	case 0xf1U:
+		goto format_error;
+	case 0xf2U:
+		goto format_error;
+	case 0xf3U:
+		goto format_error;
+	case 0xf4U:
+		duk_push_false(dec_ctx->thr);
+		break;
+	case 0xf5U:
+		duk_push_true(dec_ctx->thr);
+		break;
+	case 0xf6U:
+		duk_push_null(dec_ctx->thr);
+		break;
+	case 0xf7U:
+		duk_push_undefined(dec_ctx->thr);
+		break;
+	case 0xf8U:
+		/* Simple value 32-255, nothing defined yet, so reject. */
+		goto format_error;
+	case 0xf9U: {
+		duk_double_t d;
+		d = duk__cbor_decode_half_float(dec_ctx);
+		duk_push_number(dec_ctx->thr, d);
+		break;
+	}
+	case 0xfaU: {
+		duk_double_t d;
+		d = duk__cbor_decode_float(dec_ctx);
+		duk_push_number(dec_ctx->thr, d);
+		break;
+	}
+	case 0xfbU: {
+		duk_double_t d;
+		d = duk__cbor_decode_double(dec_ctx);
+		duk_push_number(dec_ctx->thr, d);
+		break;
+	}
+	case 0xfcU:
+	case 0xfdU:
+	case 0xfeU:
+	case 0xffU:
+		goto format_error;
+	}  /* end switch */
+
+	return;
+
+ format_error:
+	duk__cbor_decode_error(dec_ctx);
+}
+#else  /* DUK_CBOR_DECODE_FASTPATH */
+DUK_LOCAL void duk__cbor_decode_value(duk_cbor_decode_context *dec_ctx) {
+	duk_uint8_t ib, mt, ai;
+
+	/* Any paths potentially recursing back to duk__cbor_decode_value()
+	 * must perform a Duktape value stack growth check.  Avoid the check
+	 * here for simple paths like primitive values.
+	 */
+
+ reread_initial_byte:
+	DUK_DDD(DUK_DDDPRINT("cbor decode off=%ld len=%ld", (long) dec_ctx->off, (long) dec_ctx->len));
+
+	ib = duk__cbor_decode_readbyte(dec_ctx);
+	mt = ib >> 5U;
+	ai = ib & 0x1fU;
+
+	/* Additional information in [24,27] = [0x18,0x1b] has relatively
+	 * uniform handling for all major types: read 1/2/4/8 additional
+	 * bytes.  For major type 7 the 1-byte value is a 'simple type', and
+	 * 2/4/8-byte values are floats.  For other major types the 1/2/4/8
+	 * byte values are integers.  The lengths are uniform, but the typing
+	 * is not.
+	 */
+
+	switch (mt) {
+	case 0U: {  /* unsigned integer */
+		duk__cbor_decode_push_aival_int(dec_ctx, ib, 0 /*negative*/);
+		break;
+	}
+	case 1U: {  /* negative integer */
+		duk__cbor_decode_push_aival_int(dec_ctx, ib, 1 /*negative*/);
+		break;
+	}
+	case 2U: {  /* byte string */
+		if (ai == 0x1fU) {
+			duk__cbor_decode_and_join_strbuf(dec_ctx, 0x40U);
+		} else {
+			duk__cbor_decode_rewind(dec_ctx, 1U);
+			duk__cbor_decode_buffer(dec_ctx, 0x40U);
+		}
+		break;
+	}
+	case 3U: {  /* text string */
+		duk__cbor_decode_string(dec_ctx, ib, ai);
+		break;
+	}
+	case 4U: {  /* array of data items */
+		if (DUK_UNLIKELY(duk__cbor_decode_array(dec_ctx, ib, ai) == 0)) {
+			goto format_error;
+		}
+		break;
+	}
+	case 5U: {  /* map of pairs of data items */
+		if (DUK_UNLIKELY(duk__cbor_decode_map(dec_ctx, ib, ai) == 0)) {
+			goto format_error;
+		}
+		break;
+	}
+	case 6U: {  /* semantic tagging */
+		/* Tags are ignored now, re-read initial byte.  A tagged
+		 * value may itself be tagged (an unlimited number of times)
+		 * so keep on peeling away tags.
+		 */
+		duk__cbor_decode_skip_aival_int(dec_ctx, ib);
+		goto reread_initial_byte;
+	}
+	case 7U: {  /* floating point numbers, simple data types, break; other */
+		switch (ai) {
+		case 0x14U: {
+			duk_push_false(dec_ctx->thr);
+			break;
+		}
+		case 0x15U: {
+			duk_push_true(dec_ctx->thr);
+			break;
+		}
+		case 0x16U: {
+			duk_push_null(dec_ctx->thr);
+			break;
+		}
+		case 0x17U: {
+			duk_push_undefined(dec_ctx->thr);
+			break;
+		}
+		case 0x18U: {  /* more simple values (1 byte) */
+			/* Simple value encoded in additional byte (none
+			 * are defined so far).  RFC 7049 states that the
+			 * follow-up byte must be 32-255 to minimize
+			 * confusion.  So, a non-shortest encoding like
+			 * f815 (= true, shortest encoding f5) must be
+			 * rejected.  cbor.me tester rejects f815, but
+			 * e.g. Python CBOR binding decodes it as true.
+			 */
+			goto format_error;
+		}
+		case 0x19U: {  /* half-float (2 bytes) */
+			duk_double_t d;
+			d = duk__cbor_decode_half_float(dec_ctx);
+			duk_push_number(dec_ctx->thr, d);
+			break;
+		}
+		case 0x1aU: {  /* float (4 bytes) */
+			duk_double_t d;
+			d = duk__cbor_decode_float(dec_ctx);
+			duk_push_number(dec_ctx->thr, d);
+			break;
+		}
+		case 0x1bU: {  /* double (8 bytes) */
+			duk_double_t d;
+			d = duk__cbor_decode_double(dec_ctx);
+			duk_push_number(dec_ctx->thr, d);
+			break;
+		}
+		case 0xffU:  /* unexpected break */
+		default: {
+			goto format_error;
+		}
+		}  /* end switch */
+		break;
+	}
+	default: {
+		goto format_error;  /* will never actually occur */
+	}
+	}  /* end switch */
+
+	return;
+
+ format_error:
+	duk__cbor_decode_error(dec_ctx);
+}
+#endif  /* DUK_CBOR_DECODE_FASTPATH */
+
+DUK_LOCAL void duk__cbor_encode(duk_hthread *thr, duk_idx_t idx, duk_uint_t encode_flags) {
+	duk_cbor_encode_context enc_ctx;
+	duk_uint8_t *buf;
+
+	DUK_UNREF(encode_flags);
+
+	idx = duk_require_normalize_index(thr, idx);
+
+	enc_ctx.thr = thr;
+	enc_ctx.idx_buf = duk_get_top(thr);
+
+	enc_ctx.len = 64;
+	buf = (duk_uint8_t *) duk_push_dynamic_buffer(thr, enc_ctx.len);
+	enc_ctx.ptr = buf;
+	enc_ctx.buf = buf;
+	enc_ctx.buf_end = buf + enc_ctx.len;
+
+	enc_ctx.recursion_depth = 0;
+	enc_ctx.recursion_limit = DUK_USE_CBOR_ENC_RECLIMIT;
+
+	duk_dup(thr, idx);
+	duk__cbor_encode_req_stack(&enc_ctx);
+	duk__cbor_encode_value(&enc_ctx);
+	DUK_ASSERT(enc_ctx.recursion_depth == 0);
+	duk_resize_buffer(enc_ctx.thr, enc_ctx.idx_buf, (duk_size_t) (enc_ctx.ptr - enc_ctx.buf));
+	duk_replace(thr, idx);
+}
+
+DUK_LOCAL void duk__cbor_decode(duk_hthread *thr, duk_idx_t idx, duk_uint_t decode_flags) {
+	duk_cbor_decode_context dec_ctx;
+
+	DUK_UNREF(decode_flags);
+
+	/* Suppress compile warnings for functions only needed with e.g.
+	 * asserts enabled.
+	 */
+	DUK_UNREF(duk__cbor_get_reserve);
+
+	idx = duk_require_normalize_index(thr, idx);
+
+	dec_ctx.thr = thr;
+	dec_ctx.buf = (const duk_uint8_t *) duk_require_buffer_data(thr, idx, &dec_ctx.len);
+	dec_ctx.off = 0;
+	/* dec_ctx.len: set above */
+
+	dec_ctx.recursion_depth = 0;
+	dec_ctx.recursion_limit = DUK_USE_CBOR_DEC_RECLIMIT;
+
+	duk__cbor_decode_req_stack(&dec_ctx);
+	duk__cbor_decode_value(&dec_ctx);
+	DUK_ASSERT(dec_ctx.recursion_depth == 0);
+	if (dec_ctx.off != dec_ctx.len) {
+		(void) duk_type_error(thr, "trailing garbage");
+	}
+
+	duk_replace(thr, idx);
+}
+
+#else  /* DUK_USE_CBOR_SUPPORT */
+
+DUK_LOCAL void duk__cbor_encode(duk_hthread *thr, duk_idx_t idx, duk_uint_t encode_flags) {
+	DUK_UNREF(idx);
+	DUK_UNREF(encode_flags);
+	DUK_ERROR_UNSUPPORTED(thr);
+}
+
+DUK_LOCAL void duk__cbor_decode(duk_hthread *thr, duk_idx_t idx, duk_uint_t decode_flags) {
+	DUK_UNREF(idx);
+	DUK_UNREF(decode_flags);
+	DUK_ERROR_UNSUPPORTED(thr);
+}
+
+#endif  /* DUK_USE_CBOR_SUPPORT */
+
+/*
+ *  Public APIs
+ */
+
+DUK_EXTERNAL void duk_cbor_encode(duk_hthread *thr, duk_idx_t idx, duk_uint_t encode_flags) {
+	DUK_ASSERT_API_ENTRY(thr);
+	duk__cbor_encode(thr, idx, encode_flags);
+}
+DUK_EXTERNAL void duk_cbor_decode(duk_hthread *thr, duk_idx_t idx, duk_uint_t decode_flags) {
+	DUK_ASSERT_API_ENTRY(thr);
+	duk__cbor_decode(thr, idx, decode_flags);
+}
+
+#if defined(DUK_USE_CBOR_BUILTIN)
+#if defined(DUK_USE_CBOR_SUPPORT)
+DUK_INTERNAL duk_ret_t duk_bi_cbor_encode(duk_hthread *thr) {
+	DUK_ASSERT_TOP(thr, 1);
+
+	duk__cbor_encode(thr, -1, 0 /*flags*/);
+
+	/* Produce an ArrayBuffer by first decoding into a plain buffer which
+	 * mimics a Uint8Array and gettings its .buffer property.
+	 */
+	/* XXX: shortcut */
+	(void) duk_get_prop_stridx(thr, -1, DUK_STRIDX_LC_BUFFER);
+	return 1;
+}
+
+DUK_INTERNAL duk_ret_t duk_bi_cbor_decode(duk_hthread *thr) {
+	DUK_ASSERT_TOP(thr, 1);
+
+	duk__cbor_decode(thr, -1, 0 /*flags*/);
+	return 1;
+}
+#else  /* DUK_USE_CBOR_SUPPORT */
+DUK_INTERNAL duk_ret_t duk_bi_cbor_encode(duk_hthread *thr) {
+	DUK_ERROR_UNSUPPORTED(thr);
+	DUK_WO_NORETURN(return 0;);
+}
+DUK_INTERNAL duk_ret_t duk_bi_cbor_decode(duk_hthread *thr) {
+	DUK_ERROR_UNSUPPORTED(thr);
+	DUK_WO_NORETURN(return 0;);
+}
+#endif  /* DUK_USE_CBOR_SUPPORT */
+#endif  /* DUK_USE_CBOR_BUILTIN */
+
+/* automatic undefs */
+#undef DUK__CBOR_AI
 /*
  *  Date built-ins
  *
@@ -30356,7 +32360,7 @@ DUK_INTERNAL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts,
 
 	DUK_ASSERT(DUK_ISFINITE(d));    /* caller checks */
 	d = DUK_FLOOR(d);  /* remove fractions if present */
-	DUK_ASSERT(DUK_FLOOR(d) == d);
+	DUK_ASSERT(duk_double_equals(DUK_FLOOR(d), d));
 
 	/* The timevalue must be in valid ECMAScript range, but since a local
 	 * time offset can be applied, we need to allow a +/- 24h leeway to
@@ -30375,13 +32379,13 @@ DUK_INTERNAL void duk_bi_date_timeval_to_parts(duk_double_t d, duk_int_t *parts,
 		d1 += (duk_double_t) DUK_DATE_MSEC_DAY;
 	}
 	d2 = DUK_FLOOR((double) (d / (duk_double_t) DUK_DATE_MSEC_DAY));
-	DUK_ASSERT(d2 * ((duk_double_t) DUK_DATE_MSEC_DAY) + d1 == d);
+	DUK_ASSERT(duk_double_equals(d2 * ((duk_double_t) DUK_DATE_MSEC_DAY) + d1, d));
 	/* now expected to fit into a 32-bit integer */
 	t1 = (duk_int_t) d1;
 	t2 = (duk_int_t) d2;
 	day_since_epoch = t2;
-	DUK_ASSERT((duk_double_t) t1 == d1);
-	DUK_ASSERT((duk_double_t) t2 == d2);
+	DUK_ASSERT(duk_double_equals((duk_double_t) t1, d1));
+	DUK_ASSERT(duk_double_equals((duk_double_t) t2, d2));
 
 	/* t1 = milliseconds within day (fits 32 bit)
 	 * t2 = day number from epoch (fits 32 bit, may be negative)
@@ -31238,7 +33242,7 @@ DUK_INTERNAL duk_ret_t duk_bi_date_constructor_now(duk_hthread *thr) {
 	duk_double_t d;
 
 	d = duk_time_get_ecmascript_time_nofrac(thr);
-	DUK_ASSERT(duk__timeclip(d) == d);  /* TimeClip() should never be necessary */
+	DUK_ASSERT(duk_double_equals(duk__timeclip(d), d));  /* TimeClip() should never be necessary */
 	duk_push_number(thr, d);
 	return 1;
 }
@@ -34374,28 +36378,28 @@ DUK_INTERNAL duk_ret_t duk_bi_global_object_unescape(duk_hthread *thr) {
 #define DUK__JSON_STRINGIFY_BUFSIZE 128
 #define DUK__JSON_MAX_ESC_LEN 10  /* '\Udeadbeef' */
 
-DUK_LOCAL_DECL void duk__dec_syntax_error(duk_json_dec_ctx *js_ctx);
-DUK_LOCAL_DECL void duk__dec_eat_white(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_dec_syntax_error(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_dec_eat_white(duk_json_dec_ctx *js_ctx);
 #if defined(DUK_USE_JX)
-DUK_LOCAL_DECL duk_uint8_t duk__dec_peek(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL duk_uint8_t duk__json_dec_peek(duk_json_dec_ctx *js_ctx);
 #endif
-DUK_LOCAL_DECL duk_uint8_t duk__dec_get(duk_json_dec_ctx *js_ctx);
-DUK_LOCAL_DECL duk_uint8_t duk__dec_get_nonwhite(duk_json_dec_ctx *js_ctx);
-DUK_LOCAL_DECL duk_uint_fast32_t duk__dec_decode_hex_escape(duk_json_dec_ctx *js_ctx, duk_small_uint_t n);
-DUK_LOCAL_DECL void duk__dec_req_stridx(duk_json_dec_ctx *js_ctx, duk_small_uint_t stridx);
-DUK_LOCAL_DECL void duk__dec_string(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL duk_uint8_t duk__json_dec_get(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL duk_uint8_t duk__json_dec_get_nonwhite(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL duk_uint_fast32_t duk__json_dec_decode_hex_escape(duk_json_dec_ctx *js_ctx, duk_small_uint_t n);
+DUK_LOCAL_DECL void duk__json_dec_req_stridx(duk_json_dec_ctx *js_ctx, duk_small_uint_t stridx);
+DUK_LOCAL_DECL void duk__json_dec_string(duk_json_dec_ctx *js_ctx);
 #if defined(DUK_USE_JX)
-DUK_LOCAL_DECL void duk__dec_plain_string(duk_json_dec_ctx *js_ctx);
-DUK_LOCAL_DECL void duk__dec_pointer(duk_json_dec_ctx *js_ctx);
-DUK_LOCAL_DECL void duk__dec_buffer(duk_json_dec_ctx *js_ctx);
-#endif
-DUK_LOCAL_DECL void duk__dec_number(duk_json_dec_ctx *js_ctx);
-DUK_LOCAL_DECL void duk__dec_objarr_entry(duk_json_dec_ctx *js_ctx);
-DUK_LOCAL_DECL void duk__dec_objarr_exit(duk_json_dec_ctx *js_ctx);
-DUK_LOCAL_DECL void duk__dec_object(duk_json_dec_ctx *js_ctx);
-DUK_LOCAL_DECL void duk__dec_array(duk_json_dec_ctx *js_ctx);
-DUK_LOCAL_DECL void duk__dec_value(duk_json_dec_ctx *js_ctx);
-DUK_LOCAL_DECL void duk__dec_reviver_walk(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_dec_plain_string(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_dec_pointer(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_dec_buffer(duk_json_dec_ctx *js_ctx);
+#endif
+DUK_LOCAL_DECL void duk__json_dec_number(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_dec_objarr_entry(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_dec_objarr_exit(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_dec_object(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_dec_array(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_dec_value(duk_json_dec_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_dec_reviver_walk(duk_json_dec_ctx *js_ctx);
 
 DUK_LOCAL_DECL void duk__emit_1(duk_json_enc_ctx *js_ctx, duk_uint_fast8_t ch);
 DUK_LOCAL_DECL void duk__emit_2(duk_json_enc_ctx *js_ctx, duk_uint_fast8_t ch1, duk_uint_fast8_t ch2);
@@ -34406,29 +36410,29 @@ DUK_LOCAL_DECL void duk__emit_cstring(duk_json_enc_ctx *js_ctx, const char *p);
 #endif
 DUK_LOCAL_DECL void duk__emit_stridx(duk_json_enc_ctx *js_ctx, duk_small_uint_t stridx);
 DUK_LOCAL_DECL duk_uint8_t *duk__emit_esc_auto_fast(duk_json_enc_ctx *js_ctx, duk_uint_fast32_t cp, duk_uint8_t *q);
-DUK_LOCAL_DECL void duk__enc_key_autoquote(duk_json_enc_ctx *js_ctx, duk_hstring *k);
-DUK_LOCAL_DECL void duk__enc_quote_string(duk_json_enc_ctx *js_ctx, duk_hstring *h_str);
-DUK_LOCAL_DECL void duk__enc_objarr_entry(duk_json_enc_ctx *js_ctx, duk_idx_t *entry_top);
-DUK_LOCAL_DECL void duk__enc_objarr_exit(duk_json_enc_ctx *js_ctx, duk_idx_t *entry_top);
-DUK_LOCAL_DECL void duk__enc_object(duk_json_enc_ctx *js_ctx);
-DUK_LOCAL_DECL void duk__enc_array(duk_json_enc_ctx *js_ctx);
-DUK_LOCAL_DECL duk_bool_t duk__enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_holder);
-DUK_LOCAL_DECL duk_bool_t duk__enc_allow_into_proplist(duk_tval *tv);
-DUK_LOCAL_DECL void duk__enc_double(duk_json_enc_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_enc_key_autoquote(duk_json_enc_ctx *js_ctx, duk_hstring *k);
+DUK_LOCAL_DECL void duk__json_enc_quote_string(duk_json_enc_ctx *js_ctx, duk_hstring *h_str);
+DUK_LOCAL_DECL void duk__json_enc_objarr_entry(duk_json_enc_ctx *js_ctx, duk_idx_t *entry_top);
+DUK_LOCAL_DECL void duk__json_enc_objarr_exit(duk_json_enc_ctx *js_ctx, duk_idx_t *entry_top);
+DUK_LOCAL_DECL void duk__json_enc_object(duk_json_enc_ctx *js_ctx);
+DUK_LOCAL_DECL void duk__json_enc_array(duk_json_enc_ctx *js_ctx);
+DUK_LOCAL_DECL duk_bool_t duk__json_enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_holder);
+DUK_LOCAL_DECL duk_bool_t duk__json_enc_allow_into_proplist(duk_tval *tv);
+DUK_LOCAL_DECL void duk__json_enc_double(duk_json_enc_ctx *js_ctx);
 #if defined(DUK_USE_FASTINT)
-DUK_LOCAL_DECL void duk__enc_fastint_tval(duk_json_enc_ctx *js_ctx, duk_tval *tv);
+DUK_LOCAL_DECL void duk__json_enc_fastint_tval(duk_json_enc_ctx *js_ctx, duk_tval *tv);
 #endif
 #if defined(DUK_USE_JX) || defined(DUK_USE_JC)
-DUK_LOCAL_DECL void duk__enc_buffer_jx_jc(duk_json_enc_ctx *js_ctx, duk_hbuffer *h);
-DUK_LOCAL_DECL void duk__enc_pointer(duk_json_enc_ctx *js_ctx, void *ptr);
+DUK_LOCAL_DECL void duk__json_enc_buffer_jx_jc(duk_json_enc_ctx *js_ctx, duk_hbuffer *h);
+DUK_LOCAL_DECL void duk__json_enc_pointer(duk_json_enc_ctx *js_ctx, void *ptr);
 #if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
-DUK_LOCAL_DECL void duk__enc_bufobj(duk_json_enc_ctx *js_ctx, duk_hbufobj *h_bufobj);
+DUK_LOCAL_DECL void duk__json_enc_bufobj(duk_json_enc_ctx *js_ctx, duk_hbufobj *h_bufobj);
 #endif
 #endif
 #if defined(DUK_USE_JSON_STRINGIFY_FASTPATH)
-DUK_LOCAL_DECL void duk__enc_buffer_json_fastpath(duk_json_enc_ctx *js_ctx, duk_hbuffer *h);
+DUK_LOCAL_DECL void duk__json_enc_buffer_json_fastpath(duk_json_enc_ctx *js_ctx, duk_hbuffer *h);
 #endif
-DUK_LOCAL_DECL void duk__enc_newline_indent(duk_json_enc_ctx *js_ctx, duk_uint_t depth);
+DUK_LOCAL_DECL void duk__json_enc_newline_indent(duk_json_enc_ctx *js_ctx, duk_uint_t depth);
 
 /*
  *  Helper tables
@@ -34553,7 +36557,7 @@ DUK_LOCAL const duk_uint8_t duk__json_decnumber_lookup[256] = {
  *  CESU-8 encodings.
  */
 
-DUK_LOCAL void duk__dec_syntax_error(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_syntax_error(duk_json_dec_ctx *js_ctx) {
 	/* Shared handler to minimize parser size.  Cause will be
 	 * hidden, unfortunately, but we'll have an offset which
 	 * is often quite enough.
@@ -34563,7 +36567,7 @@ DUK_LOCAL void duk__dec_syntax_error(duk_json_dec_ctx *js_ctx) {
 	DUK_WO_NORETURN(return;);
 }
 
-DUK_LOCAL void duk__dec_eat_white(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_eat_white(duk_json_dec_ctx *js_ctx) {
 	const duk_uint8_t *p;
 	duk_uint8_t t;
 
@@ -34594,24 +36598,24 @@ DUK_LOCAL void duk__dec_eat_white(duk_json_dec_ctx *js_ctx) {
 }
 
 #if defined(DUK_USE_JX)
-DUK_LOCAL duk_uint8_t duk__dec_peek(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL duk_uint8_t duk__json_dec_peek(duk_json_dec_ctx *js_ctx) {
 	DUK_ASSERT(js_ctx->p <= js_ctx->p_end);
 	return *js_ctx->p;
 }
 #endif
 
-DUK_LOCAL duk_uint8_t duk__dec_get(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL duk_uint8_t duk__json_dec_get(duk_json_dec_ctx *js_ctx) {
 	DUK_ASSERT(js_ctx->p <= js_ctx->p_end);
 	return *js_ctx->p++;
 }
 
-DUK_LOCAL duk_uint8_t duk__dec_get_nonwhite(duk_json_dec_ctx *js_ctx) {
-	duk__dec_eat_white(js_ctx);
-	return duk__dec_get(js_ctx);
+DUK_LOCAL duk_uint8_t duk__json_dec_get_nonwhite(duk_json_dec_ctx *js_ctx) {
+	duk__json_dec_eat_white(js_ctx);
+	return duk__json_dec_get(js_ctx);
 }
 
 /* For JX, expressing the whole unsigned 32-bit range matters. */
-DUK_LOCAL duk_uint_fast32_t duk__dec_decode_hex_escape(duk_json_dec_ctx *js_ctx, duk_small_uint_t n) {
+DUK_LOCAL duk_uint_fast32_t duk__json_dec_decode_hex_escape(duk_json_dec_ctx *js_ctx, duk_small_uint_t n) {
 	duk_small_uint_t i;
 	duk_uint_fast32_t res = 0;
 	duk_uint8_t x;
@@ -34620,7 +36624,7 @@ DUK_LOCAL duk_uint_fast32_t duk__dec_decode_hex_escape(duk_json_dec_ctx *js_ctx,
 	for (i = 0; i < n; i++) {
 		/* XXX: share helper from lexer; duk_lexer.c / hexval(). */
 
-		x = duk__dec_get(js_ctx);
+		x = duk__json_dec_get(js_ctx);
 		DUK_DDD(DUK_DDDPRINT("decode_hex_escape: i=%ld, n=%ld, res=%ld, x=%ld",
 		                     (long) i, (long) n, (long) res, (long) x));
 
@@ -34639,12 +36643,12 @@ DUK_LOCAL duk_uint_fast32_t duk__dec_decode_hex_escape(duk_json_dec_ctx *js_ctx,
 	return res;
 
  syntax_error:
-	duk__dec_syntax_error(js_ctx);
+	duk__json_dec_syntax_error(js_ctx);
 	DUK_UNREACHABLE();
 	return 0;
 }
 
-DUK_LOCAL void duk__dec_req_stridx(duk_json_dec_ctx *js_ctx, duk_small_uint_t stridx) {
+DUK_LOCAL void duk__json_dec_req_stridx(duk_json_dec_ctx *js_ctx, duk_small_uint_t stridx) {
 	duk_hstring *h;
 	const duk_uint8_t *p;
 	duk_uint8_t x, y;
@@ -34666,7 +36670,7 @@ DUK_LOCAL void duk__dec_req_stridx(duk_json_dec_ctx *js_ctx, duk_small_uint_t st
 		if (x == 0) {
 			break;
 		}
-		y = duk__dec_get(js_ctx);
+		y = duk__json_dec_get(js_ctx);
 		if (x != y) {
 			/* Catches EOF of JSON input. */
 			goto syntax_error;
@@ -34677,18 +36681,18 @@ DUK_LOCAL void duk__dec_req_stridx(duk_json_dec_ctx *js_ctx, duk_small_uint_t st
 	return;
 
  syntax_error:
-	duk__dec_syntax_error(js_ctx);
+	duk__json_dec_syntax_error(js_ctx);
 	DUK_UNREACHABLE();
 }
 
-DUK_LOCAL duk_small_int_t duk__dec_string_escape(duk_json_dec_ctx *js_ctx, duk_uint8_t **ext_p) {
+DUK_LOCAL duk_small_int_t duk__json_dec_string_escape(duk_json_dec_ctx *js_ctx, duk_uint8_t **ext_p) {
 	duk_uint_fast32_t cp;
 
 	/* EOF (-1) will be cast to an unsigned value first
 	 * and then re-cast for the switch.  In any case, it
 	 * will match the default case (syntax error).
 	 */
-	cp = (duk_uint_fast32_t) duk__dec_get(js_ctx);
+	cp = (duk_uint_fast32_t) duk__json_dec_get(js_ctx);
 	switch (cp) {
 	case DUK_ASC_BACKSLASH: break;
 	case DUK_ASC_DOUBLEQUOTE: break;
@@ -34699,13 +36703,13 @@ DUK_LOCAL duk_small_int_t duk__dec_string_escape(duk_json_dec_ctx *js_ctx, duk_u
 	case DUK_ASC_LC_F: cp = 0x0c; break;
 	case DUK_ASC_LC_B: cp = 0x08; break;
 	case DUK_ASC_LC_U: {
-		cp = duk__dec_decode_hex_escape(js_ctx, 4);
+		cp = duk__json_dec_decode_hex_escape(js_ctx, 4);
 		break;
 	}
 #if defined(DUK_USE_JX)
 	case DUK_ASC_UC_U: {
 		if (js_ctx->flag_ext_custom) {
-			cp = duk__dec_decode_hex_escape(js_ctx, 8);
+			cp = duk__json_dec_decode_hex_escape(js_ctx, 8);
 		} else {
 			return 1;  /* syntax error */
 		}
@@ -34713,7 +36717,7 @@ DUK_LOCAL duk_small_int_t duk__dec_string_escape(duk_json_dec_ctx *js_ctx, duk_u
 	}
 	case DUK_ASC_LC_X: {
 		if (js_ctx->flag_ext_custom) {
-			cp = duk__dec_decode_hex_escape(js_ctx, 2);
+			cp = duk__json_dec_decode_hex_escape(js_ctx, 2);
 		} else {
 			return 1;  /* syntax error */
 		}
@@ -34725,12 +36729,12 @@ DUK_LOCAL duk_small_int_t duk__dec_string_escape(duk_json_dec_ctx *js_ctx, duk_u
 		return 1;  /* syntax error */
 	}
 
-	DUK_RAW_WRITE_XUTF8(*ext_p, cp);
+	DUK_RAW_WRITEINC_XUTF8(*ext_p, cp);
 
 	return 0;
 }
 
-DUK_LOCAL void duk__dec_string(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_string(duk_json_dec_ctx *js_ctx) {
 	duk_hthread *thr = js_ctx->thr;
 	duk_bufwriter_ctx bw_alloc;
 	duk_bufwriter_ctx *bw;
@@ -34789,7 +36793,7 @@ DUK_LOCAL void duk__dec_string(duk_json_dec_ctx *js_ctx) {
 				 * quite slow but it's uncommon).
 				 */
 				js_ctx->p = p;
-				if (duk__dec_string_escape(js_ctx, &q) != 0) {
+				if (duk__json_dec_string_escape(js_ctx, &q) != 0) {
 					goto syntax_error;
 				}
 				break;
@@ -34806,12 +36810,12 @@ DUK_LOCAL void duk__dec_string(duk_json_dec_ctx *js_ctx) {
 
 		q = DUK_BW_ENSURE_RAW(js_ctx->thr, bw, DUK_UNICODE_MAX_XUTF8_LENGTH, q);
 
-		x = duk__dec_get(js_ctx);
+		x = duk__json_dec_get(js_ctx);
 
 		if (x == DUK_ASC_DOUBLEQUOTE) {
 			break;
 		} else if (x == DUK_ASC_BACKSLASH) {
-			if (duk__dec_string_escape(js_ctx, &q) != 0) {
+			if (duk__json_dec_string_escape(js_ctx, &q) != 0) {
 				goto syntax_error;
 			}
 		} else if (x < 0x20) {
@@ -34831,7 +36835,7 @@ DUK_LOCAL void duk__dec_string(duk_json_dec_ctx *js_ctx) {
 	return;
 
  syntax_error:
-	duk__dec_syntax_error(js_ctx);
+	duk__json_dec_syntax_error(js_ctx);
 	DUK_UNREACHABLE();
 }
 
@@ -34839,7 +36843,7 @@ DUK_LOCAL void duk__dec_string(duk_json_dec_ctx *js_ctx) {
 /* Decode a plain string consisting entirely of identifier characters.
  * Used to parse plain keys (e.g. "foo: 123").
  */
-DUK_LOCAL void duk__dec_plain_string(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_plain_string(duk_json_dec_ctx *js_ctx) {
 	duk_hthread *thr = js_ctx->thr;
 	const duk_uint8_t *p;
 	duk_small_int_t x;
@@ -34881,7 +36885,7 @@ DUK_LOCAL void duk__dec_plain_string(duk_json_dec_ctx *js_ctx) {
 #endif  /* DUK_USE_JX */
 
 #if defined(DUK_USE_JX)
-DUK_LOCAL void duk__dec_pointer(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_pointer(duk_json_dec_ctx *js_ctx) {
 	duk_hthread *thr = js_ctx->thr;
 	const duk_uint8_t *p;
 	duk_small_int_t x;
@@ -34928,13 +36932,13 @@ DUK_LOCAL void duk__dec_pointer(duk_json_dec_ctx *js_ctx) {
 	return;
 
  syntax_error:
-	duk__dec_syntax_error(js_ctx);
+	duk__json_dec_syntax_error(js_ctx);
 	DUK_UNREACHABLE();
 }
 #endif  /* DUK_USE_JX */
 
 #if defined(DUK_USE_JX)
-DUK_LOCAL void duk__dec_buffer(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_buffer(duk_json_dec_ctx *js_ctx) {
 	duk_hthread *thr = js_ctx->thr;
 	const duk_uint8_t *p;
 	duk_uint8_t *buf;
@@ -34986,13 +36990,13 @@ DUK_LOCAL void duk__dec_buffer(duk_json_dec_ctx *js_ctx) {
 	return;
 
  syntax_error:
-	duk__dec_syntax_error(js_ctx);
+	duk__json_dec_syntax_error(js_ctx);
 	DUK_UNREACHABLE();
 }
 #endif  /* DUK_USE_JX */
 
 /* Parse a number, other than NaN or +/- Infinity */
-DUK_LOCAL void duk__dec_number(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_number(duk_json_dec_ctx *js_ctx) {
 	duk_hthread *thr = js_ctx->thr;
 	const duk_uint8_t *p_start;
 	const duk_uint8_t *p;
@@ -35048,7 +37052,7 @@ DUK_LOCAL void duk__dec_number(duk_json_dec_ctx *js_ctx) {
 	                     (duk_tval *) duk_get_tval(thr, -1)));
 	duk_numconv_parse(thr, 10 /*radix*/, s2n_flags);
 	if (duk_is_nan(thr, -1)) {
-		duk__dec_syntax_error(js_ctx);
+		duk__json_dec_syntax_error(js_ctx);
 	}
 	DUK_ASSERT(duk_is_number(thr, -1));
 	DUK_DDD(DUK_DDDPRINT("parse_number: final number: %!T",
@@ -35057,22 +37061,24 @@ DUK_LOCAL void duk__dec_number(duk_json_dec_ctx *js_ctx) {
 	/* [ ... num ] */
 }
 
-DUK_LOCAL void duk__dec_objarr_entry(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_objarr_entry(duk_json_dec_ctx *js_ctx) {
 	duk_hthread *thr = js_ctx->thr;
 	duk_require_stack(thr, DUK_JSON_DEC_REQSTACK);
 
 	/* c recursion check */
 
+	duk_native_stack_check(thr);
+
 	DUK_ASSERT_DISABLE(js_ctx->recursion_depth >= 0);  /* unsigned */
 	DUK_ASSERT(js_ctx->recursion_depth <= js_ctx->recursion_limit);
 	if (js_ctx->recursion_depth >= js_ctx->recursion_limit) {
-		DUK_ERROR_RANGE(thr, DUK_STR_JSONDEC_RECLIMIT);
+		DUK_ERROR_RANGE(thr, DUK_STR_DEC_RECLIMIT);
 		DUK_WO_NORETURN(return;);
 	}
 	js_ctx->recursion_depth++;
 }
 
-DUK_LOCAL void duk__dec_objarr_exit(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_objarr_exit(duk_json_dec_ctx *js_ctx) {
 	/* c recursion check */
 
 	DUK_ASSERT(js_ctx->recursion_depth > 0);
@@ -35080,14 +37086,14 @@ DUK_LOCAL void duk__dec_objarr_exit(duk_json_dec_ctx *js_ctx) {
 	js_ctx->recursion_depth--;
 }
 
-DUK_LOCAL void duk__dec_object(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_object(duk_json_dec_ctx *js_ctx) {
 	duk_hthread *thr = js_ctx->thr;
 	duk_int_t key_count;  /* XXX: a "first" flag would suffice */
 	duk_uint8_t x;
 
 	DUK_DDD(DUK_DDDPRINT("parse_object"));
 
-	duk__dec_objarr_entry(js_ctx);
+	duk__json_dec_objarr_entry(js_ctx);
 
 	duk_push_object(thr);
 
@@ -35095,7 +37101,7 @@ DUK_LOCAL void duk__dec_object(duk_json_dec_ctx *js_ctx) {
 
 	key_count = 0;
 	for (;;) {
-		x = duk__dec_get_nonwhite(js_ctx);
+		x = duk__json_dec_get_nonwhite(js_ctx);
 
 		DUK_DDD(DUK_DDDPRINT("parse_object: obj=%!T, x=%ld, key_count=%ld",
 		                     (duk_tval *) duk_get_tval(thr, -1),
@@ -35105,7 +37111,7 @@ DUK_LOCAL void duk__dec_object(duk_json_dec_ctx *js_ctx) {
 
 		if (x == DUK_ASC_COMMA && key_count > 0) {
 			/* accept comma, expect new value */
-			x = duk__dec_get_nonwhite(js_ctx);
+			x = duk__json_dec_get_nonwhite(js_ctx);
 		} else if (x == DUK_ASC_RCURLY) {
 			/* eat closing brace */
 			break;
@@ -35122,11 +37128,11 @@ DUK_LOCAL void duk__dec_object(duk_json_dec_ctx *js_ctx) {
 		/* parse key and value */
 
 		if (x == DUK_ASC_DOUBLEQUOTE) {
-			duk__dec_string(js_ctx);
+			duk__json_dec_string(js_ctx);
 #if defined(DUK_USE_JX)
 		} else if (js_ctx->flag_ext_custom &&
 		           duk_unicode_is_identifier_start((duk_codepoint_t) x)) {
-			duk__dec_plain_string(js_ctx);
+			duk__json_dec_plain_string(js_ctx);
 #endif
 		} else {
 			goto syntax_error;
@@ -35134,12 +37140,12 @@ DUK_LOCAL void duk__dec_object(duk_json_dec_ctx *js_ctx) {
 
 		/* [ ... obj key ] */
 
-		x = duk__dec_get_nonwhite(js_ctx);
+		x = duk__json_dec_get_nonwhite(js_ctx);
 		if (x != DUK_ASC_COLON) {
 			goto syntax_error;
 		}
 
-		duk__dec_value(js_ctx);
+		duk__json_dec_value(js_ctx);
 
 		/* [ ... obj key val ] */
 
@@ -35155,22 +37161,22 @@ DUK_LOCAL void duk__dec_object(duk_json_dec_ctx *js_ctx) {
 	DUK_DDD(DUK_DDDPRINT("parse_object: final object is %!T",
 	                     (duk_tval *) duk_get_tval(thr, -1)));
 
-	duk__dec_objarr_exit(js_ctx);
+	duk__json_dec_objarr_exit(js_ctx);
 	return;
 
  syntax_error:
-	duk__dec_syntax_error(js_ctx);
+	duk__json_dec_syntax_error(js_ctx);
 	DUK_UNREACHABLE();
 }
 
-DUK_LOCAL void duk__dec_array(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_array(duk_json_dec_ctx *js_ctx) {
 	duk_hthread *thr = js_ctx->thr;
 	duk_uarridx_t arr_idx;
 	duk_uint8_t x;
 
 	DUK_DDD(DUK_DDDPRINT("parse_array"));
 
-	duk__dec_objarr_entry(js_ctx);
+	duk__json_dec_objarr_entry(js_ctx);
 
 	duk_push_array(thr);
 
@@ -35178,7 +37184,7 @@ DUK_LOCAL void duk__dec_array(duk_json_dec_ctx *js_ctx) {
 
 	arr_idx = 0;
 	for (;;) {
-		x = duk__dec_get_nonwhite(js_ctx);
+		x = duk__json_dec_get_nonwhite(js_ctx);
 
 		DUK_DDD(DUK_DDDPRINT("parse_array: arr=%!T, x=%ld, arr_idx=%ld",
 		                     (duk_tval *) duk_get_tval(thr, -1),
@@ -35194,7 +37200,7 @@ DUK_LOCAL void duk__dec_array(duk_json_dec_ctx *js_ctx) {
 			break;
 		} else if (arr_idx == 0) {
 			/* accept anything, expect first value (EOF will be
-			 * caught by duk__dec_value() below.
+			 * caught by duk__json_dec_value() below.
 			 */
 			js_ctx->p--;  /* backtrack (safe) */
 		} else {
@@ -35204,7 +37210,7 @@ DUK_LOCAL void duk__dec_array(duk_json_dec_ctx *js_ctx) {
 
 		/* parse value */
 
-		duk__dec_value(js_ctx);
+		duk__json_dec_value(js_ctx);
 
 		/* [ ... arr val ] */
 
@@ -35223,30 +37229,30 @@ DUK_LOCAL void duk__dec_array(duk_json_dec_ctx *js_ctx) {
 	DUK_DDD(DUK_DDDPRINT("parse_array: final array is %!T",
 	                     (duk_tval *) duk_get_tval(thr, -1)));
 
-	duk__dec_objarr_exit(js_ctx);
+	duk__json_dec_objarr_exit(js_ctx);
 	return;
 
  syntax_error:
-	duk__dec_syntax_error(js_ctx);
+	duk__json_dec_syntax_error(js_ctx);
 	DUK_UNREACHABLE();
 }
 
-DUK_LOCAL void duk__dec_value(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_value(duk_json_dec_ctx *js_ctx) {
 	duk_hthread *thr = js_ctx->thr;
 	duk_uint8_t x;
 
-	x = duk__dec_get_nonwhite(js_ctx);
+	x = duk__json_dec_get_nonwhite(js_ctx);
 
 	DUK_DDD(DUK_DDDPRINT("parse_value: initial x=%ld", (long) x));
 
-	/* Note: duk__dec_req_stridx() backtracks one char */
+	/* Note: duk__json_dec_req_stridx() backtracks one char */
 
 	if (x == DUK_ASC_DOUBLEQUOTE) {
-		duk__dec_string(js_ctx);
+		duk__json_dec_string(js_ctx);
 	} else if ((x >= DUK_ASC_0 && x <= DUK_ASC_9) || (x == DUK_ASC_MINUS)) {
 #if defined(DUK_USE_JX)
-		if (js_ctx->flag_ext_custom && x == DUK_ASC_MINUS && duk__dec_peek(js_ctx) == DUK_ASC_UC_I) {
-			duk__dec_req_stridx(js_ctx, DUK_STRIDX_MINUS_INFINITY);  /* "-Infinity", '-' has been eaten */
+		if (js_ctx->flag_ext_custom && x == DUK_ASC_MINUS && duk__json_dec_peek(js_ctx) == DUK_ASC_UC_I) {
+			duk__json_dec_req_stridx(js_ctx, DUK_STRIDX_MINUS_INFINITY);  /* "-Infinity", '-' has been eaten */
 			duk_push_number(thr, -DUK_DOUBLE_INFINITY);
 		} else {
 #else
@@ -35254,60 +37260,63 @@ DUK_LOCAL void duk__dec_value(duk_json_dec_ctx *js_ctx) {
 #endif
 			/* We already ate 'x', so backup one byte. */
 			js_ctx->p--;  /* safe */
-			duk__dec_number(js_ctx);
+			duk__json_dec_number(js_ctx);
 		}
 	} else if (x == DUK_ASC_LC_T) {
-		duk__dec_req_stridx(js_ctx, DUK_STRIDX_TRUE);
+		duk__json_dec_req_stridx(js_ctx, DUK_STRIDX_TRUE);
 		duk_push_true(thr);
 	} else if (x == DUK_ASC_LC_F) {
-		duk__dec_req_stridx(js_ctx, DUK_STRIDX_FALSE);
+		duk__json_dec_req_stridx(js_ctx, DUK_STRIDX_FALSE);
 		duk_push_false(thr);
 	} else if (x == DUK_ASC_LC_N) {
-		duk__dec_req_stridx(js_ctx, DUK_STRIDX_LC_NULL);
+		duk__json_dec_req_stridx(js_ctx, DUK_STRIDX_LC_NULL);
 		duk_push_null(thr);
 #if defined(DUK_USE_JX)
 	} else if (js_ctx->flag_ext_custom && x == DUK_ASC_LC_U) {
-		duk__dec_req_stridx(js_ctx, DUK_STRIDX_LC_UNDEFINED);
+		duk__json_dec_req_stridx(js_ctx, DUK_STRIDX_LC_UNDEFINED);
 		duk_push_undefined(thr);
 	} else if (js_ctx->flag_ext_custom && x == DUK_ASC_UC_N) {
-		duk__dec_req_stridx(js_ctx, DUK_STRIDX_NAN);
+		duk__json_dec_req_stridx(js_ctx, DUK_STRIDX_NAN);
 		duk_push_nan(thr);
 	} else if (js_ctx->flag_ext_custom && x == DUK_ASC_UC_I) {
-		duk__dec_req_stridx(js_ctx, DUK_STRIDX_INFINITY);
+		duk__json_dec_req_stridx(js_ctx, DUK_STRIDX_INFINITY);
 		duk_push_number(thr, DUK_DOUBLE_INFINITY);
 	} else if (js_ctx->flag_ext_custom && x == DUK_ASC_LPAREN) {
-		duk__dec_pointer(js_ctx);
+		duk__json_dec_pointer(js_ctx);
 	} else if (js_ctx->flag_ext_custom && x == DUK_ASC_PIPE) {
-		duk__dec_buffer(js_ctx);
+		duk__json_dec_buffer(js_ctx);
 #endif
 	} else if (x == DUK_ASC_LCURLY) {
-		duk__dec_object(js_ctx);
+		duk__json_dec_object(js_ctx);
 	} else if (x == DUK_ASC_LBRACKET) {
-		duk__dec_array(js_ctx);
+		duk__json_dec_array(js_ctx);
 	} else {
 		/* catches EOF (NUL) */
 		goto syntax_error;
 	}
 
-	duk__dec_eat_white(js_ctx);
+	duk__json_dec_eat_white(js_ctx);
 
 	/* [ ... val ] */
 	return;
 
  syntax_error:
-	duk__dec_syntax_error(js_ctx);
+	duk__json_dec_syntax_error(js_ctx);
 	DUK_UNREACHABLE();
 }
 
-/* Recursive value reviver, implements the Walk() algorithm.  No C recursion
- * check is done here because the initial parsing step will already ensure
- * there is a reasonable limit on C recursion depth and hence object depth.
+/* Recursive value reviver, implements the Walk() algorithm.  The parsing
+ * step ensures there is a reasonable depth limit to the input.  However,
+ * the reviver may create more depth by editing object or array entries, so
+ * we have both C recursion limit and native stack checks here.
  */
-DUK_LOCAL void duk__dec_reviver_walk(duk_json_dec_ctx *js_ctx) {
+DUK_LOCAL void duk__json_dec_reviver_walk(duk_json_dec_ctx *js_ctx) {
 	duk_hthread *thr = js_ctx->thr;
 	duk_hobject *h;
 	duk_uarridx_t i, arr_len;
 
+	duk__json_dec_objarr_entry(js_ctx);
+
 	DUK_DDD(DUK_DDDPRINT("walk: top=%ld, holder=%!T, name=%!T",
 	                     (long) duk_get_top(thr),
 	                     (duk_tval *) duk_get_tval(thr, -2),
@@ -35318,7 +37327,7 @@ DUK_LOCAL void duk__dec_reviver_walk(duk_json_dec_ctx *js_ctx) {
 
 	h = duk_get_hobject(thr, -1);
 	if (h != NULL) {
-		if (DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_ARRAY) {
+		if (duk_js_isarray_hobject(h)) {
 			arr_len = (duk_uarridx_t) duk_get_length(thr, -1);
 			for (i = 0; i < arr_len; i++) {
 				/* [ ... holder name val ] */
@@ -35330,7 +37339,7 @@ DUK_LOCAL void duk__dec_reviver_walk(duk_json_dec_ctx *js_ctx) {
 
 				duk_dup_top(thr);
 				(void) duk_push_uint_to_hstring(thr, (duk_uint_t) i);  /* -> [ ... holder name val val ToString(i) ] */
-				duk__dec_reviver_walk(js_ctx);  /* -> [ ... holder name val new_elem ] */
+				duk__json_dec_reviver_walk(js_ctx);  /* -> [ ... holder name val new_elem ] */
 
 				if (duk_is_undefined(thr, -1)) {
 					duk_pop(thr);
@@ -35357,7 +37366,7 @@ DUK_LOCAL void duk__dec_reviver_walk(duk_json_dec_ctx *js_ctx) {
 				duk_dup_m2(thr);
 
 				/* [ ... holder name val enum obj_key val obj_key ] */
-				duk__dec_reviver_walk(js_ctx);
+				duk__json_dec_reviver_walk(js_ctx);
 
 				/* [ ... holder name val enum obj_key new_elem ] */
 				if (duk_is_undefined(thr, -1)) {
@@ -35386,6 +37395,8 @@ DUK_LOCAL void duk__dec_reviver_walk(duk_json_dec_ctx *js_ctx) {
 	duk_insert(thr, -4);  /* -> [ ... reviver holder name val ] */
 	duk_call_method(thr, 2);  /* -> [ ... res ] */
 
+	duk__json_dec_objarr_exit(js_ctx);
+
 	DUK_DDD(DUK_DDDPRINT("walk: top=%ld, result=%!T",
 	                     (long) duk_get_top(thr), (duk_tval *) duk_get_tval(thr, -1)));
 }
@@ -35495,7 +37506,7 @@ DUK_LOCAL duk_uint8_t *duk__emit_esc_auto_fast(duk_json_enc_ctx *js_ctx, duk_uin
 	return q;
 }
 
-DUK_LOCAL void duk__enc_key_autoquote(duk_json_enc_ctx *js_ctx, duk_hstring *k) {
+DUK_LOCAL void duk__json_enc_key_autoquote(duk_json_enc_ctx *js_ctx, duk_hstring *k) {
 	const duk_int8_t *p, *p_start, *p_end;  /* Note: intentionally signed. */
 	duk_size_t k_len;
 	duk_codepoint_t cp;
@@ -35538,7 +37549,7 @@ DUK_LOCAL void duk__enc_key_autoquote(duk_json_enc_ctx *js_ctx, duk_hstring *k)
 	}
 
  quote_normally:
-	duk__enc_quote_string(js_ctx, k);
+	duk__json_enc_quote_string(js_ctx, k);
 }
 
 /* The Quote(value) operation: quote a string.
@@ -35546,13 +37557,13 @@ DUK_LOCAL void duk__enc_key_autoquote(duk_json_enc_ctx *js_ctx, duk_hstring *k)
  * Stack policy: [ ] -> [ ].
  */
 
-DUK_LOCAL void duk__enc_quote_string(duk_json_enc_ctx *js_ctx, duk_hstring *h_str) {
+DUK_LOCAL void duk__json_enc_quote_string(duk_json_enc_ctx *js_ctx, duk_hstring *h_str) {
 	duk_hthread *thr = js_ctx->thr;
 	const duk_uint8_t *p, *p_start, *p_end, *p_now, *p_tmp;
 	duk_uint8_t *q;
 	duk_ucodepoint_t cp;  /* typed for duk_unicode_decode_xutf8() */
 
-	DUK_DDD(DUK_DDDPRINT("duk__enc_quote_string: h_str=%!O", (duk_heaphdr *) h_str));
+	DUK_DDD(DUK_DDDPRINT("duk__json_enc_quote_string: h_str=%!O", (duk_heaphdr *) h_str));
 
 	DUK_ASSERT(h_str != NULL);
 	p_start = DUK_HSTRING_GET_DATA(h_str);
@@ -35669,7 +37680,7 @@ DUK_LOCAL void duk__enc_quote_string(duk_json_enc_ctx *js_ctx, duk_hstring *h_st
 					q = duk__emit_esc_auto_fast(js_ctx, cp, q);
 				} else {
 					/* as is */
-					DUK_RAW_WRITE_XUTF8(q, cp);
+					DUK_RAW_WRITEINC_XUTF8(q, cp);
 				}
 			}
 		}
@@ -35683,7 +37694,7 @@ DUK_LOCAL void duk__enc_quote_string(duk_json_enc_ctx *js_ctx, duk_hstring *h_st
 /* Encode a double (checked by caller) from stack top.  Stack top may be
  * replaced by serialized string but is not popped (caller does that).
  */
-DUK_LOCAL void duk__enc_double(duk_json_enc_ctx *js_ctx) {
+DUK_LOCAL void duk__json_enc_double(duk_json_enc_ctx *js_ctx) {
 	duk_hthread *thr;
 	duk_tval *tv;
 	duk_double_t d;
@@ -35747,7 +37758,7 @@ DUK_LOCAL void duk__enc_double(duk_json_enc_ctx *js_ctx) {
 
 #if defined(DUK_USE_FASTINT)
 /* Encode a fastint from duk_tval ptr, no value stack effects. */
-DUK_LOCAL void duk__enc_fastint_tval(duk_json_enc_ctx *js_ctx, duk_tval *tv) {
+DUK_LOCAL void duk__json_enc_fastint_tval(duk_json_enc_ctx *js_ctx, duk_tval *tv) {
 	duk_int64_t v;
 
 	/* Fastint range is signed 48-bit so longest value is -2^47 = -140737488355328
@@ -35772,7 +37783,7 @@ DUK_LOCAL void duk__enc_fastint_tval(duk_json_enc_ctx *js_ctx, duk_tval *tv) {
 
 #if defined(DUK_USE_JX) || defined(DUK_USE_JC)
 #if defined(DUK_USE_HEX_FASTPATH)
-DUK_LOCAL duk_uint8_t *duk__enc_buffer_data_hex(const duk_uint8_t *src, duk_size_t src_len, duk_uint8_t *dst) {
+DUK_LOCAL duk_uint8_t *duk__json_enc_buffer_data_hex(const duk_uint8_t *src, duk_size_t src_len, duk_uint8_t *dst) {
 	duk_uint8_t *q;
 	duk_uint16_t *q16;
 	duk_small_uint_t x;
@@ -35830,7 +37841,7 @@ DUK_LOCAL duk_uint8_t *duk__enc_buffer_data_hex(const duk_uint8_t *src, duk_size
 	return q;
 }
 #else  /* DUK_USE_HEX_FASTPATH */
-DUK_LOCAL duk_uint8_t *duk__enc_buffer_data_hex(const duk_uint8_t *src, duk_size_t src_len, duk_uint8_t *dst) {
+DUK_LOCAL duk_uint8_t *duk__json_enc_buffer_data_hex(const duk_uint8_t *src, duk_size_t src_len, duk_uint8_t *dst) {
 	const duk_uint8_t *p;
 	const duk_uint8_t *p_end;
 	duk_uint8_t *q;
@@ -35849,7 +37860,7 @@ DUK_LOCAL duk_uint8_t *duk__enc_buffer_data_hex(const duk_uint8_t *src, duk_size
 }
 #endif  /* DUK_USE_HEX_FASTPATH */
 
-DUK_LOCAL void duk__enc_buffer_data(duk_json_enc_ctx *js_ctx, duk_uint8_t *buf_data, duk_size_t buf_len) {
+DUK_LOCAL void duk__json_enc_buffer_data(duk_json_enc_ctx *js_ctx, duk_uint8_t *buf_data, duk_size_t buf_len) {
 	duk_hthread *thr;
 	duk_uint8_t *q;
 	duk_size_t space;
@@ -35881,7 +37892,7 @@ DUK_LOCAL void duk__enc_buffer_data(duk_json_enc_ctx *js_ctx, duk_uint8_t *buf_d
 #if defined(DUK_USE_JX)
 	{
 		*q++ = DUK_ASC_PIPE;
-		q = duk__enc_buffer_data_hex(buf_data, buf_len, q);
+		q = duk__json_enc_buffer_data_hex(buf_data, buf_len, q);
 		*q++ = DUK_ASC_PIPE;
 
 	}
@@ -35894,7 +37905,7 @@ DUK_LOCAL void duk__enc_buffer_data(duk_json_enc_ctx *js_ctx, duk_uint8_t *buf_d
 		DUK_ASSERT(js_ctx->flag_ext_compatible);
 		duk_memcpy((void *) q, (const void *) "{\"_buf\":\"", 9);  /* len: 9 */
 		q += 9;
-		q = duk__enc_buffer_data_hex(buf_data, buf_len, q);
+		q = duk__json_enc_buffer_data_hex(buf_data, buf_len, q);
 		*q++ = DUK_ASC_DOUBLEQUOTE;
 		*q++ = DUK_ASC_RCURLY;
 	}
@@ -35903,15 +37914,15 @@ DUK_LOCAL void duk__enc_buffer_data(duk_json_enc_ctx *js_ctx, duk_uint8_t *buf_d
 	DUK_BW_SET_PTR(thr, &js_ctx->bw, q);
 }
 
-DUK_LOCAL void duk__enc_buffer_jx_jc(duk_json_enc_ctx *js_ctx, duk_hbuffer *h) {
-	duk__enc_buffer_data(js_ctx,
+DUK_LOCAL void duk__json_enc_buffer_jx_jc(duk_json_enc_ctx *js_ctx, duk_hbuffer *h) {
+	duk__json_enc_buffer_data(js_ctx,
 	                     (duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(js_ctx->thr->heap, h),
 	                     (duk_size_t) DUK_HBUFFER_GET_SIZE(h));
 }
 #endif  /* DUK_USE_JX || DUK_USE_JC */
 
 #if defined(DUK_USE_JSON_STRINGIFY_FASTPATH)
-DUK_LOCAL void duk__enc_buffer_json_fastpath(duk_json_enc_ctx *js_ctx, duk_hbuffer *h) {
+DUK_LOCAL void duk__json_enc_buffer_json_fastpath(duk_json_enc_ctx *js_ctx, duk_hbuffer *h) {
 	duk_size_t i, n;
 	const duk_uint8_t *buf;
 	duk_uint8_t *q;
@@ -35935,7 +37946,7 @@ DUK_LOCAL void duk__enc_buffer_json_fastpath(duk_json_enc_ctx *js_ctx, duk_hbuff
 	buf = (const duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(js_ctx->thr->heap, h);
 	if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) {
 		for (i = 0; i < n; i++) {
-			duk__enc_newline_indent(js_ctx, js_ctx->recursion_depth + 1);
+			duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth + 1);
 			q = DUK_BW_ENSURE_GETPTR(js_ctx->thr, &js_ctx->bw, 32);
 			q += DUK_SPRINTF((char *) q, "\"%lu\": %u,", (unsigned long) i, (unsigned int) buf[i]);
 			DUK_BW_SET_PTR(js_ctx->thr, &js_ctx->bw, q);
@@ -35951,14 +37962,14 @@ DUK_LOCAL void duk__enc_buffer_json_fastpath(duk_json_enc_ctx *js_ctx, duk_hbuff
 	DUK__UNEMIT_1(js_ctx);  /* eat trailing comma */
 
 	if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) {
-		duk__enc_newline_indent(js_ctx, js_ctx->recursion_depth);
+		duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth);
 	}
 	DUK__EMIT_1(js_ctx, DUK_ASC_RCURLY);
 }
 #endif  /* DUK_USE_JSON_STRINGIFY_FASTPATH */
 
 #if defined(DUK_USE_JX) || defined(DUK_USE_JC)
-DUK_LOCAL void duk__enc_pointer(duk_json_enc_ctx *js_ctx, void *ptr) {
+DUK_LOCAL void duk__json_enc_pointer(duk_json_enc_ctx *js_ctx, void *ptr) {
 	char buf[64];  /* XXX: how to figure correct size? */
 	const char *fmt;
 
@@ -35996,14 +38007,14 @@ DUK_LOCAL void duk__enc_pointer(duk_json_enc_ctx *js_ctx, void *ptr) {
 
 #if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
 #if defined(DUK_USE_JX) || defined(DUK_USE_JC)
-DUK_LOCAL void duk__enc_bufobj(duk_json_enc_ctx *js_ctx, duk_hbufobj *h_bufobj) {
+DUK_LOCAL void duk__json_enc_bufobj(duk_json_enc_ctx *js_ctx, duk_hbufobj *h_bufobj) {
 	DUK_HBUFOBJ_ASSERT_VALID(h_bufobj);
 
 	if (h_bufobj->buf == NULL || !DUK_HBUFOBJ_VALID_SLICE(h_bufobj)) {
 		DUK__EMIT_STRIDX(js_ctx, DUK_STRIDX_LC_NULL);
 	} else {
 		/* Handle both full and partial slice (as long as covered). */
-		duk__enc_buffer_data(js_ctx,
+		duk__json_enc_buffer_data(js_ctx,
 		                     (duk_uint8_t *) DUK_HBUFOBJ_GET_SLICE_BASE(js_ctx->thr->heap, h_bufobj),
 		                     (duk_size_t) h_bufobj->length);
 	}
@@ -36015,7 +38026,7 @@ DUK_LOCAL void duk__enc_bufobj(duk_json_enc_ctx *js_ctx, duk_hbufobj *h_bufobj)
  * directly related to indent depth.
  */
 #if defined(DUK_USE_PREFER_SIZE)
-DUK_LOCAL void duk__enc_newline_indent(duk_json_enc_ctx *js_ctx, duk_uint_t depth) {
+DUK_LOCAL void duk__json_enc_newline_indent(duk_json_enc_ctx *js_ctx, duk_uint_t depth) {
 	DUK_ASSERT(js_ctx->h_gap != NULL);
 	DUK_ASSERT(DUK_HSTRING_GET_BYTELEN(js_ctx->h_gap) > 0);  /* caller guarantees */
 
@@ -36025,7 +38036,7 @@ DUK_LOCAL void duk__enc_newline_indent(duk_json_enc_ctx *js_ctx, duk_uint_t dept
 	}
 }
 #else  /* DUK_USE_PREFER_SIZE */
-DUK_LOCAL void duk__enc_newline_indent(duk_json_enc_ctx *js_ctx, duk_uint_t depth) {
+DUK_LOCAL void duk__json_enc_newline_indent(duk_json_enc_ctx *js_ctx, duk_uint_t depth) {
 	const duk_uint8_t *gap_data;
 	duk_size_t gap_len;
 	duk_size_t avail_bytes;   /* bytes of indent available for copying */
@@ -36078,13 +38089,14 @@ DUK_LOCAL void duk__enc_newline_indent(duk_json_enc_ctx *js_ctx, duk_uint_t dept
 #endif  /* DUK_USE_PREFER_SIZE */
 
 /* Shared entry handling for object/array serialization. */
-DUK_LOCAL void duk__enc_objarr_entry(duk_json_enc_ctx *js_ctx, duk_idx_t *entry_top) {
+DUK_LOCAL void duk__json_enc_objarr_entry(duk_json_enc_ctx *js_ctx, duk_idx_t *entry_top) {
 	duk_hthread *thr = js_ctx->thr;
 	duk_hobject *h_target;
 	duk_uint_fast32_t i, n;
 
 	*entry_top = duk_get_top(thr);
 
+	duk_native_stack_check(thr);
 	duk_require_stack(thr, DUK_JSON_ENC_REQSTACK);
 
 	/* Loop check using a hybrid approach: a fixed-size visited[] array
@@ -36122,7 +38134,7 @@ DUK_LOCAL void duk__enc_objarr_entry(duk_json_enc_ctx *js_ctx, duk_idx_t *entry_
 	DUK_ASSERT_DISABLE(js_ctx->recursion_depth >= 0);  /* unsigned */
 	DUK_ASSERT(js_ctx->recursion_depth <= js_ctx->recursion_limit);
 	if (js_ctx->recursion_depth >= js_ctx->recursion_limit) {
-		DUK_ERROR_RANGE(thr, DUK_STR_JSONENC_RECLIMIT);
+		DUK_ERROR_RANGE(thr, DUK_STR_ENC_RECLIMIT);
 		DUK_WO_NORETURN(return;);
 	}
 	js_ctx->recursion_depth++;
@@ -36132,7 +38144,7 @@ DUK_LOCAL void duk__enc_objarr_entry(duk_json_enc_ctx *js_ctx, duk_idx_t *entry_
 }
 
 /* Shared exit handling for object/array serialization. */
-DUK_LOCAL void duk__enc_objarr_exit(duk_json_enc_ctx *js_ctx, duk_idx_t *entry_top) {
+DUK_LOCAL void duk__json_enc_objarr_exit(duk_json_enc_ctx *js_ctx, duk_idx_t *entry_top) {
 	duk_hthread *thr = js_ctx->thr;
 	duk_hobject *h_target;
 
@@ -36164,7 +38176,7 @@ DUK_LOCAL void duk__enc_objarr_exit(duk_json_enc_ctx *js_ctx, duk_idx_t *entry_t
  *
  * Stack policy: [ object ] -> [ object ].
  */
-DUK_LOCAL void duk__enc_object(duk_json_enc_ctx *js_ctx) {
+DUK_LOCAL void duk__json_enc_object(duk_json_enc_ctx *js_ctx) {
 	duk_hthread *thr = js_ctx->thr;
 	duk_hstring *h_key;
 	duk_idx_t entry_top;
@@ -36174,9 +38186,9 @@ DUK_LOCAL void duk__enc_object(duk_json_enc_ctx *js_ctx) {
 	duk_uarridx_t arr_len, i;
 	duk_size_t prev_size;
 
-	DUK_DDD(DUK_DDDPRINT("duk__enc_object: obj=%!T", (duk_tval *) duk_get_tval(thr, -1)));
+	DUK_DDD(DUK_DDDPRINT("duk__json_enc_object: obj=%!T", (duk_tval *) duk_get_tval(thr, -1)));
 
-	duk__enc_objarr_entry(js_ctx, &entry_top);
+	duk__json_enc_objarr_entry(js_ctx, &entry_top);
 
 	idx_obj = entry_top - 1;
 
@@ -36218,17 +38230,17 @@ DUK_LOCAL void duk__enc_object(duk_json_enc_ctx *js_ctx) {
 
 		prev_size = DUK_BW_GET_SIZE(js_ctx->thr, &js_ctx->bw);
 		if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) {
-			duk__enc_newline_indent(js_ctx, js_ctx->recursion_depth);
-			duk__enc_key_autoquote(js_ctx, h_key);
+			duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth);
+			duk__json_enc_key_autoquote(js_ctx, h_key);
 			DUK__EMIT_2(js_ctx, DUK_ASC_COLON, DUK_ASC_SPACE);
 		} else {
-			duk__enc_key_autoquote(js_ctx, h_key);
+			duk__json_enc_key_autoquote(js_ctx, h_key);
 			DUK__EMIT_1(js_ctx, DUK_ASC_COLON);
 		}
 
 		/* [ ... key ] */
 
-		if (DUK_UNLIKELY(duk__enc_value(js_ctx, idx_obj) == 0)) {
+		if (DUK_UNLIKELY(duk__json_enc_value(js_ctx, idx_obj) == 0)) {
 			/* Value would yield 'undefined', so skip key altogether.
 			 * Side effects have already happened.
 			 */
@@ -36246,12 +38258,12 @@ DUK_LOCAL void duk__enc_object(duk_json_enc_ctx *js_ctx) {
 		DUK__UNEMIT_1(js_ctx);  /* eat trailing comma */
 		if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) {
 			DUK_ASSERT(js_ctx->recursion_depth >= 1);
-			duk__enc_newline_indent(js_ctx, js_ctx->recursion_depth - 1U);
+			duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth - 1U);
 		}
 	}
 	DUK__EMIT_1(js_ctx, DUK_ASC_RCURLY);
 
-	duk__enc_objarr_exit(js_ctx, &entry_top);
+	duk__json_enc_objarr_exit(js_ctx, &entry_top);
 
 	DUK_ASSERT_TOP(thr, entry_top);
 }
@@ -36260,17 +38272,17 @@ DUK_LOCAL void duk__enc_object(duk_json_enc_ctx *js_ctx) {
  *
  * Stack policy: [ array ] -> [ array ].
  */
-DUK_LOCAL void duk__enc_array(duk_json_enc_ctx *js_ctx) {
+DUK_LOCAL void duk__json_enc_array(duk_json_enc_ctx *js_ctx) {
 	duk_hthread *thr = js_ctx->thr;
 	duk_idx_t entry_top;
 	duk_idx_t idx_arr;
 	duk_bool_t emitted;
 	duk_uarridx_t i, arr_len;
 
-	DUK_DDD(DUK_DDDPRINT("duk__enc_array: array=%!T",
+	DUK_DDD(DUK_DDDPRINT("duk__json_enc_array: array=%!T",
 	                     (duk_tval *) duk_get_tval(thr, -1)));
 
-	duk__enc_objarr_entry(js_ctx, &entry_top);
+	duk__json_enc_objarr_entry(js_ctx, &entry_top);
 
 	idx_arr = entry_top - 1;
 
@@ -36287,14 +38299,14 @@ DUK_LOCAL void duk__enc_array(duk_json_enc_ctx *js_ctx) {
 
 		if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) {
 			DUK_ASSERT(js_ctx->recursion_depth >= 1);
-			duk__enc_newline_indent(js_ctx, js_ctx->recursion_depth);
+			duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth);
 		}
 
 		(void) duk_push_uint_to_hstring(thr, (duk_uint_t) i);  /* -> [ ... key ] */
 
 		/* [ ... key ] */
 
-		if (DUK_UNLIKELY(duk__enc_value(js_ctx, idx_arr) == 0)) {
+		if (DUK_UNLIKELY(duk__json_enc_value(js_ctx, idx_arr) == 0)) {
 			/* Value would normally be omitted, replace with 'null'. */
 			DUK__EMIT_STRIDX(js_ctx, DUK_STRIDX_LC_NULL);
 		} else {
@@ -36312,12 +38324,12 @@ DUK_LOCAL void duk__enc_array(duk_json_enc_ctx *js_ctx) {
 		DUK__UNEMIT_1(js_ctx);  /* eat trailing comma */
 		if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) {
 			DUK_ASSERT(js_ctx->recursion_depth >= 1);
-			duk__enc_newline_indent(js_ctx, js_ctx->recursion_depth - 1U);
+			duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth - 1U);
 		}
 	}
 	DUK__EMIT_1(js_ctx, DUK_ASC_RBRACKET);
 
-	duk__enc_objarr_exit(js_ctx, &entry_top);
+	duk__json_enc_objarr_exit(js_ctx, &entry_top);
 
 	DUK_ASSERT_TOP(thr, entry_top);
 }
@@ -36326,14 +38338,14 @@ DUK_LOCAL void duk__enc_array(duk_json_enc_ctx *js_ctx) {
  *
  * Stack policy: [ ... key ] -> [ ... ]
  */
-DUK_LOCAL duk_bool_t duk__enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_holder) {
+DUK_LOCAL duk_bool_t duk__json_enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_holder) {
 	duk_hthread *thr = js_ctx->thr;
 	duk_tval *tv;
 	duk_tval *tv_holder;
 	duk_tval *tv_key;
 	duk_small_int_t c;
 
-	DUK_DDD(DUK_DDDPRINT("duk__enc_value: idx_holder=%ld, holder=%!T, key=%!T",
+	DUK_DDD(DUK_DDDPRINT("duk__json_enc_value: idx_holder=%ld, holder=%!T, key=%!T",
 	                     (long) idx_holder, (duk_tval *) duk_get_tval(thr, idx_holder),
 	                     (duk_tval *) duk_get_tval(thr, -1)));
 
@@ -36403,7 +38415,7 @@ DUK_LOCAL duk_bool_t duk__enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_hold
 			duk_hbufobj *h_bufobj;
 			h_bufobj = (duk_hbufobj *) h;
 			DUK_HBUFOBJ_ASSERT_VALID(h_bufobj);
-			duk__enc_bufobj(js_ctx, h_bufobj);
+			duk__json_enc_bufobj(js_ctx, h_bufobj);
 			goto pop2_emitted;
 		}
 		/* Otherwise bufferobjects get serialized as normal objects. */
@@ -36499,7 +38511,7 @@ DUK_LOCAL duk_bool_t duk__enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_hold
 #if defined(DUK_USE_JX) || defined(DUK_USE_JC)
 	/* When JX/JC not in use, the type mask above will avoid this case if needed. */
 	case DUK_TAG_POINTER: {
-		duk__enc_pointer(js_ctx, DUK_TVAL_GET_POINTER(tv));
+		duk__json_enc_pointer(js_ctx, DUK_TVAL_GET_POINTER(tv));
 		break;
 	}
 #endif  /* DUK_USE_JX || DUK_USE_JC */
@@ -36509,7 +38521,7 @@ DUK_LOCAL duk_bool_t duk__enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_hold
 		if (DUK_UNLIKELY(DUK_HSTRING_HAS_SYMBOL(h))) {
 			goto pop2_undef;
 		}
-		duk__enc_quote_string(js_ctx, h);
+		duk__json_enc_quote_string(js_ctx, h);
 		break;
 	}
 	case DUK_TAG_OBJECT: {
@@ -36521,10 +38533,10 @@ DUK_LOCAL duk_bool_t duk__enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_hold
 		 */
 		DUK_ASSERT(!DUK_HOBJECT_IS_CALLABLE(h));
 
-		if (DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_ARRAY) {
-			duk__enc_array(js_ctx);
+		if (duk_js_isarray_hobject(h)) {
+			duk__json_enc_array(js_ctx);
 		} else {
-			duk__enc_object(js_ctx);
+			duk__json_enc_object(js_ctx);
 		}
 		break;
 	}
@@ -36537,7 +38549,7 @@ DUK_LOCAL duk_bool_t duk__enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_hold
 	case DUK_TAG_BUFFER: {
 #if defined(DUK_USE_JX) || defined(DUK_USE_JC)
 		if (js_ctx->flag_ext_custom_or_compatible) {
-			duk__enc_buffer_jx_jc(js_ctx, DUK_TVAL_GET_BUFFER(tv));
+			duk__json_enc_buffer_jx_jc(js_ctx, DUK_TVAL_GET_BUFFER(tv));
 			break;
 		}
 #endif
@@ -36546,7 +38558,7 @@ DUK_LOCAL duk_bool_t duk__enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_hold
 		 * to handle realloc side effects correctly.
 		 */
 		duk_to_object(thr, -1);
-		duk__enc_object(js_ctx);
+		duk__json_enc_object(js_ctx);
 		break;
 	}
 	case DUK_TAG_LIGHTFUNC: {
@@ -36565,7 +38577,7 @@ DUK_LOCAL duk_bool_t duk__enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_hold
 		/* Number serialization has a significant impact relative to
 		 * other fast path code, so careful fast path for fastints.
 		 */
-		duk__enc_fastint_tval(js_ctx, tv);
+		duk__json_enc_fastint_tval(js_ctx, tv);
 		break;
 #endif
 	default: {
@@ -36575,7 +38587,7 @@ DUK_LOCAL duk_bool_t duk__enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_hold
 		/* XXX: A fast path for usual integers would be useful when
 		 * fastint support is not enabled.
 		 */
-		duk__enc_double(js_ctx);
+		duk__json_enc_double(js_ctx);
 		break;
 	}
 	}
@@ -36592,7 +38604,7 @@ DUK_LOCAL duk_bool_t duk__enc_value(duk_json_enc_ctx *js_ctx, duk_idx_t idx_hold
 }
 
 /* E5 Section 15.12.3, main algorithm, step 4.b.ii steps 1-4. */
-DUK_LOCAL duk_bool_t duk__enc_allow_into_proplist(duk_tval *tv) {
+DUK_LOCAL duk_bool_t duk__json_enc_allow_into_proplist(duk_tval *tv) {
 	duk_small_int_t c;
 
 	/* XXX: some kind of external internal type checker?
@@ -36675,7 +38687,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
 		if (DUK_UNLIKELY(DUK_HSTRING_HAS_SYMBOL(h))) {
 			goto emit_undefined;
 		}
-		duk__enc_quote_string(js_ctx, h);
+		duk__json_enc_quote_string(js_ctx, h);
 		break;
 	}
 	case DUK_TAG_OBJECT: {
@@ -36720,7 +38732,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
 		DUK_ASSERT(js_ctx->recursion_depth <= js_ctx->recursion_limit);
 		if (js_ctx->recursion_depth >= js_ctx->recursion_limit) {
 			DUK_DD(DUK_DDPRINT("fast path recursion limit"));
-			DUK_ERROR_RANGE(js_ctx->thr, DUK_STR_JSONDEC_RECLIMIT);
+			DUK_ERROR_RANGE(js_ctx->thr, DUK_STR_DEC_RECLIMIT);
 			DUK_WO_NORETURN(return 0;);
 		}
 
@@ -36847,11 +38859,11 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
 
 				prev_size = DUK_BW_GET_SIZE(js_ctx->thr, &js_ctx->bw);
 				if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) {
-					duk__enc_newline_indent(js_ctx, js_ctx->recursion_depth);
-					duk__enc_key_autoquote(js_ctx, k);
+					duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth);
+					duk__json_enc_key_autoquote(js_ctx, k);
 					DUK__EMIT_2(js_ctx, DUK_ASC_COLON, DUK_ASC_SPACE);
 				} else {
-					duk__enc_key_autoquote(js_ctx, k);
+					duk__json_enc_key_autoquote(js_ctx, k);
 					DUK__EMIT_1(js_ctx, DUK_ASC_COLON);
 				}
 
@@ -36874,7 +38886,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
 				DUK__UNEMIT_1(js_ctx);  /* eat trailing comma */
 				if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) {
 					DUK_ASSERT(js_ctx->recursion_depth >= 1);
-					duk__enc_newline_indent(js_ctx, js_ctx->recursion_depth - 1U);
+					duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth - 1U);
 				}
 			}
 			DUK__EMIT_1(js_ctx, DUK_ASC_RCURLY);
@@ -36902,7 +38914,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
 				duk_bool_t has_inherited;
 
 				if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) {
-					duk__enc_newline_indent(js_ctx, js_ctx->recursion_depth);
+					duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth);
 				}
 
 				if (DUK_LIKELY(i < asize)) {
@@ -36951,7 +38963,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
 				DUK__UNEMIT_1(js_ctx);  /* eat trailing comma */
 				if (DUK_UNLIKELY(js_ctx->h_gap != NULL)) {
 					DUK_ASSERT(js_ctx->recursion_depth >= 1);
-					duk__enc_newline_indent(js_ctx, js_ctx->recursion_depth - 1U);
+					duk__json_enc_newline_indent(js_ctx, js_ctx->recursion_depth - 1U);
 				}
 			}
 			DUK__EMIT_1(js_ctx, DUK_ASC_RBRACKET);
@@ -36993,7 +39005,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
 			DUK__EMIT_STRIDX(js_ctx, js_ctx->stridx_custom_function);
 #if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
 		} else if (c_bit & c_bufobj) {
-			duk__enc_bufobj(js_ctx, (duk_hbufobj *) obj);
+			duk__json_enc_bufobj(js_ctx, (duk_hbufobj *) obj);
 #endif
 #endif
 		} else if (c_bit & c_abort) {
@@ -37033,7 +39045,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
 
 #if defined(DUK_USE_JX) || defined(DUK_USE_JC)
 		if (js_ctx->flag_ext_custom_or_compatible) {
-			duk__enc_buffer_jx_jc(js_ctx, DUK_TVAL_GET_BUFFER(tv));
+			duk__json_enc_buffer_jx_jc(js_ctx, DUK_TVAL_GET_BUFFER(tv));
 			break;
 		}
 #endif
@@ -37041,13 +39053,13 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
 		/* Plain buffers mimic Uint8Arrays, and have enumerable index
 		 * properties.
 		 */
-		duk__enc_buffer_json_fastpath(js_ctx, DUK_TVAL_GET_BUFFER(tv));
+		duk__json_enc_buffer_json_fastpath(js_ctx, DUK_TVAL_GET_BUFFER(tv));
 		break;
 	}
 	case DUK_TAG_POINTER: {
 #if defined(DUK_USE_JX) || defined(DUK_USE_JC)
 		if (js_ctx->flag_ext_custom_or_compatible) {
-			duk__enc_pointer(js_ctx, DUK_TVAL_GET_POINTER(tv));
+			duk__json_enc_pointer(js_ctx, DUK_TVAL_GET_POINTER(tv));
 			break;
 		} else {
 			goto emit_undefined;
@@ -37069,7 +39081,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
 		/* Number serialization has a significant impact relative to
 		 * other fast path code, so careful fast path for fastints.
 		 */
-		duk__enc_fastint_tval(js_ctx, tv);
+		duk__json_enc_fastint_tval(js_ctx, tv);
 		break;
 	}
 #endif
@@ -37082,7 +39094,7 @@ DUK_LOCAL duk_bool_t duk__json_stringify_fast_value(duk_json_enc_ctx *js_ctx, du
 
 		/* XXX: Stack discipline is annoying, could be changed in numconv. */
 		duk_push_tval(js_ctx->thr, tv);
-		duk__enc_double(js_ctx);
+		duk__json_enc_double(js_ctx);
 		duk_pop(js_ctx->thr);
 
 #if 0
@@ -37194,14 +39206,15 @@ void duk_bi_json_parse_helper(duk_hthread *thr,
 	                DUK_HSTRING_GET_BYTELEN(h_text);
 	DUK_ASSERT(*(js_ctx->p_end) == 0x00);
 
-	duk__dec_value(js_ctx);  /* -> [ ... value ] */
+	duk__json_dec_value(js_ctx);  /* -> [ ... value ] */
+	DUK_ASSERT(js_ctx->recursion_depth == 0);
 
-	/* Trailing whitespace has been eaten by duk__dec_value(), so if
+	/* Trailing whitespace has been eaten by duk__json_dec_value(), so if
 	 * we're not at end of input here, it's a SyntaxError.
 	 */
 
 	if (js_ctx->p != js_ctx->p_end) {
-		duk__dec_syntax_error(js_ctx);
+		duk__json_dec_syntax_error(js_ctx);
 	}
 
 	if (duk_is_callable(thr, idx_reviver)) {
@@ -37219,7 +39232,9 @@ void duk_bi_json_parse_helper(duk_hthread *thr,
 		                     (duk_tval *) duk_get_tval(thr, -2),
 		                     (duk_tval *) duk_get_tval(thr, -1)));
 
-		duk__dec_reviver_walk(js_ctx);  /* [ ... val root "" ] -> [ ... val val' ] */
+		DUK_ASSERT(js_ctx->recursion_depth == 0);
+		duk__json_dec_reviver_walk(js_ctx);  /* [ ... val root "" ] -> [ ... val val' ] */
+		DUK_ASSERT(js_ctx->recursion_depth == 0);
 		duk_remove_m2(thr);             /* -> [ ... val' ] */
 	} else {
 		DUK_DDD(DUK_DDDPRINT("reviver does not exist or is not callable: %!T",
@@ -37357,7 +39372,7 @@ void duk_bi_json_stringify_helper(duk_hthread *thr,
 	if (h != NULL) {
 		if (DUK_HOBJECT_IS_CALLABLE(h)) {
 			js_ctx->h_replacer = h;
-		} else if (DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_ARRAY) {
+		} else if (duk_js_isarray_hobject(h)) {
 			/* Here the specification requires correct array index enumeration
 			 * which is a bit tricky for sparse arrays (it is handled by the
 			 * enum setup code).  We now enumerate ancestors too, although the
@@ -37367,14 +39382,14 @@ void duk_bi_json_stringify_helper(duk_hthread *thr,
 			duk_uarridx_t plist_idx = 0;
 			duk_small_uint_t enum_flags;
 
-			js_ctx->idx_proplist = duk_push_array(thr);  /* XXX: array internal? */
+			js_ctx->idx_proplist = duk_push_bare_array(thr);
 
 			enum_flags = DUK_ENUM_ARRAY_INDICES_ONLY |
 			             DUK_ENUM_SORT_ARRAY_INDICES;  /* expensive flag */
 			duk_enum(thr, idx_replacer, enum_flags);
 			while (duk_next(thr, -1 /*enum_index*/, 1 /*get_value*/)) {
 				/* [ ... proplist enum_obj key val ] */
-				if (duk__enc_allow_into_proplist(duk_get_tval(thr, -1))) {
+				if (duk__json_enc_allow_into_proplist(duk_get_tval(thr, -1))) {
 					/* XXX: duplicates should be eliminated here */
 					DUK_DDD(DUK_DDDPRINT("proplist enum: key=%!T, val=%!T --> accept",
 					                     (duk_tval *) duk_get_tval(thr, -2),
@@ -37534,7 +39549,7 @@ void duk_bi_json_stringify_helper(duk_hthread *thr,
 	js_ctx->recursion_limit = DUK_USE_JSON_ENC_RECLIMIT;
 	DUK_ASSERT(js_ctx->recursion_depth == 0);
 
-	if (DUK_UNLIKELY(duk__enc_value(js_ctx, idx_holder) == 0)) {  /* [ ... holder key ] -> [ ... holder ] */
+	if (DUK_UNLIKELY(duk__json_enc_value(js_ctx, idx_holder) == 0)) {  /* [ ... holder key ] -> [ ... holder ] */
 		/* Result is undefined. */
 		duk_push_undefined(thr);
 	} else {
@@ -37668,7 +39683,7 @@ DUK_LOCAL double duk__fmin_fixed(double x, double y) {
 	/* fmin() with args -0 and +0 is not guaranteed to return
 	 * -0 as ECMAScript requires.
 	 */
-	if (x == 0 && y == 0) {
+	if (duk_double_equals(x, 0.0) && duk_double_equals(y, 0.0)) {
 		duk_double_union du1, du2;
 		du1.d = x;
 		du2.d = y;
@@ -37695,7 +39710,7 @@ DUK_LOCAL double duk__fmax_fixed(double x, double y) {
 	/* fmax() with args -0 and +0 is not guaranteed to return
 	 * +0 as ECMAScript requires.
 	 */
-	if (x == 0 && y == 0) {
+	if (duk_double_equals(x, 0.0) && duk_double_equals(y, 0.0)) {
 		if (DUK_SIGNBIT(x) == 0 || DUK_SIGNBIT(y) == 0) {
 			return +0.0;
 		} else {
@@ -37862,10 +39877,11 @@ DUK_LOCAL double duk__atan2_fixed(double x, double y) {
 	}
 #else
 	/* Some ISO C assumptions. */
-	DUK_ASSERT(DUK_ATAN2(DUK_DOUBLE_INFINITY, DUK_DOUBLE_INFINITY) == 0.7853981633974483);
-	DUK_ASSERT(DUK_ATAN2(-DUK_DOUBLE_INFINITY, DUK_DOUBLE_INFINITY) == -0.7853981633974483);
-	DUK_ASSERT(DUK_ATAN2(DUK_DOUBLE_INFINITY, -DUK_DOUBLE_INFINITY) == 2.356194490192345);
-	DUK_ASSERT(DUK_ATAN2(-DUK_DOUBLE_INFINITY, -DUK_DOUBLE_INFINITY) == -2.356194490192345);
+
+	DUK_ASSERT(duk_double_equals(DUK_ATAN2(DUK_DOUBLE_INFINITY, DUK_DOUBLE_INFINITY), 0.7853981633974483));
+	DUK_ASSERT(duk_double_equals(DUK_ATAN2(-DUK_DOUBLE_INFINITY, DUK_DOUBLE_INFINITY), -0.7853981633974483));
+	DUK_ASSERT(duk_double_equals(DUK_ATAN2(DUK_DOUBLE_INFINITY, -DUK_DOUBLE_INFINITY), 2.356194490192345));
+	DUK_ASSERT(duk_double_equals(DUK_ATAN2(-DUK_DOUBLE_INFINITY, -DUK_DOUBLE_INFINITY), -2.356194490192345));
 #endif
 
 	return DUK_ATAN2(x, y);
@@ -38005,13 +40021,13 @@ DUK_INTERNAL duk_ret_t duk_bi_math_object_hypot(duk_hthread *thr) {
 	}
 
 	/* Early return cases. */
-	if (max == DUK_DOUBLE_INFINITY) {
+	if (duk_double_equals(max, DUK_DOUBLE_INFINITY)) {
 		duk_push_number(thr, DUK_DOUBLE_INFINITY);
 		return 1;
 	} else if (found_nan) {
 		duk_push_number(thr, DUK_DOUBLE_NAN);
 		return 1;
-	} else if (max == 0.0) {
+	} else if (duk_double_equals(max, 0.0)) {
 		duk_push_number(thr, 0.0);
 		/* Otherwise we'd divide by zero. */
 		return 1;
@@ -38046,7 +40062,7 @@ DUK_INTERNAL duk_ret_t duk_bi_math_object_sign(duk_hthread *thr) {
 		DUK_ASSERT(duk_is_nan(thr, -1));
 		return 1;  /* NaN input -> return NaN */
 	}
-	if (d == 0.0) {
+	if (duk_double_equals(d, 0.0)) {
 		/* Zero sign kept, i.e. -0 -> -0, +0 -> +0. */
 		return 1;
 	}
@@ -39429,7 +41445,9 @@ DUK_INTERNAL void duk_proxy_ownkeys_postprocess(duk_hthread *thr, duk_hobject *h
 		}
 
 		/* [ obj trap_result res_arr propname ] */
-		duk_put_prop_index(thr, -2, idx++);
+		duk_push_uarridx(thr, idx++);
+		duk_insert(thr, -2);
+		duk_def_prop(thr, -3, DUK_DEFPROP_HAVE_VALUE | DUK_DEFPROP_SET_WEC);
 		continue;
 
 	 skip_key:
@@ -40451,6 +42469,7 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) {
 #endif  /* DUK_USE_REGEXP_SUPPORT */
 			const duk_uint8_t *p_start, *p_end, *p;   /* input string scan */
 			const duk_uint8_t *q_start;               /* match string */
+			duk_size_t p_blen;
 			duk_size_t q_blen;
 
 #if defined(DUK_USE_REGEXP_SUPPORT)
@@ -40459,13 +42478,19 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_replace(duk_hthread *thr) {
 
 			p_start = DUK_HSTRING_GET_DATA(h_input);
 			p_end = p_start + DUK_HSTRING_GET_BYTELEN(h_input);
+			p_blen = (duk_size_t) DUK_HSTRING_GET_BYTELEN(h_input);
 			p = p_start;
 
 			h_search = duk_known_hstring(thr, 0);
 			q_start = DUK_HSTRING_GET_DATA(h_search);
 			q_blen = (duk_size_t) DUK_HSTRING_GET_BYTELEN(h_search);
 
+			if (q_blen > p_blen) {
+				break;  /* no match */
+			}
+
 			p_end -= q_blen;  /* ensure full memcmp() fits in while */
+			DUK_ASSERT(p_end >= p);
 
 			match_start_coff = 0;
 
@@ -41280,44 +43305,65 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_locale_compare(duk_hthread *thr)
 #if defined(DUK_USE_ES6)
 DUK_INTERNAL duk_ret_t duk_bi_string_prototype_startswith_endswith(duk_hthread *thr) {
 	duk_int_t magic;
-	duk_hstring *h;
+	duk_hstring *h_target;
+	duk_size_t blen_target;
 	duk_hstring *h_search;
 	duk_size_t blen_search;
-	const duk_uint8_t *p_cmp_start;
-	duk_bool_t result;
+	duk_int_t off;
+	duk_bool_t result = 0;
+	duk_size_t blen_left;
 
-	h = duk_push_this_coercible_to_string(thr);
-	DUK_ASSERT(h != NULL);
+	/* Because string byte lengths are in [0,DUK_INT_MAX] it's safe to
+	 * subtract two string lengths without overflow.
+	 */
+	DUK_ASSERT(DUK_HSTRING_MAX_BYTELEN <= DUK_INT_MAX);
+
+	h_target = duk_push_this_coercible_to_string(thr);
+	DUK_ASSERT(h_target != NULL);
 
 	h_search = duk__str_tostring_notregexp(thr, 0);
 	DUK_ASSERT(h_search != NULL);
 
 	magic = duk_get_current_magic(thr);
 
-	p_cmp_start = (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h);
+	/* Careful to avoid pointer overflows in the matching logic. */
+
+	blen_target = DUK_HSTRING_GET_BYTELEN(h_target);
 	blen_search = DUK_HSTRING_GET_BYTELEN(h_search);
 
+#if 0
+	/* If search string is longer than the target string, we can
+	 * never match.  Could check explicitly, but should be handled
+	 * correctly below.
+	 */
+	if (blen_search > blen_target) {
+		goto finish;
+	}
+#endif
+
+	off = 0;
 	if (duk_is_undefined(thr, 1)) {
 		if (magic) {
-			p_cmp_start = p_cmp_start + DUK_HSTRING_GET_BYTELEN(h) - blen_search;
+			off = (duk_int_t) blen_target - (duk_int_t) blen_search;
 		} else {
-			/* p_cmp_start already OK */
+			DUK_ASSERT(off == 0);
 		}
 	} else {
 		duk_int_t len;
 		duk_int_t pos;
 
 		DUK_ASSERT(DUK_HSTRING_MAX_BYTELEN <= DUK_INT_MAX);
-		len = (duk_int_t) DUK_HSTRING_GET_CHARLEN(h);
+		len = (duk_int_t) DUK_HSTRING_GET_CHARLEN(h_target);
 		pos = duk_to_int_clamped(thr, 1, 0, len);
 		DUK_ASSERT(pos >= 0 && pos <= len);
 
+		off = (duk_int_t) duk_heap_strcache_offset_char2byte(thr, h_target, (duk_uint_fast32_t) pos);
 		if (magic) {
-			p_cmp_start -= blen_search;  /* Conceptually subtracted last, but do already here. */
+			off -= (duk_int_t) blen_search;
 		}
-		DUK_ASSERT(pos >= 0 && pos <= len);
-
-		p_cmp_start += duk_heap_strcache_offset_char2byte(thr, h, (duk_uint_fast32_t) pos);
+	}
+	if (off < 0 || off > (duk_int_t) blen_target) {
+		goto finish;
 	}
 
 	/* The main comparison can be done using a memcmp() rather than
@@ -41327,16 +43373,18 @@ DUK_INTERNAL duk_ret_t duk_bi_string_prototype_startswith_endswith(duk_hthread *
 	 * comparison range.
 	 */
 
-	result = 0;
-	if (p_cmp_start >= DUK_HSTRING_GET_DATA(h) &&
-	    (duk_size_t) (p_cmp_start - (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h)) + blen_search <= DUK_HSTRING_GET_BYTELEN(h)) {
-		if (duk_memcmp((const void *) p_cmp_start,
-		               (const void *) DUK_HSTRING_GET_DATA(h_search),
-		               (size_t) blen_search) == 0) {
+	DUK_ASSERT(off >= 0);
+	DUK_ASSERT((duk_size_t) off <= blen_target);
+	blen_left = blen_target - (duk_size_t) off;
+	if (blen_left >= blen_search) {
+		const duk_uint8_t *p_cmp_start = (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h_target) + off;
+		const duk_uint8_t *p_search = (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h_search);
+		if (duk_memcmp_unsafe((const void *) p_cmp_start, (const void *) p_search, (size_t) blen_search) == 0) {
 			result = 1;
 		}
 	}
 
+ finish:
 	duk_push_boolean(thr, result);
 	return 1;
 }
@@ -46388,7 +48436,28 @@ DUK_LOCAL void duk__add_compiler_error_line(duk_hthread *thr) {
 	                     (duk_tval *) duk_get_tval(thr, -1)));
 
 	if (duk_get_prop_stridx_short(thr, -1, DUK_STRIDX_MESSAGE)) {
-		duk_push_sprintf(thr, " (line %ld)", (long) thr->compile_ctx->curr_token.start_line);
+		duk_bool_t at_end;
+
+		/* Best guesstimate that error occurred at end of input, token
+		 * truncated by end of input, etc.
+		 */
+#if 0
+		at_end = (thr->compile_ctx->curr_token.start_offset + 1 >= thr->compile_ctx->lex.input_length);
+		at_end = (thr->compile_ctx->lex.window[0].codepoint < 0 || thr->compile_ctx->lex.window[1].codepoint < 0);
+#endif
+		at_end = (thr->compile_ctx->lex.window[0].codepoint < 0);
+
+		DUK_D(DUK_DPRINT("syntax error, determined at_end=%ld; curr_token.start_offset=%ld, "
+		                 "lex.input_length=%ld, window[0].codepoint=%ld, window[1].codepoint=%ld",
+		                 (long) at_end,
+		                 (long) thr->compile_ctx->curr_token.start_offset,
+		                 (long) thr->compile_ctx->lex.input_length,
+		                 (long) thr->compile_ctx->lex.window[0].codepoint,
+		                 (long) thr->compile_ctx->lex.window[1].codepoint));
+
+		duk_push_sprintf(thr, " (line %ld%s)",
+		                 (long) thr->compile_ctx->curr_token.start_line,
+		                 at_end ? ", end of input" : "");
 		duk_concat(thr, 2);
 		duk_put_prop_stridx_short(thr, -2, DUK_STRIDX_MESSAGE);
 	} else {
@@ -50195,6 +52264,7 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags
 #if defined(DUK_USE_VOLUNTARY_GC)
 	duk_size_t tmp;
 #endif
+	duk_bool_t entry_creating_error;
 
 	DUK_STATS_INC(heap, stats_ms_try_count);
 #if defined(DUK_USE_DEBUG)
@@ -50265,6 +52335,8 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags
 	DUK_ASSERT(heap->ms_running == 0);
 	heap->ms_prevent_count = 1;
 	heap->ms_running = 1;
+	entry_creating_error = heap->creating_error;
+	heap->creating_error = 0;
 
 	/*
 	 *  Free activation/catcher freelists on every mark-and-sweep for now.
@@ -50395,6 +52467,7 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags
 	DUK_ASSERT(heap->ms_running == 1);
 	heap->ms_prevent_count = 0;
 	heap->ms_running = 0;
+	heap->creating_error = entry_creating_error;  /* for nested error handling, see GH-2278 */
 
 	/*
 	 *  Assertions after
@@ -50482,84 +52555,31 @@ DUK_INTERNAL void duk_heap_mark_and_sweep(duk_heap *heap, duk_small_uint_t flags
 /* #include duk_internal.h -> already included */
 
 /*
- *  Voluntary GC check
- */
-
-#if defined(DUK_USE_VOLUNTARY_GC)
-DUK_LOCAL DUK_INLINE void duk__check_voluntary_gc(duk_heap *heap) {
-	if (DUK_UNLIKELY(--(heap)->ms_trigger_counter < 0)) {
-#if defined(DUK_USE_DEBUG)
-		if (heap->ms_prevent_count == 0) {
-			DUK_D(DUK_DPRINT("triggering voluntary mark-and-sweep"));
-		} else {
-			DUK_DD(DUK_DDPRINT("gc blocked -> skip voluntary mark-and-sweep now"));
-		}
-#endif
-
-		/* Prevention checks in the call target handle cases where
-		 * voluntary GC is not allowed.  The voluntary GC trigger
-		 * counter is only rewritten if mark-and-sweep actually runs.
-		 */
-		duk_heap_mark_and_sweep(heap, DUK_MS_FLAG_VOLUNTARY /*flags*/);
-	}
-}
-#define DUK__VOLUNTARY_PERIODIC_GC(heap)  do { duk__check_voluntary_gc((heap)); } while (0)
-#else
-#define DUK__VOLUNTARY_PERIODIC_GC(heap)  /* no voluntary gc */
-#endif  /* DUK_USE_VOLUNTARY_GC */
-
-/*
- *  Allocate memory with garbage collection
+ *  Allocate memory with garbage collection.
  */
 
-DUK_INTERNAL void *duk_heap_mem_alloc(duk_heap *heap, duk_size_t size) {
+/* Slow path: voluntary GC triggered, first alloc attempt failed, or zero size. */
+DUK_LOCAL DUK_NOINLINE_PERF DUK_COLD void *duk__heap_mem_alloc_slowpath(duk_heap *heap, duk_size_t size) {
 	void *res;
 	duk_small_int_t i;
 
 	DUK_ASSERT(heap != NULL);
+	DUK_ASSERT(heap->alloc_func != NULL);
 	DUK_ASSERT_DISABLE(size >= 0);
 
-	/*
-	 *  Voluntary periodic GC (if enabled)
-	 */
-
-	DUK__VOLUNTARY_PERIODIC_GC(heap);
-
-	/*
-	 *  First attempt
-	 */
-
-#if defined(DUK_USE_GC_TORTURE)
-	/* Simulate alloc failure on every alloc, except when mark-and-sweep
-	 * is running.
-	 */
-	if (heap->ms_prevent_count == 0) {
-		DUK_DDD(DUK_DDDPRINT("gc torture enabled, pretend that first alloc attempt fails"));
-		res = NULL;
-		DUK_UNREF(res);
-		goto skip_attempt;
-	}
-#endif
-	res = heap->alloc_func(heap->heap_udata, size);
-	if (DUK_LIKELY(res || size == 0)) {
-		/* For zero size allocations NULL is allowed. */
-		return res;
+	if (size == 0) {
+		DUK_D(DUK_DPRINT("zero size alloc in slow path, return NULL"));
+		return NULL;
 	}
-#if defined(DUK_USE_GC_TORTURE)
- skip_attempt:
-#endif
 
-	DUK_D(DUK_DPRINT("first alloc attempt failed, attempt to gc and retry"));
+	DUK_D(DUK_DPRINT("first alloc attempt failed or voluntary GC limit reached, attempt to gc and retry"));
 
 #if 0
 	/*
-	 *  Avoid a GC if GC is already running.  This can happen at a late
-	 *  stage in a GC when we try to e.g. resize the stringtable
-	 *  or compact objects.
-	 *
-	 *  NOTE: explicit handling isn't actually be needed: if the GC is
-	 *  not allowed, duk_heap_mark_and_sweep() will reject it for every
-	 *  attempt in the loop below, resulting in a NULL same as here.
+	 *  If GC is already running there is no point in attempting a GC
+	 *  because it will be skipped.  This could be checked for explicitly,
+	 *  but it isn't actually needed: the loop below will eventually
+	 *  fail resulting in a NULL.
 	 */
 
 	if (heap->ms_prevent_count != 0) {
@@ -50584,8 +52604,9 @@ DUK_INTERNAL void *duk_heap_mem_alloc(duk_heap *heap, duk_size_t size) {
 
 		duk_heap_mark_and_sweep(heap, flags);
 
+		DUK_ASSERT(size > 0);
 		res = heap->alloc_func(heap->heap_udata, size);
-		if (res) {
+		if (res != NULL) {
 			DUK_D(DUK_DPRINT("duk_heap_mem_alloc() succeeded after gc (pass %ld), alloc size %ld",
 			                 (long) (i + 1), (long) size));
 			return res;
@@ -50596,10 +52617,56 @@ DUK_INTERNAL void *duk_heap_mem_alloc(duk_heap *heap, duk_size_t size) {
 	return NULL;
 }
 
-DUK_INTERNAL void *duk_heap_mem_alloc_zeroed(duk_heap *heap, duk_size_t size) {
+DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_alloc(duk_heap *heap, duk_size_t size) {
 	void *res;
 
 	DUK_ASSERT(heap != NULL);
+	DUK_ASSERT(heap->alloc_func != NULL);
+	DUK_ASSERT_DISABLE(size >= 0);
+
+#if defined(DUK_USE_VOLUNTARY_GC)
+	/* Voluntary periodic GC (if enabled). */
+	if (DUK_UNLIKELY(--(heap)->ms_trigger_counter < 0)) {
+		goto slowpath;
+	}
+#endif
+
+#if defined(DUK_USE_GC_TORTURE)
+	/* Simulate alloc failure on every alloc, except when mark-and-sweep
+	 * is running.
+	 */
+	if (heap->ms_prevent_count == 0) {
+		DUK_DDD(DUK_DDDPRINT("gc torture enabled, pretend that first alloc attempt fails"));
+		res = NULL;
+		DUK_UNREF(res);
+		goto slowpath;
+	}
+#endif
+
+	/* Zero-size allocation should happen very rarely (if at all), so
+	 * don't check zero size on NULL; handle it in the slow path
+	 * instead.  This reduces size of inlined code.
+	 */
+	res = heap->alloc_func(heap->heap_udata, size);
+	if (DUK_LIKELY(res != NULL)) {
+		return res;
+	}
+
+ slowpath:
+
+	if (size == 0) {
+		DUK_D(DUK_DPRINT("first alloc attempt returned NULL for zero size alloc, use slow path to deal with it"));
+	} else {
+		DUK_D(DUK_DPRINT("first alloc attempt failed, attempt to gc and retry"));
+	}
+	return duk__heap_mem_alloc_slowpath(heap, size);
+}
+
+DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_alloc_zeroed(duk_heap *heap, duk_size_t size) {
+	void *res;
+
+	DUK_ASSERT(heap != NULL);
+	DUK_ASSERT(heap->alloc_func != NULL);
 	DUK_ASSERT_DISABLE(size >= 0);
 
 	res = DUK_ALLOC(heap, size);
@@ -50609,24 +52676,37 @@ DUK_INTERNAL void *duk_heap_mem_alloc_zeroed(duk_heap *heap, duk_size_t size) {
 	return res;
 }
 
-DUK_INTERNAL void *duk_heap_mem_alloc_checked(duk_hthread *thr, duk_size_t size) {
+DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_alloc_checked(duk_hthread *thr, duk_size_t size) {
 	void *res;
 
 	DUK_ASSERT(thr != NULL);
+	DUK_ASSERT(thr->heap != NULL);
+	DUK_ASSERT(thr->heap->alloc_func != NULL);
+
 	res = duk_heap_mem_alloc(thr->heap, size);
-	if (DUK_LIKELY(res != NULL || size == 0)) {
+	if (DUK_LIKELY(res != NULL)) {
+		return res;
+	} else if (size == 0) {
+		DUK_ASSERT(res == NULL);
 		return res;
 	}
 	DUK_ERROR_ALLOC_FAILED(thr);
 	DUK_WO_NORETURN(return NULL;);
 }
 
-DUK_INTERNAL void *duk_heap_mem_alloc_checked_zeroed(duk_hthread *thr, duk_size_t size) {
+DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_alloc_checked_zeroed(duk_hthread *thr, duk_size_t size) {
 	void *res;
 
 	DUK_ASSERT(thr != NULL);
-	res = duk_heap_mem_alloc_zeroed(thr->heap, size);
-	if (DUK_LIKELY(res != NULL || size == 0)) {
+	DUK_ASSERT(thr->heap != NULL);
+	DUK_ASSERT(thr->heap->alloc_func != NULL);
+
+	res = duk_heap_mem_alloc(thr->heap, size);
+	if (DUK_LIKELY(res != NULL)) {
+		duk_memzero(res, size);
+		return res;
+	} else if (size == 0) {
+		DUK_ASSERT(res == NULL);
 		return res;
 	}
 	DUK_ERROR_ALLOC_FAILED(thr);
@@ -50634,46 +52714,26 @@ DUK_INTERNAL void *duk_heap_mem_alloc_checked_zeroed(duk_hthread *thr, duk_size_
 }
 
 /*
- *  Reallocate memory with garbage collection
+ *  Reallocate memory with garbage collection.
  */
 
-DUK_INTERNAL void *duk_heap_mem_realloc(duk_heap *heap, void *ptr, duk_size_t newsize) {
+/* Slow path: voluntary GC triggered, first realloc attempt failed, or zero size. */
+DUK_LOCAL DUK_NOINLINE_PERF DUK_COLD void *duk__heap_mem_realloc_slowpath(duk_heap *heap, void *ptr, duk_size_t newsize) {
 	void *res;
 	duk_small_int_t i;
 
 	DUK_ASSERT(heap != NULL);
+	DUK_ASSERT(heap->realloc_func != NULL);
 	/* ptr may be NULL */
 	DUK_ASSERT_DISABLE(newsize >= 0);
 
-	/*
-	 *  Voluntary periodic GC (if enabled)
-	 */
-
-	DUK__VOLUNTARY_PERIODIC_GC(heap);
-
-	/*
-	 *  First attempt
+	/* Newsize was 0 and realloc() returned NULL, this has the semantics
+	 * of free(oldptr), i.e. memory was successfully freed.
 	 */
-
-#if defined(DUK_USE_GC_TORTURE)
-	/* Simulate alloc failure on every realloc, except when mark-and-sweep
-	 * is running.
-	 */
-	if (heap->ms_prevent_count == 0) {
-		DUK_DDD(DUK_DDDPRINT("gc torture enabled, pretend that first realloc attempt fails"));
-		res = NULL;
-		DUK_UNREF(res);
-		goto skip_attempt;
-	}
-#endif
-	res = heap->realloc_func(heap->heap_udata, ptr, newsize);
-	if (DUK_LIKELY(res || newsize == 0)) {
-		/* For zero size allocations NULL is allowed. */
-		return res;
+	if (newsize == 0) {
+		DUK_D(DUK_DPRINT("zero size realloc in slow path, return NULL"));
+		return NULL;
 	}
-#if defined(DUK_USE_GC_TORTURE)
- skip_attempt:
-#endif
 
 	DUK_D(DUK_DPRINT("first realloc attempt failed, attempt to gc and retry"));
 
@@ -50704,6 +52764,7 @@ DUK_INTERNAL void *duk_heap_mem_realloc(duk_heap *heap, void *ptr, duk_size_t ne
 
 		duk_heap_mark_and_sweep(heap, flags);
 
+		DUK_ASSERT(newsize > 0);
 		res = heap->realloc_func(heap->heap_udata, ptr, newsize);
 		if (res || newsize == 0) {
 			DUK_D(DUK_DPRINT("duk_heap_mem_realloc() succeeded after gc (pass %ld), alloc size %ld",
@@ -50716,48 +52777,67 @@ DUK_INTERNAL void *duk_heap_mem_realloc(duk_heap *heap, void *ptr, duk_size_t ne
 	return NULL;
 }
 
-/*
- *  Reallocate memory with garbage collection, using a callback to provide
- *  the current allocated pointer.  This variant is used when a mark-and-sweep
- *  (e.g. finalizers) might change the original pointer.
- */
-
-DUK_INTERNAL void *duk_heap_mem_realloc_indirect(duk_heap *heap, duk_mem_getptr cb, void *ud, duk_size_t newsize) {
+DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_realloc(duk_heap *heap, void *ptr, duk_size_t newsize) {
 	void *res;
-	duk_small_int_t i;
 
 	DUK_ASSERT(heap != NULL);
+	DUK_ASSERT(heap->realloc_func != NULL);
+	/* ptr may be NULL */
 	DUK_ASSERT_DISABLE(newsize >= 0);
 
-	/*
-	 *  Voluntary periodic GC (if enabled)
-	 */
-
-	DUK__VOLUNTARY_PERIODIC_GC(heap);
-
-	/*
-	 *  First attempt
-	 */
+#if defined(DUK_USE_VOLUNTARY_GC)
+	/* Voluntary periodic GC (if enabled). */
+	if (DUK_UNLIKELY(--(heap)->ms_trigger_counter < 0)) {
+		goto slowpath;
+	}
+#endif
 
 #if defined(DUK_USE_GC_TORTURE)
 	/* Simulate alloc failure on every realloc, except when mark-and-sweep
 	 * is running.
 	 */
 	if (heap->ms_prevent_count == 0) {
-		DUK_DDD(DUK_DDDPRINT("gc torture enabled, pretend that first indirect realloc attempt fails"));
+		DUK_DDD(DUK_DDDPRINT("gc torture enabled, pretend that first realloc attempt fails"));
 		res = NULL;
 		DUK_UNREF(res);
-		goto skip_attempt;
+		goto slowpath;
 	}
 #endif
-	res = heap->realloc_func(heap->heap_udata, cb(heap, ud), newsize);
-	if (DUK_LIKELY(res || newsize == 0)) {
-		/* For zero size allocations NULL is allowed. */
+
+	res = heap->realloc_func(heap->heap_udata, ptr, newsize);
+	if (DUK_LIKELY(res != NULL)) {
 		return res;
 	}
-#if defined(DUK_USE_GC_TORTURE)
- skip_attempt:
-#endif
+
+ slowpath:
+
+	if (newsize == 0) {
+		DUK_D(DUK_DPRINT("first realloc attempt returned NULL for zero size realloc, use slow path to deal with it"));
+	} else {
+		DUK_D(DUK_DPRINT("first realloc attempt failed, attempt to gc and retry"));
+	}
+	return duk__heap_mem_realloc_slowpath(heap, ptr, newsize);
+}
+
+/*
+ *  Reallocate memory with garbage collection, using a callback to provide
+ *  the current allocated pointer.  This variant is used when a mark-and-sweep
+ *  (e.g. finalizers) might change the original pointer.
+ */
+
+/* Slow path: voluntary GC triggered, first realloc attempt failed, or zero size. */
+DUK_LOCAL DUK_NOINLINE_PERF DUK_COLD void *duk__heap_mem_realloc_indirect_slowpath(duk_heap *heap, duk_mem_getptr cb, void *ud, duk_size_t newsize) {
+	void *res;
+	duk_small_int_t i;
+
+	DUK_ASSERT(heap != NULL);
+	DUK_ASSERT(heap->realloc_func != NULL);
+	DUK_ASSERT_DISABLE(newsize >= 0);
+
+	if (newsize == 0) {
+		DUK_D(DUK_DPRINT("zero size indirect realloc in slow path, return NULL"));
+		return NULL;
+	}
 
 	DUK_D(DUK_DPRINT("first indirect realloc attempt failed, attempt to gc and retry"));
 
@@ -50807,6 +52887,7 @@ DUK_INTERNAL void *duk_heap_mem_realloc_indirect(duk_heap *heap, duk_mem_getptr
 		 * The pointer being reallocated may change after every mark-and-sweep.
 		 */
 
+		DUK_ASSERT(newsize > 0);
 		res = heap->realloc_func(heap->heap_udata, cb(heap, ud), newsize);
 		if (res || newsize == 0) {
 			DUK_D(DUK_DPRINT("duk_heap_mem_realloc_indirect() succeeded after gc (pass %ld), alloc size %ld",
@@ -50819,12 +52900,54 @@ DUK_INTERNAL void *duk_heap_mem_realloc_indirect(duk_heap *heap, duk_mem_getptr
 	return NULL;
 }
 
+DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void *duk_heap_mem_realloc_indirect(duk_heap *heap, duk_mem_getptr cb, void *ud, duk_size_t newsize) {
+	void *res;
+
+	DUK_ASSERT(heap != NULL);
+	DUK_ASSERT(heap->realloc_func != NULL);
+	DUK_ASSERT_DISABLE(newsize >= 0);
+
+#if defined(DUK_USE_VOLUNTARY_GC)
+	/* Voluntary periodic GC (if enabled). */
+	if (DUK_UNLIKELY(--(heap)->ms_trigger_counter < 0)) {
+		goto slowpath;
+	}
+#endif
+
+#if defined(DUK_USE_GC_TORTURE)
+	/* Simulate alloc failure on every realloc, except when mark-and-sweep
+	 * is running.
+	 */
+	if (heap->ms_prevent_count == 0) {
+		DUK_DDD(DUK_DDDPRINT("gc torture enabled, pretend that first indirect realloc attempt fails"));
+		res = NULL;
+		DUK_UNREF(res);
+		goto slowpath;
+	}
+#endif
+
+	res = heap->realloc_func(heap->heap_udata, cb(heap, ud), newsize);
+	if (DUK_LIKELY(res != NULL)) {
+		return res;
+	}
+
+ slowpath:
+
+	if (newsize == 0) {
+		DUK_D(DUK_DPRINT("first indirect realloc attempt returned NULL for zero size realloc, use slow path to deal with it"));
+	} else {
+		DUK_D(DUK_DPRINT("first indirect realloc attempt failed, attempt to gc and retry"));
+	}
+	return duk__heap_mem_realloc_indirect_slowpath(heap, cb, ud, newsize);
+}
+
 /*
  *  Free memory
  */
 
-DUK_INTERNAL void duk_heap_mem_free(duk_heap *heap, void *ptr) {
+DUK_INTERNAL DUK_INLINE_PERF DUK_HOT void duk_heap_mem_free(duk_heap *heap, void *ptr) {
 	DUK_ASSERT(heap != NULL);
+	DUK_ASSERT(heap->free_func != NULL);
 	/* ptr may be NULL */
 
 	/* Must behave like a no-op with NULL and any pointer returned from
@@ -50837,9 +52960,6 @@ DUK_INTERNAL void duk_heap_mem_free(duk_heap *heap, void *ptr) {
 	 * No need to update voluntary GC counter either.
 	 */
 }
-
-/* automatic undefs */
-#undef DUK__VOLUNTARY_PERIODIC_GC
 /*
  *  Support functions for duk_heap.
  */
@@ -53874,6 +55994,13 @@ DUK_LOCAL void duk__sort_enum_keys_es6(duk_hthread *thr, duk_hobject *h_obj, duk
 			keys[idx_insert] = h_curr;
 		}
 	}
+
+	/* Entry part has been reordered now with no side effects.
+	 * If the object has a hash part, it will now be incorrect
+	 * and we need to rehash.  Do that by forcing a resize to
+	 * the current size.
+	 */
+	duk_hobject_resize_entrypart(thr, h_obj, DUK_HOBJECT_GET_ESIZE(h_obj));
 }
 
 /*
@@ -54817,7 +56944,7 @@ DUK_LOCAL duk_uint32_t duk__tval_number_to_arr_idx(duk_tval *tv) {
 	 */
 	dbl = DUK_TVAL_GET_NUMBER(tv);
 	idx = (duk_uint32_t) dbl;
-	if ((duk_double_t) idx == dbl) {
+	if (duk_double_equals((duk_double_t) idx, dbl)) {
 	        /* Is whole and within 32 bit range.  If the value happens to be 0xFFFFFFFF,
 		 * it's not a valid array index but will then match DUK__NO_ARRAY_INDEX.
 		 */
@@ -55041,6 +57168,8 @@ DUK_LOCAL duk_bool_t duk__abandon_array_density_check(duk_uint32_t a_used, duk_u
 
 /* Fast check for extending array: check whether or not a slow density check is required. */
 DUK_LOCAL duk_bool_t duk__abandon_array_slow_check_required(duk_uint32_t arr_idx, duk_uint32_t old_size) {
+	duk_uint32_t new_size_min;
+
 	/*
 	 *  In a fast check we assume old_size equals old_used (i.e., existing
 	 *  array is fully dense).
@@ -55062,7 +57191,9 @@ DUK_LOCAL duk_bool_t duk__abandon_array_slow_check_required(duk_uint32_t arr_idx
 	 *    arr_idx > limit'' * ((old_size + 7) / 8)
 	 */
 
-	return (arr_idx > DUK_USE_HOBJECT_ARRAY_FAST_RESIZE_LIMIT * ((old_size + 7) >> 3));
+	new_size_min = arr_idx + 1;
+	return (new_size_min >= DUK_USE_HOBJECT_ARRAY_ABANDON_MINSIZE) &&
+	       (arr_idx > DUK_USE_HOBJECT_ARRAY_FAST_RESIZE_LIMIT * ((old_size + 7) >> 3));
 }
 
 DUK_LOCAL duk_bool_t duk__abandon_array_check(duk_hthread *thr, duk_uint32_t arr_idx, duk_hobject *obj) {
@@ -57900,7 +60031,7 @@ DUK_LOCAL duk_uint32_t duk__to_new_array_length_checked(duk_hthread *thr, duk_tv
 	 * 32-bit range.  Negative zero is accepted as zero.
 	 */
 	res = duk_double_to_uint32_t(d);
-	if ((duk_double_t) res != d) {
+	if (!duk_double_equals((duk_double_t) res, d)) {
 		goto fail_range;
 	}
 
@@ -62603,11 +64734,11 @@ DUK_INTERNAL double duk_js_arith_mod(double d1, double d2) {
 		} else {
 			return d1;
 		}
-	} else if (d1 == 0.0) {
+	} else if (duk_double_equals(d1, 0.0)) {
 		/* d1 +/-0 is returned as is (preserving sign) except when
 		 * d2 is zero or NaN.
 		 */
-		if (d2 == 0.0 || DUK_ISNAN(d2)) {
+		if (duk_double_equals(d2, 0.0) || DUK_ISNAN(d2)) {
 			return DUK_DOUBLE_NAN;
 		} else {
 			return d1;
@@ -62615,20 +64746,20 @@ DUK_INTERNAL double duk_js_arith_mod(double d1, double d2) {
 	}
 #else
 	/* Some ISO C assumptions. */
-	DUK_ASSERT(DUK_FMOD(1.0, DUK_DOUBLE_INFINITY) == 1.0);
-	DUK_ASSERT(DUK_FMOD(-1.0, DUK_DOUBLE_INFINITY) == -1.0);
-	DUK_ASSERT(DUK_FMOD(1.0, -DUK_DOUBLE_INFINITY) == 1.0);
-	DUK_ASSERT(DUK_FMOD(-1.0, -DUK_DOUBLE_INFINITY) == -1.0);
+	DUK_ASSERT(duk_double_equals(DUK_FMOD(1.0, DUK_DOUBLE_INFINITY), 1.0));
+	DUK_ASSERT(duk_double_equals(DUK_FMOD(-1.0, DUK_DOUBLE_INFINITY), -1.0));
+	DUK_ASSERT(duk_double_equals(DUK_FMOD(1.0, -DUK_DOUBLE_INFINITY), 1.0));
+	DUK_ASSERT(duk_double_equals(DUK_FMOD(-1.0, -DUK_DOUBLE_INFINITY), -1.0));
 	DUK_ASSERT(DUK_ISNAN(DUK_FMOD(DUK_DOUBLE_INFINITY, DUK_DOUBLE_INFINITY)));
 	DUK_ASSERT(DUK_ISNAN(DUK_FMOD(DUK_DOUBLE_INFINITY, -DUK_DOUBLE_INFINITY)));
 	DUK_ASSERT(DUK_ISNAN(DUK_FMOD(-DUK_DOUBLE_INFINITY, DUK_DOUBLE_INFINITY)));
 	DUK_ASSERT(DUK_ISNAN(DUK_FMOD(-DUK_DOUBLE_INFINITY, -DUK_DOUBLE_INFINITY)));
-	DUK_ASSERT(DUK_FMOD(0.0, 1.0) == 0.0 && DUK_SIGNBIT(DUK_FMOD(0.0, 1.0)) == 0);
-	DUK_ASSERT(DUK_FMOD(-0.0, 1.0) == 0.0 && DUK_SIGNBIT(DUK_FMOD(-0.0, 1.0)) != 0);
-	DUK_ASSERT(DUK_FMOD(0.0, DUK_DOUBLE_INFINITY) == 0.0 && DUK_SIGNBIT(DUK_FMOD(0.0, DUK_DOUBLE_INFINITY)) == 0);
-	DUK_ASSERT(DUK_FMOD(-0.0, DUK_DOUBLE_INFINITY) == 0.0 && DUK_SIGNBIT(DUK_FMOD(-0.0, DUK_DOUBLE_INFINITY)) != 0);
-	DUK_ASSERT(DUK_FMOD(0.0, -DUK_DOUBLE_INFINITY) == 0.0 && DUK_SIGNBIT(DUK_FMOD(0.0, DUK_DOUBLE_INFINITY)) == 0);
-	DUK_ASSERT(DUK_FMOD(-0.0, -DUK_DOUBLE_INFINITY) == 0.0 && DUK_SIGNBIT(DUK_FMOD(-0.0, -DUK_DOUBLE_INFINITY)) != 0);
+	DUK_ASSERT(duk_double_equals(DUK_FMOD(0.0, 1.0), 0.0) && DUK_SIGNBIT(DUK_FMOD(0.0, 1.0)) == 0);
+	DUK_ASSERT(duk_double_equals(DUK_FMOD(-0.0, 1.0), 0.0) && DUK_SIGNBIT(DUK_FMOD(-0.0, 1.0)) != 0);
+	DUK_ASSERT(duk_double_equals(DUK_FMOD(0.0, DUK_DOUBLE_INFINITY), 0.0) && DUK_SIGNBIT(DUK_FMOD(0.0, DUK_DOUBLE_INFINITY)) == 0);
+	DUK_ASSERT(duk_double_equals(DUK_FMOD(-0.0, DUK_DOUBLE_INFINITY), 0.0) && DUK_SIGNBIT(DUK_FMOD(-0.0, DUK_DOUBLE_INFINITY)) != 0);
+	DUK_ASSERT(duk_double_equals(DUK_FMOD(0.0, -DUK_DOUBLE_INFINITY), 0.0) && DUK_SIGNBIT(DUK_FMOD(0.0, DUK_DOUBLE_INFINITY)) == 0);
+	DUK_ASSERT(duk_double_equals(DUK_FMOD(-0.0, -DUK_DOUBLE_INFINITY), 0.0) && DUK_SIGNBIT(DUK_FMOD(-0.0, -DUK_DOUBLE_INFINITY)) != 0);
 	DUK_ASSERT(DUK_ISNAN(DUK_FMOD(0.0, 0.0)));
 	DUK_ASSERT(DUK_ISNAN(DUK_FMOD(-0.0, 0.0)));
 	DUK_ASSERT(DUK_ISNAN(DUK_FMOD(0.0, -0.0)));
@@ -62657,7 +64788,7 @@ DUK_INTERNAL double duk_js_arith_pow(double x, double y) {
 	if (cy == DUK_FP_NAN) {
 		goto ret_nan;
 	}
-	if (DUK_FABS(x) == 1.0 && cy == DUK_FP_INFINITE) {
+	if (duk_double_equals(DUK_FABS(x), 1.0) && cy == DUK_FP_INFINITE) {
 		goto ret_nan;
 	}
 
@@ -62699,7 +64830,7 @@ DUK_INTERNAL double duk_js_arith_pow(double x, double y) {
 			}
 		}
 	} else if (cx == DUK_FP_NAN) {
-		if (y == 0.0) {
+		if (duk_double_equals(y, 0.0)) {
 			/* NaN ** +/- 0 should always be 1, but is NaN on
 			 * at least some Cygwin/MinGW versions.
 			 */
@@ -62708,7 +64839,7 @@ DUK_INTERNAL double duk_js_arith_pow(double x, double y) {
 	}
 #else
 	/* Some ISO C assumptions. */
-	DUK_ASSERT(DUK_POW(DUK_DOUBLE_NAN, 0.0) == 1.0);
+	DUK_ASSERT(duk_double_equals(DUK_POW(DUK_DOUBLE_NAN, 0.0), 1.0));
 	DUK_ASSERT(DUK_ISINF(DUK_POW(0.0, -1.0)) && DUK_SIGNBIT(DUK_POW(0.0, -1.0)) == 0);
 	DUK_ASSERT(DUK_ISINF(DUK_POW(-0.0, -2.0)) && DUK_SIGNBIT(DUK_POW(-0.0, -2.0)) == 0);
 	DUK_ASSERT(DUK_ISINF(DUK_POW(-0.0, -3.0)) && DUK_SIGNBIT(DUK_POW(-0.0, -3.0)) != 0);
@@ -65490,6 +67621,7 @@ DUK_INTERNAL duk_int_t duk_handle_safe_call(duk_hthread *thr,
 #if defined(DUK_USE_CPP_EXCEPTIONS)
 	catch (duk_fatal_exception &exc) {
 		DUK_D(DUK_DPRINT("rethrow duk_fatal_exception"));
+		DUK_UNREF(exc);
 		throw;
 	} catch (std::exception &exc) {
 		const char *what = exc.what();
@@ -69369,12 +71501,12 @@ DUK_LOCAL void duk__expr_nud(duk_compiler_ctx *comp_ctx, duk_ivalue *res) {
 			if (DUK_TVAL_IS_NUMBER(tv_val)) {
 				duk_double_t d;
 				d = DUK_TVAL_GET_NUMBER(tv_val);
-				if (d == 0.0) {
+				if (duk_double_equals(d, 0.0)) {
 					/* Matches both +0 and -0 on purpose. */
 					DUK_DDD(DUK_DDDPRINT("inlined lnot: !0 -> true"));
 					DUK_TVAL_SET_BOOLEAN_TRUE(tv_val);
 					return;
-				} else if (d == 1.0) {
+				} else if (duk_double_equals(d, 1.0)) {
 					DUK_DDD(DUK_DDDPRINT("inlined lnot: !1 -> false"));
 					DUK_TVAL_SET_BOOLEAN_FALSE(tv_val);
 					return;
@@ -72042,10 +74174,13 @@ DUK_LOCAL void duk__parse_stmt(duk_compiler_ctx *comp_ctx, duk_ivalue *res, duk_
 		 */
 		test_func_decl = allow_source_elem;
 #if defined(DUK_USE_NONSTD_FUNC_STMT)
-		/* Lenient: allow function declarations outside top level in
-		 * non-strict mode but reject them in strict mode.
+		/* Lenient: allow function declarations outside top level in both
+		 * strict and non-strict modes.  However, don't allow labelled
+		 * function declarations in strict mode.
 		 */
-		test_func_decl = test_func_decl || !comp_ctx->curr_func.is_strict;
+		test_func_decl = test_func_decl ||
+		                 !comp_ctx->curr_func.is_strict ||
+		                 label_id < 0;
 #endif  /* DUK_USE_NONSTD_FUNC_STMT */
 		/* Strict: never allow function declarations outside top level. */
 		if (test_func_decl) {
@@ -73778,15 +75913,6 @@ DUK_LOCAL_DECL void duk__js_execute_bytecode_inner(duk_hthread *entry_thread, du
  *  Misc helpers.
  */
 
-/* Forced inline declaration, only applied for performance oriented build. */
-#if defined(DUK_USE_EXEC_PREFER_SIZE)
-#define DUK__INLINE_PERF
-#define DUK__NOINLINE_PERF
-#else
-#define DUK__INLINE_PERF DUK_ALWAYS_INLINE
-#define DUK__NOINLINE_PERF DUK_NOINLINE
-#endif
-
 /* Replace value stack top to value at 'tv_ptr'.  Optimize for
  * performance by only applying the net refcount change.
  */
@@ -73838,17 +75964,17 @@ DUK_LOCAL void duk__push_tvals_incref_only(duk_hthread *thr, duk_tval *tv_src, d
  *  possible.
  */
 
-DUK_LOCAL DUK__INLINE_PERF duk_double_t duk__compute_mod(duk_double_t d1, duk_double_t d2) {
+DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF duk_double_t duk__compute_mod(duk_double_t d1, duk_double_t d2) {
 	return (duk_double_t) duk_js_arith_mod((double) d1, (double) d2);
 }
 
 #if defined(DUK_USE_ES7_EXP_OPERATOR)
-DUK_LOCAL DUK__INLINE_PERF duk_double_t duk__compute_exp(duk_double_t d1, duk_double_t d2) {
+DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF duk_double_t duk__compute_exp(duk_double_t d1, duk_double_t d2) {
 	return (duk_double_t) duk_js_arith_pow((double) d1, (double) d2);
 }
 #endif
 
-DUK_LOCAL DUK__INLINE_PERF void duk__vm_arith_add(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_small_uint_fast_t idx_z) {
+DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_add(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_small_uint_fast_t idx_z) {
 	/*
 	 *  Addition operator is different from other arithmetic
 	 *  operations in that it also provides string concatenation.
@@ -73955,7 +76081,7 @@ DUK_LOCAL DUK__INLINE_PERF void duk__vm_arith_add(duk_hthread *thr, duk_tval *tv
 	duk_replace(thr, (duk_idx_t) idx_z);  /* side effects */
 }
 
-DUK_LOCAL DUK__INLINE_PERF void duk__vm_arith_binary_op(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_uint_fast_t idx_z, duk_small_uint_fast_t opcode) {
+DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_binary_op(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_uint_fast_t idx_z, duk_small_uint_fast_t opcode) {
 	/*
 	 *  Arithmetic operations other than '+' have number-only semantics
 	 *  and are implemented here.  The separate switch-case here means a
@@ -74113,7 +76239,7 @@ DUK_LOCAL DUK__INLINE_PERF void duk__vm_arith_binary_op(duk_hthread *thr, duk_tv
 #endif  /* DUK_USE_EXEC_PREFER_SIZE */
 }
 
-DUK_LOCAL DUK__INLINE_PERF void duk__vm_bitwise_binary_op(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_small_uint_fast_t idx_z, duk_small_uint_fast_t opcode) {
+DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_bitwise_binary_op(duk_hthread *thr, duk_tval *tv_x, duk_tval *tv_y, duk_small_uint_fast_t idx_z, duk_small_uint_fast_t opcode) {
 	/*
 	 *  Binary bitwise operations use different coercions (ToInt32, ToUint32)
 	 *  depending on the operation.  We coerce the arguments first using
@@ -74241,7 +76367,7 @@ DUK_LOCAL DUK__INLINE_PERF void duk__vm_bitwise_binary_op(duk_hthread *thr, duk_
 }
 
 /* In-place unary operation. */
-DUK_LOCAL DUK__INLINE_PERF void duk__vm_arith_unary_op(duk_hthread *thr, duk_uint_fast_t idx_src, duk_uint_fast_t idx_dst, duk_small_uint_fast_t opcode) {
+DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_arith_unary_op(duk_hthread *thr, duk_uint_fast_t idx_src, duk_uint_fast_t idx_dst, duk_small_uint_fast_t opcode) {
 	/*
 	 *  Arithmetic operations other than '+' have number-only semantics
 	 *  and are implemented here.  The separate switch-case here means a
@@ -74318,7 +76444,7 @@ DUK_LOCAL DUK__INLINE_PERF void duk__vm_arith_unary_op(duk_hthread *thr, duk_uin
 	DUK_TVAL_SET_NUMBER_UPDREF(thr, tv, du.d);
 }
 
-DUK_LOCAL DUK__INLINE_PERF void duk__vm_bitwise_not(duk_hthread *thr, duk_uint_fast_t idx_src, duk_uint_fast_t idx_dst) {
+DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_bitwise_not(duk_hthread *thr, duk_uint_fast_t idx_src, duk_uint_fast_t idx_dst) {
 	/*
 	 *  E5 Section 11.4.8
 	 */
@@ -74352,7 +76478,7 @@ DUK_LOCAL DUK__INLINE_PERF void duk__vm_bitwise_not(duk_hthread *thr, duk_uint_f
 	DUK_TVAL_SET_I32_UPDREF(thr, tv, i2);  /* side effects */
 }
 
-DUK_LOCAL DUK__INLINE_PERF void duk__vm_logical_not(duk_hthread *thr, duk_uint_fast_t idx_src, duk_uint_fast_t idx_dst) {
+DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__vm_logical_not(duk_hthread *thr, duk_uint_fast_t idx_src, duk_uint_fast_t idx_dst) {
 	/*
 	 *  E5 Section 11.4.9
 	 */
@@ -74380,7 +76506,7 @@ DUK_LOCAL DUK__INLINE_PERF void duk__vm_logical_not(duk_hthread *thr, duk_uint_f
 }
 
 /* XXX: size optimized variant */
-DUK_LOCAL DUK__INLINE_PERF void duk__prepost_incdec_reg_helper(duk_hthread *thr, duk_tval *tv_dst, duk_tval *tv_src, duk_small_uint_t op) {
+DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_reg_helper(duk_hthread *thr, duk_tval *tv_dst, duk_tval *tv_src, duk_small_uint_t op) {
 	duk_double_t x, y, z;
 
 	/* Two lowest bits of opcode are used to distinguish
@@ -74456,7 +76582,7 @@ DUK_LOCAL DUK__INLINE_PERF void duk__prepost_incdec_reg_helper(duk_hthread *thr,
 	DUK_TVAL_SET_NUMBER_UPDREF(thr, tv_dst, z);  /* side effects */
 }
 
-DUK_LOCAL DUK__INLINE_PERF void duk__prepost_incdec_var_helper(duk_hthread *thr, duk_small_uint_t idx_dst, duk_tval *tv_id, duk_small_uint_t op, duk_small_uint_t is_strict) {
+DUK_LOCAL DUK_EXEC_ALWAYS_INLINE_PERF void duk__prepost_incdec_var_helper(duk_hthread *thr, duk_small_uint_t idx_dst, duk_tval *tv_id, duk_small_uint_t op, duk_small_uint_t is_strict) {
 	duk_activation *act;
 	duk_double_t x, y;
 	duk_hstring *name;
@@ -75082,17 +77208,21 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation
 			DUK_DD(DUK_DDPRINT("-> yield an error, converted to a throw in the resumer, propagate"));
 			goto check_longjmp;
 		} else {
-			duk_hthread_activation_unwind_norz(resumer);
-			duk__handle_yield(thr, resumer, &thr->heap->lj.value1);
+			/* When handling the yield, the last reference to
+			 * 'thr' may disappear.
+			 */
 
+			DUK_GC_TORTURE(resumer->heap);
+			duk_hthread_activation_unwind_norz(resumer);
+			DUK_GC_TORTURE(resumer->heap);
 			thr->state = DUK_HTHREAD_STATE_YIELDED;
 			thr->resumer = NULL;
 			DUK_HTHREAD_DECREF_NORZ(thr, resumer);
 			resumer->state = DUK_HTHREAD_STATE_RUNNING;
 			DUK_HEAP_SWITCH_THREAD(thr->heap, resumer);
-#if 0
-			thr = resumer;  /* not needed, as we exit right away */
-#endif
+			duk__handle_yield(thr, resumer, &thr->heap->lj.value1);
+			thr = resumer;
+			DUK_GC_TORTURE(resumer->heap);
 
 			DUK_DD(DUK_DDPRINT("-> yield a value, restart execution in resumer"));
 			retval = DUK__LONGJMP_RESTART;
@@ -75254,9 +77384,9 @@ DUK_LOCAL duk_small_uint_t duk__handle_longjmp(duk_hthread *thr, duk_activation
  * handling because it has a measurable performance impact in ordinary
  * environments and an extreme impact in Emscripten (GH-342).
  */
-DUK_LOCAL DUK__NOINLINE_PERF void duk__handle_break_or_continue(duk_hthread *thr,
-                                                                duk_uint_t label_id,
-                                                                duk_small_uint_t lj_type) {
+DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_break_or_continue(duk_hthread *thr,
+                                                                    duk_uint_t label_id,
+                                                                    duk_small_uint_t lj_type) {
 	duk_activation *act;
 	duk_catcher *cat;
 
@@ -75707,7 +77837,7 @@ DUK_LOCAL void duk__interrupt_handle_debugger(duk_hthread *thr, duk_bool_t *out_
 }
 #endif  /* DUK_USE_DEBUGGER_SUPPORT */
 
-DUK_LOCAL DUK__NOINLINE_PERF DUK_COLD duk_small_uint_t duk__executor_interrupt(duk_hthread *thr) {
+DUK_LOCAL DUK_EXEC_NOINLINE_PERF DUK_COLD duk_small_uint_t duk__executor_interrupt(duk_hthread *thr) {
 	duk_int_t ctr;
 	duk_activation *act;
 	duk_hcompfunc *fun;
@@ -75960,7 +78090,7 @@ DUK_LOCAL void duk__executor_recheck_debugger(duk_hthread *thr, duk_activation *
  *  rare; NOINLINE to reduce amount of code in main bytecode dispatcher.
  */
 
-DUK_LOCAL DUK__NOINLINE_PERF void duk__handle_op_initset_initget(duk_hthread *thr, duk_uint_fast32_t ins) {
+DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_op_initset_initget(duk_hthread *thr, duk_uint_fast32_t ins) {
 	duk_bool_t is_set = (DUK_DEC_OP(ins) == DUK_OP_INITSET);
 	duk_uint_fast_t idx;
 	duk_uint_t defprop_flags;
@@ -75993,7 +78123,7 @@ DUK_LOCAL DUK__NOINLINE_PERF void duk__handle_op_initset_initget(duk_hthread *th
 	duk_def_prop(thr, (duk_idx_t) DUK_DEC_A(ins), defprop_flags);
 }
 
-DUK_LOCAL DUK__NOINLINE_PERF void duk__handle_op_trycatch(duk_hthread *thr, duk_uint_fast32_t ins, duk_instr_t *curr_pc) {
+DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_op_trycatch(duk_hthread *thr, duk_uint_fast32_t ins, duk_instr_t *curr_pc) {
 	duk_activation *act;
 	duk_catcher *cat;
 	duk_tval *tv1;
@@ -76158,7 +78288,7 @@ DUK_LOCAL DUK__NOINLINE_PERF void duk__handle_op_trycatch(duk_hthread *thr, duk_
 	duk_pop_unsafe(thr);
 }
 
-DUK_LOCAL DUK__NOINLINE_PERF duk_instr_t *duk__handle_op_endtry(duk_hthread *thr, duk_uint_fast32_t ins) {
+DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_instr_t *duk__handle_op_endtry(duk_hthread *thr, duk_uint_fast32_t ins) {
 	duk_activation *act;
 	duk_catcher *cat;
 	duk_tval *tv1;
@@ -76202,7 +78332,7 @@ DUK_LOCAL DUK__NOINLINE_PERF duk_instr_t *duk__handle_op_endtry(duk_hthread *thr
 	return pc_base + 1;  /* new curr_pc value */
 }
 
-DUK_LOCAL DUK__NOINLINE_PERF duk_instr_t *duk__handle_op_endcatch(duk_hthread *thr, duk_uint_fast32_t ins) {
+DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_instr_t *duk__handle_op_endcatch(duk_hthread *thr, duk_uint_fast32_t ins) {
 	duk_activation *act;
 	duk_catcher *cat;
 	duk_tval *tv1;
@@ -76263,7 +78393,7 @@ DUK_LOCAL DUK__NOINLINE_PERF duk_instr_t *duk__handle_op_endcatch(duk_hthread *t
 	return pc_base + 1;  /* new curr_pc value */
 }
 
-DUK_LOCAL DUK__NOINLINE_PERF duk_small_uint_t duk__handle_op_endfin(duk_hthread *thr, duk_uint_fast32_t ins, duk_activation *entry_act) {
+DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_small_uint_t duk__handle_op_endfin(duk_hthread *thr, duk_uint_fast32_t ins, duk_activation *entry_act) {
 	duk_activation *act;
 	duk_tval *tv1;
 	duk_uint_t reg_catch;
@@ -76364,7 +78494,7 @@ DUK_LOCAL DUK__NOINLINE_PERF duk_small_uint_t duk__handle_op_endfin(duk_hthread
 	return 0;
 }
 
-DUK_LOCAL DUK__NOINLINE_PERF void duk__handle_op_initenum(duk_hthread *thr, duk_uint_fast32_t ins) {
+DUK_LOCAL DUK_EXEC_NOINLINE_PERF void duk__handle_op_initenum(duk_hthread *thr, duk_uint_fast32_t ins) {
 	duk_small_uint_t b;
 	duk_small_uint_t c;
 
@@ -76392,7 +78522,7 @@ DUK_LOCAL DUK__NOINLINE_PERF void duk__handle_op_initenum(duk_hthread *thr, duk_
 	}
 }
 
-DUK_LOCAL DUK__NOINLINE_PERF duk_small_uint_t duk__handle_op_nextenum(duk_hthread *thr, duk_uint_fast32_t ins) {
+DUK_LOCAL DUK_EXEC_NOINLINE_PERF duk_small_uint_t duk__handle_op_nextenum(duk_hthread *thr, duk_uint_fast32_t ins) {
 	duk_small_uint_t b;
 	duk_small_uint_t c;
 	duk_small_uint_t pc_skip = 0;
@@ -76752,6 +78882,7 @@ DUK_INTERNAL void duk_js_execute_bytecode(duk_hthread *exec_thr) {
 #if defined(DUK_USE_CPP_EXCEPTIONS)
 		catch (duk_fatal_exception &exc) {
 			DUK_D(DUK_DPRINT("rethrow duk_fatal_exception"));
+			DUK_UNREF(exc);
 			throw;
 		} catch (std::exception &exc) {
 			const char *what = exc.what();
@@ -78988,7 +81119,6 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread *
 #undef DUK__GETPROP_BODY
 #undef DUK__GE_BODY
 #undef DUK__GT_BODY
-#undef DUK__INLINE_PERF
 #undef DUK__INSTOF_BODY
 #undef DUK__INTERNAL_ERROR
 #undef DUK__INT_NOACTION
@@ -79004,7 +81134,6 @@ DUK_LOCAL DUK_NOINLINE DUK_HOT void duk__js_execute_bytecode_inner(duk_hthread *
 #undef DUK__MASK_BC
 #undef DUK__MASK_C
 #undef DUK__NEQ_BODY
-#undef DUK__NOINLINE_PERF
 #undef DUK__PUTPROP_BODY
 #undef DUK__RCBIT_B
 #undef DUK__RCBIT_C
@@ -79154,6 +81283,7 @@ DUK_INTERNAL duk_bool_t duk_js_toboolean(duk_tval *tv) {
 	}
 	}
 	DUK_UNREACHABLE();
+	DUK_WO_UNREACHABLE(return 0;);
 }
 
 /*
@@ -79295,6 +81425,7 @@ DUK_INTERNAL duk_double_t duk_js_tonumber(duk_hthread *thr, duk_tval *tv) {
 	}
 
 	DUK_UNREACHABLE();
+	DUK_WO_UNREACHABLE(return 0.0;);
 }
 
 /*
@@ -79397,7 +81528,7 @@ DUK_INTERNAL duk_int32_t duk_js_toint32(duk_hthread *thr, duk_tval *tv) {
 	d = duk__toint32_touint32_helper(d, 1);
 	DUK_ASSERT(DUK_FPCLASSIFY(d) == DUK_FP_ZERO || DUK_FPCLASSIFY(d) == DUK_FP_NORMAL);
 	DUK_ASSERT(d >= -2147483648.0 && d <= 2147483647.0);  /* [-0x80000000,0x7fffffff] */
-	DUK_ASSERT(d == ((duk_double_t) ((duk_int32_t) d)));  /* whole, won't clip */
+	DUK_ASSERT(duk_double_equals(d, (duk_double_t) ((duk_int32_t) d)));  /* whole, won't clip */
 	return (duk_int32_t) d;
 }
 
@@ -79415,7 +81546,7 @@ DUK_INTERNAL duk_uint32_t duk_js_touint32(duk_hthread *thr, duk_tval *tv) {
 	d = duk__toint32_touint32_helper(d, 0);
 	DUK_ASSERT(DUK_FPCLASSIFY(d) == DUK_FP_ZERO || DUK_FPCLASSIFY(d) == DUK_FP_NORMAL);
 	DUK_ASSERT(d >= 0.0 && d <= 4294967295.0);  /* [0x00000000, 0xffffffff] */
-	DUK_ASSERT(d == ((duk_double_t) ((duk_uint32_t) d)));  /* whole, won't clip */
+	DUK_ASSERT(duk_double_equals(d, (duk_double_t) ((duk_uint32_t) d)));  /* whole, won't clip */
 	return (duk_uint32_t) d;
 
 }
@@ -79474,7 +81605,7 @@ DUK_LOCAL duk_bool_t duk__js_equals_number(duk_double_t x, duk_double_t y) {
 	 * equal regardless of sign.  Could also use a macro, but this inlines
 	 * already nicely (no difference on gcc, for instance).
 	 */
-	if (x == y) {
+	if (duk_double_equals(x, y)) {
 		/* IEEE requires that NaNs compare false */
 		DUK_ASSERT(DUK_FPCLASSIFY(x) != DUK_FP_NAN);
 		DUK_ASSERT(DUK_FPCLASSIFY(y) != DUK_FP_NAN);
@@ -79521,7 +81652,7 @@ DUK_LOCAL duk_bool_t duk__js_samevalue_number(duk_double_t x, duk_double_t y) {
 	duk_small_int_t cx = (duk_small_int_t) DUK_FPCLASSIFY(x);
 	duk_small_int_t cy = (duk_small_int_t) DUK_FPCLASSIFY(y);
 
-	if (x == y) {
+	if (duk_double_equals(x, y)) {
 		/* IEEE requires that NaNs compare false */
 		DUK_ASSERT(DUK_FPCLASSIFY(x) != DUK_FP_NAN);
 		DUK_ASSERT(DUK_FPCLASSIFY(y) != DUK_FP_NAN);
@@ -79646,7 +81777,7 @@ DUK_INTERNAL duk_bool_t duk_js_equals_helper(duk_hthread *thr, duk_tval *tv_x, d
 			DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv_x));
 			DUK_ASSERT(DUK_TVAL_IS_NUMBER(tv_y));
 			DUK_UNREACHABLE();
-			return 0;
+			DUK_WO_UNREACHABLE(return 0;);
 		}
 		}
 	}
@@ -80210,11 +82341,9 @@ DUK_LOCAL duk_bool_t duk__js_instanceof_helper(duk_hthread *thr, duk_tval *tv_x,
 		val = DUK_HOBJECT_GET_PROTOTYPE(thr->heap, val);
 	} while (--sanity > 0);
 
-	if (DUK_UNLIKELY(sanity == 0)) {
-		DUK_ERROR_RANGE(thr, DUK_STR_PROTOTYPE_CHAIN_LIMIT);
-		DUK_WO_NORETURN(return 0;);
-	}
-	DUK_UNREACHABLE();
+	DUK_ASSERT(sanity == 0);
+	DUK_ERROR_RANGE(thr, DUK_STR_PROTOTYPE_CHAIN_LIMIT);
+	DUK_WO_NORETURN(return 0;);
 
  pop2_and_false:
 	duk_pop_2_unsafe(thr);
@@ -80380,6 +82509,26 @@ DUK_INTERNAL duk_small_uint_t duk_js_typeof_stridx(duk_tval *tv_x) {
 	return stridx;
 }
 
+/*
+ *  IsArray()
+ */
+
+DUK_INTERNAL duk_bool_t duk_js_isarray_hobject(duk_hobject *h) {
+	DUK_ASSERT(h != NULL);
+#if defined(DUK_USE_ES6_PROXY)
+	h = duk_hobject_resolve_proxy_target(h);
+#endif
+	return (DUK_HOBJECT_GET_CLASS_NUMBER(h) == DUK_HOBJECT_CLASS_ARRAY ? 1 : 0);
+}
+
+DUK_INTERNAL duk_bool_t duk_js_isarray(duk_tval *tv) {
+	DUK_ASSERT(tv != NULL);
+	if (DUK_TVAL_IS_OBJECT(tv)) {
+		return duk_js_isarray_hobject(DUK_TVAL_GET_OBJECT(tv));
+	}
+	return 0;
+}
+
 /*
  *  Array index and length
  *
@@ -81774,6 +83923,7 @@ void duk__putvar_helper(duk_hthread *thr,
                         duk_tval *val,
                         duk_bool_t strict) {
 	duk__id_lookup_result ref;
+	duk_tval tv_tmp_val;
 	duk_tval tv_tmp_obj;
 	duk_tval tv_tmp_key;
 	duk_bool_t parents;
@@ -81791,10 +83941,13 @@ void duk__putvar_helper(duk_hthread *thr,
 	DUK_ASSERT(val != NULL);
 	/* env and act may be NULL */
 
-        DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(env);
-        DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(name);
+	DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(env);
+	DUK_ASSERT_REFCOUNT_NONZERO_HEAPHDR(name);
 	DUK_ASSERT_REFCOUNT_NONZERO_TVAL(val);
 
+	DUK_TVAL_SET_TVAL(&tv_tmp_val, val);  /* Stabilize. */
+	val = NULL;
+
 	/*
 	 *  In strict mode E5 protects 'eval' and 'arguments' from being
 	 *  assigned to (or even declared anywhere).  Attempt to do so
@@ -81826,7 +83979,7 @@ void duk__putvar_helper(duk_hthread *thr,
 
 			tv_val = ref.value;
 			DUK_ASSERT(tv_val != NULL);
-			DUK_TVAL_SET_TVAL_UPDREF(thr, tv_val, val);  /* side effects */
+			DUK_TVAL_SET_TVAL_UPDREF(thr, tv_val, &tv_tmp_val);  /* side effects */
 
 			/* ref.value invalidated here */
 		} else {
@@ -81834,7 +83987,7 @@ void duk__putvar_helper(duk_hthread *thr,
 
 			DUK_TVAL_SET_OBJECT(&tv_tmp_obj, ref.holder);
 			DUK_TVAL_SET_STRING(&tv_tmp_key, name);
-			(void) duk_hobject_putprop(thr, &tv_tmp_obj, &tv_tmp_key, val, strict);
+			(void) duk_hobject_putprop(thr, &tv_tmp_obj, &tv_tmp_key, &tv_tmp_val, strict);
 
 			/* ref.value invalidated here */
 		}
@@ -81859,7 +84012,7 @@ void duk__putvar_helper(duk_hthread *thr,
 
 	DUK_TVAL_SET_OBJECT(&tv_tmp_obj, thr->builtins[DUK_BIDX_GLOBAL]);
 	DUK_TVAL_SET_STRING(&tv_tmp_key, name);
-	(void) duk_hobject_putprop(thr, &tv_tmp_obj, &tv_tmp_key, val, 0);  /* 0 = no throw */
+	(void) duk_hobject_putprop(thr, &tv_tmp_obj, &tv_tmp_key, &tv_tmp_val, 0);  /* 0 = no throw */
 
 	/* NB: 'val' may be invalidated here because put_value may realloc valstack,
 	 * caller beware.
@@ -86341,8 +88494,8 @@ DUK_LOCAL DUK_NOINLINE void duk__numconv_stringify_raw(duk_hthread *thr, duk_sma
 	 */
 
 	uval = duk_double_to_uint32_t(x);
-	if (((double) uval) == x &&  /* integer number in range */
-	    flags == 0) {            /* no special formatting */
+	if (duk_double_equals((double) uval, x) &&  /* integer number in range */
+	    flags == 0) {                           /* no special formatting */
 		/* use bigint area as a temp */
 		duk_uint8_t *buf = (duk_uint8_t *) (&nc_ctx->f);
 		duk_uint8_t *p = buf;
@@ -89276,10 +91429,12 @@ DUK_LOCAL void duk__regexp_match_helper(duk_hthread *thr, duk_small_int_t force_
 			 * as 'undefined'.  The same is done when saved[] pointers are insane
 			 * (this should, of course, never happen in practice).
 			 */
+			duk_push_uarridx(thr, (duk_uarridx_t) (i / 2));
+
 			if (re_ctx.saved[i] && re_ctx.saved[i + 1] && re_ctx.saved[i + 1] >= re_ctx.saved[i]) {
 				duk_push_lstring(thr,
 				                 (const char *) re_ctx.saved[i],
-				                 (duk_size_t) (re_ctx.saved[i+1] - re_ctx.saved[i]));
+				                 (duk_size_t) (re_ctx.saved[i + 1] - re_ctx.saved[i]));
 				if (i == 0) {
 					/* Assumes that saved[0] and saved[1] are always
 					 * set by regexp bytecode (if not, char_end_offset
@@ -89292,8 +91447,8 @@ DUK_LOCAL void duk__regexp_match_helper(duk_hthread *thr, duk_small_int_t force_
 				duk_push_undefined(thr);
 			}
 
-			/* [ ... re_obj input bc saved_buf res_obj val ] */
-			duk_put_prop_index(thr, -2, (duk_uarridx_t) (i / 2));
+			/* [ ... re_obj input bc saved_buf res_obj idx val ] */
+			duk_def_prop(thr, -3, DUK_DEFPROP_HAVE_VALUE | DUK_DEFPROP_SET_WEC);
 		}
 
 		/* [ ... re_obj input bc saved_buf res_obj ] */
@@ -89532,7 +91687,7 @@ DUK_LOCAL duk_uint_t duk__selftest_byte_order(void) {
 		DUK__FAILED("duk_uint32_t byte order");
 	}
 
-	if (u2.d != (double) 102030405060.0) {
+	if (!duk_double_equals(u2.d, 102030405060.0)) {
 		DUK__FAILED("double byte order");
 	}
 
@@ -89907,7 +92062,7 @@ DUK_LOCAL duk_uint_t duk__selftest_cast_double_to_small_uint(void) {
 	u = (duk_small_uint_t) d1;
 	d2 = (duk_double_t) u;
 
-	if (!(d1 == 1.0 && u == 1 && d2 == 1.0 && d1 == d2)) {
+	if (!(duk_double_equals(d1, 1.0) && u == 1 && duk_double_equals(d2, 1.0) && duk_double_equals(d1, d2))) {
 		DUK__FAILED("double to duk_small_uint_t cast failed");
 	}
 
@@ -89917,7 +92072,7 @@ DUK_LOCAL duk_uint_t duk__selftest_cast_double_to_small_uint(void) {
 	uv = (duk_small_uint_t) d1v;
 	d2v = (duk_double_t) uv;
 
-	if (!(d1v == 1.0 && uv == 1 && d2v == 1.0 && d1v == d2v)) {
+	if (!(duk_double_equals(d1v, 1.0) && uv == 1 && duk_double_equals(d2v, 1.0) && duk_double_equals(d1v, d2v))) {
 		DUK__FAILED("double to duk_small_uint_t cast failed");
 	}
 
@@ -96846,98 +99001,6 @@ DUK_INTERNAL void duk_bw_remove_raw_slice(duk_hthread *thr, duk_bufwriter_ctx *b
 	bw->p -= len;
 }
 
-/*
- *  Macro support functions for reading/writing raw data.
- *
- *  These are done using mempcy to ensure they're valid even for unaligned
- *  reads/writes on platforms where alignment counts.  On x86 at least gcc
- *  is able to compile these into a bswap+mov.  "Always inline" is used to
- *  ensure these macros compile to minimal code.
- *
- *  Not really bufwriter related, but currently used together.
- */
-
-DUK_INTERNAL DUK_ALWAYS_INLINE duk_uint16_t duk_raw_read_u16_be(duk_uint8_t **p) {
-	union {
-		duk_uint8_t b[2];
-		duk_uint16_t x;
-	} u;
-
-	duk_memcpy((void *) u.b, (const void *) (*p), (size_t) 2);
-	u.x = DUK_NTOH16(u.x);
-	*p += 2;
-	return u.x;
-}
-
-DUK_INTERNAL DUK_ALWAYS_INLINE duk_uint32_t duk_raw_read_u32_be(duk_uint8_t **p) {
-	union {
-		duk_uint8_t b[4];
-		duk_uint32_t x;
-	} u;
-
-	duk_memcpy((void *) u.b, (const void *) (*p), (size_t) 4);
-	u.x = DUK_NTOH32(u.x);
-	*p += 4;
-	return u.x;
-}
-
-DUK_INTERNAL DUK_ALWAYS_INLINE duk_double_t duk_raw_read_double_be(duk_uint8_t **p) {
-	duk_double_union du;
-	union {
-		duk_uint8_t b[4];
-		duk_uint32_t x;
-	} u;
-
-	duk_memcpy((void *) u.b, (const void *) (*p), (size_t) 4);
-	u.x = DUK_NTOH32(u.x);
-	du.ui[DUK_DBL_IDX_UI0] = u.x;
-	duk_memcpy((void *) u.b, (const void *) (*p + 4), (size_t) 4);
-	u.x = DUK_NTOH32(u.x);
-	du.ui[DUK_DBL_IDX_UI1] = u.x;
-	*p += 8;
-
-	return du.d;
-}
-
-DUK_INTERNAL DUK_ALWAYS_INLINE void duk_raw_write_u16_be(duk_uint8_t **p, duk_uint16_t val) {
-	union {
-		duk_uint8_t b[2];
-		duk_uint16_t x;
-	} u;
-
-	u.x = DUK_HTON16(val);
-	duk_memcpy((void *) (*p), (const void *) u.b, (size_t) 2);
-	*p += 2;
-}
-
-DUK_INTERNAL DUK_ALWAYS_INLINE void duk_raw_write_u32_be(duk_uint8_t **p, duk_uint32_t val) {
-	union {
-		duk_uint8_t b[4];
-		duk_uint32_t x;
-	} u;
-
-	u.x = DUK_HTON32(val);
-	duk_memcpy((void *) (*p), (const void *) u.b, (size_t) 4);
-	*p += 4;
-}
-
-DUK_INTERNAL DUK_ALWAYS_INLINE void duk_raw_write_double_be(duk_uint8_t **p, duk_double_t val) {
-	duk_double_union du;
-	union {
-		duk_uint8_t b[4];
-		duk_uint32_t x;
-	} u;
-
-	du.d = val;
-	u.x = du.ui[DUK_DBL_IDX_UI0];
-	u.x = DUK_HTON32(u.x);
-	duk_memcpy((void *) (*p), (const void *) u.b, (size_t) 4);
-	u.x = du.ui[DUK_DBL_IDX_UI1];
-	u.x = DUK_HTON32(u.x);
-	duk_memcpy((void *) (*p + 4), (const void *) u.b, (size_t) 4);
-	*p += 8;
-}
-
 /*
  *  Assertion helpers
  */
@@ -97276,7 +99339,7 @@ DUK_INTERNAL duk_bool_t duk_double_is_integer(duk_double_t x) {
 	if (duk_double_is_nan_or_inf(x)) {
 		return 0;
 	} else {
-		return duk_js_tointeger_number(x) == x;
+		return duk_double_equals(duk_js_tointeger_number(x), x);
 	}
 }
 
@@ -97296,7 +99359,7 @@ DUK_INTERNAL duk_bool_t duk_is_whole_get_int32_nonegzero(duk_double_t x, duk_int
 	duk_int32_t t;
 
 	t = duk_double_to_int32_t(x);
-	if (!((duk_double_t) t == x)) {
+	if (!duk_double_equals((duk_double_t) t, x)) {
 		return 0;
 	}
 	if (t == 0) {
@@ -97317,7 +99380,7 @@ DUK_INTERNAL duk_bool_t duk_is_whole_get_int32(duk_double_t x, duk_int32_t *ival
 	duk_int32_t t;
 
 	t = duk_double_to_int32_t(x);
-	if (!((duk_double_t) t == x)) {
+	if (!duk_double_equals((duk_double_t) t, x)) {
 		return 0;
 	}
 	*ival = t;
@@ -97330,7 +99393,7 @@ DUK_INTERNAL duk_bool_t duk_is_whole_get_int32(duk_double_t x, duk_int32_t *ival
 
 DUK_INTERNAL DUK_INLINE duk_double_t duk_double_div(duk_double_t x, duk_double_t y) {
 #if !defined(DUK_USE_ALLOW_UNDEFINED_BEHAVIOR)
-	if (DUK_UNLIKELY(y == 0.0)) {
+	if (DUK_UNLIKELY(duk_double_equals(y, 0.0) != 0)) {
 		/* In C99+ division by zero is undefined behavior so
 		 * avoid it entirely.  Hopefully the compiler is
 		 * smart enough to avoid emitting any actual code
@@ -97358,6 +99421,115 @@ DUK_INTERNAL DUK_INLINE duk_double_t duk_double_div(duk_double_t x, duk_double_t
 
 	return x / y;
 }
+
+/* Double and float byteorder changes. */
+
+DUK_INTERNAL DUK_INLINE void duk_dblunion_host_to_little(duk_double_union *u) {
+#if defined(DUK_USE_DOUBLE_LE)
+	/* HGFEDCBA -> HGFEDCBA */
+	DUK_UNREF(u);
+#elif defined(DUK_USE_DOUBLE_ME)
+	duk_uint32_t a, b;
+
+	/* DCBAHGFE -> HGFEDCBA */
+	a = u->ui[0];
+	b = u->ui[1];
+	u->ui[0] = b;
+	u->ui[1] = a;
+#elif defined(DUK_USE_DOUBLE_BE)
+	/* ABCDEFGH -> HGFEDCBA */
+#if defined(DUK_USE_64BIT_OPS)
+	u->ull[0] = DUK_BSWAP64(u->ull[0]);
+#else
+	duk_uint32_t a, b;
+
+	a = u->ui[0];
+	b = u->ui[1];
+	u->ui[0] = DUK_BSWAP32(b);
+	u->ui[1] = DUK_BSWAP32(a);
+#endif
+#else
+#error internal error
+#endif
+}
+
+DUK_INTERNAL DUK_INLINE void duk_dblunion_little_to_host(duk_double_union *u) {
+	duk_dblunion_host_to_little(u);
+}
+
+DUK_INTERNAL DUK_INLINE void duk_dblunion_host_to_big(duk_double_union *u) {
+#if defined(DUK_USE_DOUBLE_LE)
+	/* HGFEDCBA -> ABCDEFGH */
+#if defined(DUK_USE_64BIT_OPS)
+	u->ull[0] = DUK_BSWAP64(u->ull[0]);
+#else
+	duk_uint32_t a, b;
+
+	a = u->ui[0];
+	b = u->ui[1];
+	u->ui[0] = DUK_BSWAP32(b);
+	u->ui[1] = DUK_BSWAP32(a);
+#endif
+#elif defined(DUK_USE_DOUBLE_ME)
+	duk_uint32_t a, b;
+
+	/* DCBAHGFE -> ABCDEFGH */
+	a = u->ui[0];
+	b = u->ui[1];
+	u->ui[0] = DUK_BSWAP32(a);
+	u->ui[1] = DUK_BSWAP32(b);
+#elif defined(DUK_USE_DOUBLE_BE)
+	/* ABCDEFGH -> ABCDEFGH */
+	DUK_UNREF(u);
+#else
+#error internal error
+#endif
+}
+
+DUK_INTERNAL DUK_INLINE void duk_dblunion_big_to_host(duk_double_union *u) {
+	duk_dblunion_host_to_big(u);
+}
+
+DUK_INTERNAL DUK_INLINE void duk_fltunion_host_to_big(duk_float_union *u) {
+#if defined(DUK_USE_DOUBLE_LE) || defined(DUK_USE_DOUBLE_ME)
+	/* DCBA -> ABCD */
+	u->ui[0] = DUK_BSWAP32(u->ui[0]);
+#elif defined(DUK_USE_DOUBLE_BE)
+	/* ABCD -> ABCD */
+	DUK_UNREF(u);
+#else
+#error internal error
+#endif
+}
+
+DUK_INTERNAL DUK_INLINE void duk_fltunion_big_to_host(duk_float_union *u) {
+	duk_fltunion_host_to_big(u);
+}
+
+/* Comparison: ensures comparison operates on exactly correct types, avoiding
+ * some floating point comparison pitfalls (e.g. atan2() assertions failed on
+ * -m32 with direct comparison, even with explicit casts).
+ */
+#if defined(DUK_USE_GCC_PRAGMAS)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wfloat-equal"
+#elif defined(DUK_USE_CLANG_PRAGMAS)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wfloat-equal"
+#endif
+
+DUK_INTERNAL DUK_ALWAYS_INLINE duk_bool_t duk_double_equals(duk_double_t x, duk_double_t y) {
+	return x == y;
+}
+
+DUK_INTERNAL DUK_ALWAYS_INLINE duk_bool_t duk_float_equals(duk_float_t x, duk_float_t y) {
+	return x == y;
+}
+#if defined(DUK_USE_GCC_PRAGMAS)
+#pragma GCC diagnostic pop
+#elif defined(DUK_USE_CLANG_PRAGMAS)
+#pragma clang diagnostic pop
+#endif
 /*
  *  Hash function duk_util_hashbytes().
  *
diff --git a/src/libs/zbxembed/duktape.h b/src/libs/zbxembed/duktape.h
index d51af0f85c..8b33298ccf 100644
--- a/src/libs/zbxembed/duktape.h
+++ b/src/libs/zbxembed/duktape.h
@@ -1,13 +1,13 @@
 /*
- *  Duktape public API for Duktape 2.4.0.
+ *  Duktape public API for Duktape 2.6.0.
  *
  *  See the API reference for documentation on call semantics.  The exposed,
  *  supported API is between the "BEGIN PUBLIC API" and "END PUBLIC API"
  *  comments.  Other parts of the header are Duktape internal and related to
  *  e.g. platform/compiler/feature detection.
  *
- *  Git commit d4f2cff1c592d70f58bab8e1bd85705174c02a58 (v2.4.0).
- *  Git branch master.
+ *  Git commit external (external).
+ *  Git branch external.
  *
  *  See Duktape AUTHORS.rst and LICENSE.txt for copyright and
  *  licensing information.
@@ -109,6 +109,7 @@
  *  * James Swift (https://github.com/phraemer)
  *  * Luis de Bethencourt (https://github.com/luisbg)
  *  * Ian Whyman (https://github.com/v00d00)
+ *  * Rick Sayre (https://github.com/whorfin)
  *  
  *  Other contributions
  *  ===================
@@ -175,16 +176,16 @@
  * development snapshots have 99 for patch level (e.g. 0.10.99 would be a
  * development version after 0.10.0 but before the next official release).
  */
-#define DUK_VERSION                       20400L
+#define DUK_VERSION                       20600L
 
 /* Git commit, describe, and branch for Duktape build.  Useful for
  * non-official snapshot builds so that application code can easily log
  * which Duktape snapshot was used.  Not available in the ECMAScript
  * environment.
  */
-#define DUK_GIT_COMMIT                    "d4f2cff1c592d70f58bab8e1bd85705174c02a58"
-#define DUK_GIT_DESCRIBE                  "v2.4.0"
-#define DUK_GIT_BRANCH                    "master"
+#define DUK_GIT_COMMIT                    "external"
+#define DUK_GIT_DESCRIBE                  "external"
+#define DUK_GIT_BRANCH                    "external"
 
 /* External duk_config.h provides platform/compiler/OS dependent
  * typedefs and macros, and DUK_USE_xxx config options so that
@@ -394,30 +395,35 @@ struct duk_time_components {
 #define DUK_DEFPROP_C                     DUK_DEFPROP_CONFIGURABLE
 #define DUK_DEFPROP_WE                    (DUK_DEFPROP_WRITABLE | DUK_DEFPROP_ENUMERABLE)
 #define DUK_DEFPROP_WC                    (DUK_DEFPROP_WRITABLE | DUK_DEFPROP_CONFIGURABLE)
+#define DUK_DEFPROP_EC                    (DUK_DEFPROP_ENUMERABLE | DUK_DEFPROP_CONFIGURABLE)
 #define DUK_DEFPROP_WEC                   (DUK_DEFPROP_WRITABLE | DUK_DEFPROP_ENUMERABLE | DUK_DEFPROP_CONFIGURABLE)
 #define DUK_DEFPROP_HAVE_W                DUK_DEFPROP_HAVE_WRITABLE
 #define DUK_DEFPROP_HAVE_E                DUK_DEFPROP_HAVE_ENUMERABLE
 #define DUK_DEFPROP_HAVE_C                DUK_DEFPROP_HAVE_CONFIGURABLE
 #define DUK_DEFPROP_HAVE_WE               (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_ENUMERABLE)
 #define DUK_DEFPROP_HAVE_WC               (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_CONFIGURABLE)
+#define DUK_DEFPROP_HAVE_EC               (DUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_HAVE_CONFIGURABLE)
 #define DUK_DEFPROP_HAVE_WEC              (DUK_DEFPROP_HAVE_WRITABLE | DUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_HAVE_CONFIGURABLE)
 #define DUK_DEFPROP_SET_W                 DUK_DEFPROP_SET_WRITABLE
 #define DUK_DEFPROP_SET_E                 DUK_DEFPROP_SET_ENUMERABLE
 #define DUK_DEFPROP_SET_C                 DUK_DEFPROP_SET_CONFIGURABLE
 #define DUK_DEFPROP_SET_WE                (DUK_DEFPROP_SET_WRITABLE | DUK_DEFPROP_SET_ENUMERABLE)
 #define DUK_DEFPROP_SET_WC                (DUK_DEFPROP_SET_WRITABLE | DUK_DEFPROP_SET_CONFIGURABLE)
+#define DUK_DEFPROP_SET_EC                (DUK_DEFPROP_SET_ENUMERABLE | DUK_DEFPROP_SET_CONFIGURABLE)
 #define DUK_DEFPROP_SET_WEC               (DUK_DEFPROP_SET_WRITABLE | DUK_DEFPROP_SET_ENUMERABLE | DUK_DEFPROP_SET_CONFIGURABLE)
 #define DUK_DEFPROP_CLEAR_W               DUK_DEFPROP_CLEAR_WRITABLE
 #define DUK_DEFPROP_CLEAR_E               DUK_DEFPROP_CLEAR_ENUMERABLE
 #define DUK_DEFPROP_CLEAR_C               DUK_DEFPROP_CLEAR_CONFIGURABLE
 #define DUK_DEFPROP_CLEAR_WE              (DUK_DEFPROP_CLEAR_WRITABLE | DUK_DEFPROP_CLEAR_ENUMERABLE)
 #define DUK_DEFPROP_CLEAR_WC              (DUK_DEFPROP_CLEAR_WRITABLE | DUK_DEFPROP_CLEAR_CONFIGURABLE)
+#define DUK_DEFPROP_CLEAR_EC              (DUK_DEFPROP_CLEAR_ENUMERABLE | DUK_DEFPROP_CLEAR_CONFIGURABLE)
 #define DUK_DEFPROP_CLEAR_WEC             (DUK_DEFPROP_CLEAR_WRITABLE | DUK_DEFPROP_CLEAR_ENUMERABLE | DUK_DEFPROP_CLEAR_CONFIGURABLE)
 #define DUK_DEFPROP_ATTR_W                (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_W)
 #define DUK_DEFPROP_ATTR_E                (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_E)
 #define DUK_DEFPROP_ATTR_C                (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_C)
 #define DUK_DEFPROP_ATTR_WE               (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_WE)
 #define DUK_DEFPROP_ATTR_WC               (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_WC)
+#define DUK_DEFPROP_ATTR_EC               (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_EC)
 #define DUK_DEFPROP_ATTR_WEC              (DUK_DEFPROP_HAVE_WEC | DUK_DEFPROP_WEC)
 
 /* Flags for duk_push_thread_raw() */
@@ -661,6 +667,7 @@ DUK_EXTERNAL_DECL void duk_swap_top(duk_context *ctx, duk_idx_t idx);
 DUK_EXTERNAL_DECL void duk_dup(duk_context *ctx, duk_idx_t from_idx);
 DUK_EXTERNAL_DECL void duk_dup_top(duk_context *ctx);
 DUK_EXTERNAL_DECL void duk_insert(duk_context *ctx, duk_idx_t to_idx);
+DUK_EXTERNAL_DECL void duk_pull(duk_context *ctx, duk_idx_t from_idx);
 DUK_EXTERNAL_DECL void duk_replace(duk_context *ctx, duk_idx_t to_idx);
 DUK_EXTERNAL_DECL void duk_copy(duk_context *ctx, duk_idx_t from_idx, duk_idx_t to_idx);
 DUK_EXTERNAL_DECL void duk_remove(duk_context *ctx, duk_idx_t idx);
@@ -1032,6 +1039,8 @@ DUK_EXTERNAL_DECL const char *duk_hex_encode(duk_context *ctx, duk_idx_t idx);
 DUK_EXTERNAL_DECL void duk_hex_decode(duk_context *ctx, duk_idx_t idx);
 DUK_EXTERNAL_DECL const char *duk_json_encode(duk_context *ctx, duk_idx_t idx);
 DUK_EXTERNAL_DECL void duk_json_decode(duk_context *ctx, duk_idx_t idx);
+DUK_EXTERNAL_DECL void duk_cbor_encode(duk_context *ctx, duk_idx_t idx, duk_uint_t encode_flags);
+DUK_EXTERNAL_DECL void duk_cbor_decode(duk_context *ctx, duk_idx_t idx, duk_uint_t decode_flags);
 
 DUK_EXTERNAL_DECL const char *duk_buffer_to_string(duk_context *ctx, duk_idx_t idx);
 
