Direct comparison may have portability concerns because a constant may
have more precision than its counterpart. Even a direct cast before
a comparison may not work (e.g. Math.atan2() assert with gcc -m32 still
fails even when both sides have an explicit double cast). So use an
internal always-inline helper for float/double comparisons, which also
allows -Wfloat-equal warning to be suppressed in a single helper; add
a clang pragma option so that both gcc and clang suppress the warning.
Other changes:
* Add -Wfloat-equal warning back to the Makefile.
* Fix all internal float comparison call sites to use the helper.
* Add code policy check for probable floating point comparison
(not very important with -Wfloat-equal enabled).
* Add API documentation for duk_cbor_encode() and duk_cbor_decode().
* Add placeholder release notes for 2.5.
* Add CBOR binding guide section.
* Include CBOR in dist README and site index page.
* Add minimal CBOR config options.
* Add 'CBOR' built-in YAML metadata.
* Add a public C API for CBOR.
* Remove examples/cmdline support for extras/cbor, use built-in CBOR
instead.
* Makefile, dist/tools changes.
* Rewrite CBOR extra to use Duktape internal helpers, also some related
refactoring.
* Bump DUK_VERSION to 2.4.0.
* Release checklist updates.
* Releases file update.
* Finalize release notes.
* Remove experimental status from some API calls.
* Bump LICENSE.txt year range.
* Add new public symbols to API test.
* CBOR extra trivial compile warning fix.
* Compile warning fix when hex support disabled.
* Update test262 known issues.
* Update index page footprints.
* Improve options for thumb index page size build.
* Add missing "skip: true" metadata to a CBOR test.
* AUTHORS update.
* Faster float encode, rely on the already done cast rather than
building the float representation (as for half floats).
* Faster checkbreak in decoding. More unlikely macros for decode.
* Faster uint32 decode.
* Decode integers in range [-0x80000000,0xffffffff] into fastints
when they are encoded with minimal length.
* Rework duk_require_stack() handling, avoid it for primitives and
only do it in non-primitive code paths (= array and map, and on
initial decode entry).
* Prototype of full decode switch table.
* Comment trivia.
* Fix some compiler warnings.
* Rename hobject helper functions for property entry access.
* Add helpers for looking up _Formals and _Varmap without inheritance.
* Add duk_xget_owndataprop() + variants for internal property lookups
without inheritance or side effects.
* Date built-in fix for .setTime(), .setYear(), etc on a frozen Date
instance. These should be allowed because they operate on an internal
slot which is not under normal property access control. Previously
the operations were incorrectly rejected with a TypeError.
* Changes to internal property definition and lookup here and there.
Mostly the changes should be no-op because e.g. inheritance only
matters if the internal property might be missing (which is not
usually the case).
When array size is limited to 16 bits, some internal operations which
don't support abandoning the array could try to grow it beyond 16 bits
rather than abandoning the array part. This caused an assertion failure
and also potentially memory unsafe behavior.
Changes:
* When growing the property table, sanity check entry and array sizes.
If the new values won't fit in the duk_hobject structure (which may
happen with 16-bit fields), fail the grow attempt with an internal
error. This avoids field truncation and potentially memory unsafe
behavior as a result.
* Rework array part growth vs. abandon code to avoid the GH-2023 issue.
* Add support for keeping array part when possible into
Object.defineProperty().
* Add support for abandoning array part when using internal variants
for defining properties (such as in Array .map()).
* Executor compile warning fix.
* Debug logging trivia, downgrade a noisy log entry.
* Fix compile warning in duk_cmdline.c.
When bytecode files are loaded, there are no memory safety guarantees
for invalid inputs. Reject bytecode files unless -b is given to
explicitly allow automatic bytecode file detection.