Without the compare function std::map simply compares one
pointer to another. However we need to compare the actual
strings.
Besides we must not efree normalised_module_id on return
of require method, since the pointer was added to
modules_loaded (and is valid until destruction of V8Js
class); instead it is now freed during V8Js object destruction.
Currently it just enables RSHUTDOWN code that should print
memory usage statistics. However the code implements API calls
that aren't supported anymore (for a long time).
The V8::TerminateExecution does *not* immediately terminate execution
as its name might suggest. It just marks the given isolate as
"to terminate" and the execution thread checks - from time to time -
whether to terminate. For v8 itself this is not problematic as
the call is thought to stop long-running scripts executed in the
browser context.
As v8js exposes this function to JavaScript with the exit() method,
this behaviour is confusing. In order to stop code execution right
at the exit() call, v8js enters an endless loop and waits for v8
to terminate execution within it.
Added a "%s" so both messages are matched:
* Extension or internal compilation error: MakeReferenceError in handlebars at line 1.
* Extension or internal compilation error in handlebars at line 1.
We need to reset V8JSG(timer_stop) and V8JSG(timer_thread), otherwise
subsequent requests fail on multi-request SAPIs.
If we don't reset those, a subsequent request will not start a new timer
thread (as V8JSG(timer_thread) != NULL), but will try to join the thread
(once more) in GSHUTDOWN as V8JSG(timer_thread) still is non-NULL and
hence cause program termination.
Just tested it, v8js builds correctly with 3.24.6 and fails to build
against 3.24.5 due to `RequestInterrupt' being undefined.
Syncing the check in config.m4 (used to test 3.21.12 or newer) against
README.md file (which stated 3.24.10 or newer).
Splits longish v8js.cc file into pieces. It used to contain the
definitions of all V8Js exception classes, the V8Js class itself as
well as the V8Object/V8Function classes... besides the module setup
code itself.
This change factors out all exception class definitions into a
seperate pair of files (v8js_exceptions.*).
The V8Js class definition itself is moved to v8js_class.* pair,
with the v8 init & call code moved to v8js_v8.* pair
and the watchdog timer to v8js_timer.* pair.
The V8Object/V8Function code was moved to v8js_v8object_class.*
pair, not differentiating between the two like before.