duk_require_heapptr() call now throws a TypeError instead of a RangeError for
an invalid index. This is not ideal, but is more consistent with other API
call behavior (at the moment; it'd be better if RangeErrors were used for
index errors in general).
The call returns a non-NULL duk_tval pointer to a static DUK_TAG_UNUSED so
that a call site can avoid an unnecessary NULL check. This is useful for
e.g. calls like duk_get_boolean().
Previous implementation avoided side effects during string table resize.
This is sufficient in most cases but not in the following:
- Caller pushes a string using duk_push_lstring(), with the data and
length referencing the data area of a dynamic or external buffer.
- When allocating a new duk_hstring a side effect triggers a finalizer.
- The finalizer resizes or reconfigures the dynamic/external buffer so
that the original duk_push_lstring() arguments are invalidated.
- When it's time to copy the data over into the duk_hstring, the pointer
and/or length are invalid and memory unsafe behavior follows.
Avoid this problem by preventing mark-and-sweep side effects for the duration
of the entire string intern processing.
* Tolerate Proxy setup errors in case Proxy throws (= disabled).
* Fix bug in JX encoding error handling. Incorrect quote marks caused
value to be number coerced (+v) rather than string coerced (''+v).
Change handling of plain buffers so that they behave like ArrayBuffer
instances to Ecmascript code, with limitations such as not being
extensible and all properties being virtualized. This simplifies
Ecmascript code as plain buffers are just lightweight ArrayBuffers
(similarly to how lightfuncs appear as function objects). There are
a lot of small changes in how the built-in objects and methods, and
the C API deals with plain buffer values.
Also make a few small changes to plain pointer and lightfunc handling
to improve consistency with how plain buffers are now handled.