This will make it more probable that the initial compilation works without
investigating a linker error.
Ideally the Makefile would detect readline availability, but that would
require `uname` or some other platform hackery, which is probably too
heavyweight for a simple example Makefile.
Fix a few edge cases related to local time handling near the valid Ecmascript
time value limits. Two test262 test cases failed due to recently added sanity
checks (which were necessary to avoid integer overflows in extreme cases), and
one assert was broken.
There's no need for a release note because this merge fixes issues introduced
by other changes in the release.
Tzoffset calculations would be skipped if a temporary time value was just
outside the Ecmascript range. This can happen in some legitimate cases,
so a +/- 24h leeway was added to the check. This fixes a few test262
cases documented in test-bug-date-timeval-edges.js.
Similarly, add a +/- 24h leeway for an assert in local-time-to-parts
conversion. When converting a time value to parts and the parts are
requested in local time, a temporary time value (simulating local time) can
be just outside the Ecmascript range. Allow +/- 24h leeway in the assert
to avoid triggering it in valid edge cases.
See test-bug-date-timeval-edges.js for demonstration of both issues.
Two test262 cases failed. The tests use Date constructor to create timestamps
near the Ecmascript valid range edge. The Date constructor operates with local
time values, which caused some previous sanity checks to trigger: temporary
time values which have a local tzoffset can be just outside the valid Ecmascript
range which trigger some invalid behavior and one assert failure.
Reorganize Makefiles and a few other files both in the repo itself and
in the resulting dist package. This should make it clearer which makefiles
are intended to work from the dist directory only (as opposed to the Duktape
repo itself).
Fix value stack resize handling after a function call.
Call handling must ensure that whatever value stack size has been requested
by the application (with duk_{check,require}_stack()) is guaranteed also
after a function call returns. Previously the guaranteed size might have
been reduced (there's a testcase demonstrating this in the commit).
Without compact flag, valstack resize helper would always add more spare,
which would accumulate. This luckily broke test-bi-array-proto-join.js.
The commit also removes one helper layer from valstack resizing.
Add an overview section on how Duktape is compiled, with specific emphasis on:
- no official Makefile or build script
- Duktape can be compiled as a static or dynamic library too
- application MUST include duktape.h; all API calls can be macros
C++ discussion is moved into Compiling section.