Quick fix for C++ compilation issue: when compiling from single source
distributable, the recently added visibility macros cause Duktape to
both declare and define internal data symbols with "static", which is
not allowed in C++. See GH-63.
The quick fix is to force Duktape to use "extern" for internal symbols
when using C++. This is not ideal because it will increase compiled
binary size by around 10%. A better fix will be developed separately.
Also fixes one cast which causes a C++ compilation error.
Make JSON.stringify() escape U+2028 and U+2029 so that the output is a valid
Ecmascript string even for these characters. This allows the output to be
embedded in a web page or be parsed with eval() without the syntax error that
would otherwise occur -- U+2028 and U+2029 are considered line terminators
in Ecmascript.
Add missing public API documentation for duk_log(). Also make 'make site'
tolerate network errors (from a git pull for Duktape release binaries) to
work better in offline use.
This target is used during development and the git pull just brings the
Duktape binaries up-to-date from duktape-releases. For offline use it's
nice not to fail a 'make site' when network is not available.
The 'make dist-site' target also does a git pull and won't allow an error.
Add =introduced version to API call docs. Reserve =deprecated and =removed
for marking deprecation and removal versions.
For now, render =introduced as a fake tag in the API doc entry.
Add two example allocators to the distributable:
- A logging allocator writes alloc/realloc/free sizes and results to
/tmp/duk-alloc-log.txt. The log includes previous allocation size
for realloc() and free() so that the memory behavior can be played
back and used for e.g. optimizing allocator pool sizes.
- A torture allocator uses red zones to detect out-of-bound writes,
inits data to a non-zero value, and wipes freed memory areas so
accidental reads after freeing are detected more easily. This
allocator can be used on almost any target to detect basic issues
and is useful especially when Valgrind doesn't work on the target.
Also fix some NULL checks in sandbox allocator example.