Check entry part before array part. The order of the check doesn't matter
functionally because a property never exists in both parts. Because there
is an array fast path, array index reads are rarely handled by the generic
property lookup code, so checking the entry part first performs a bit better.
Both duk_hthread and duk_context typedefs resolve to struct duk_hthread
internally. In external API duk_context resolves to struct duk_hthread
which is intentionally left undefined as the struct itself is not
dereferenced. Change internal code to use duk_hthread exclusively which
removes unnecessary and awkward thr <-> ctx casts from internals.
The basic guidelines are:
* Public API uses duk_context in prototype declarations. The intent is to
hide the internal type, and there's already a wide dependency on the
type name.
* All internal code, both declarations and definitions, use duk_hthread
exclusively. This is done even for API functions, i.e. an API function
declared as "void duk_foo(duk_context *ctx);" is then defined as
"void duk_foo(duk_hthread *thr);".
Remove the special ecma-to-ecma call setup code and just use the normal
unprotected call setup code for that instead. Most of the code is the
same; just before calling into the bytecode executor check if the current
executor can be reused, and if so, indicate the situation using a special
return code.
Also remove internal duk_handle_call_protected() and implement all
protected API calls via duk_safe_call(). This reduces footprint and code
duplication further.
Rework call handling to use helpers more to make the call handling code
easier to follow.
Various other minor changer, e.g. DUK_OP_NEW is now DUK_OP_CONSCALL and
bytecode sets up the initial default instance.
Replaced #ifdefs with DUK_U64_CONSTANT and DUK_I64_CONSTANT macros for cleaner
code and to prevent future breakage, as suggested by svaarala.
Missed a few replacements. Added.
Last one.
Changed parameter name from x to a.
Split MinGW and MSVC typedefs for 64-bit types.
Added myself to list of code contributors.
Add support for 'new.target' expression without yet adding support for an
explicit newTarget which may differ from the constructor function being
called.