Change function .arguments and .caller behavior to be in line with the
latest specification:
* No own .arguments or .caller property for Function instances. V8 provides
non-strict functions with null .caller and .arguments properties (but they
are not required by the specification).
* Inherit .arguments and .caller thrower from Function.prototype.
Also change %ThrowTypeError%.name to the empty string to match V8.
* Add DUK_F_DJGPP.h.in to detect and provide DJGPP convenience defines.
* Add a separate platform for MSDOS, now supporting DJGPP only.
* Add DJGPP identification to compiler_gcc.h.in.
Fix a realloc() memory leak which would happen when:
- a previous allocation exists ('ptr' is non-NULL); and
- the new 'size' is zero; and
- a voluntary GC (or GC torture) causes the initial realloc() attempt
to be bypassed
In this case the slow path would incorrectly assume that it was entered
after realloc() had returned a NULL, which for a zero new 'size' would
mean that 'ptr' was successfully freed and no further action was necessary.
But because the realloc() had actually been bypassed, this would cause the
old 'ptr' to leak.
Restructure string intern check:
- Compute string hash and perform strtable lookup; if found, it
must already be a valid Symbol or valid WTF-8 data so no WTF-8
sanitization steps are needed. Return found string.
- Otherwise perform a "keepcheck" to see if the candidate string
can be used as is (i.e. it is valid Symbol or valid WTF-8).
If so, we know it's not in the strtable so intern the string.
- Otherwise the string needs WTF-8 sanitization. After sanitizing,
rehash the sanitized data, perform another strtable lookup and
return existing string or intern the sanitized string.
This speeds up string intern processing for (1) strings already in
the string table and (2) valid WTF-8 strings which should be the
vast majority of strings interned. Only strings that are invalid
WTF-8, i.e. contain uncombined surrogate pairs or outright data,
will need sanitization.
Other minor changes:
- Add some WTF-8 documentation to tentative 3.0 release notes.
- Add a 3.0 release entry.
NaN normalization check should use a full NaN check to decide when to
normalize, even when using partial NaN initialization. The fix here
is to switch to full NaN initialization in general.
Input 'val' pointer may be a value stack pointer, which may become
stale if the variable lookup reallocates the current value stack.
This can happen e.g. in a with(proxy).
Rename duk_is_null_or_undefined() to duk_is_nullish() to better match
current ECMAScript terminology. Keep duk_is_null_or_undefined() as a
deprecated API macro. Add internal DUK_TVAL_IS_NULLISH().