You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3c798e2
Browse filesBrowse the repository at this point in the historyBrowse files
Every directory gets its require from the JS require factory, and the
call into that factory is an interrupt check. A worker.terminate() that
reached the worker's isolate since its previous check made the call come
back empty, and the NS_CHECK on its result aborted the whole app:
NS_CHECK failed: success && !result.IsEmpty() && result->IsFunction(),
at ModuleInternal.cpp:302
The usual way in is terminating a worker that is still loading its entry
module (new Worker, a few milliseconds of work on the parent, then
terminate()). createRequire() reaches the same call from JS.
GetRequireFunction now returns a MaybeLocal and leaves the termination
pending. LoadModule throws the same NativeScriptException its other
interrupted steps throw, so the load unwinds like a terminate() that
lands in the module body; createRequire returns to JS with the
termination pending. The mint done while the runtime boots keeps the
hard check: terminate() cannot reach the isolate that early.
A native callback that fails rethrows into V8 through
NativeScriptException::ReThrowToV8, and Isolate::ThrowException replaces
whatever exception is pending. When the failure was the isolate being
terminated, the termination became an ordinary error, so a worker that
wraps the call in try/catch caught it and carried on running after
terminate(). ReThrowToV8 now leaves a pending termination alone, on
entry and again right before the throw, since building the error to
rethrow can itself run JS.
0 commit comments