0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/test/fixtures/vm-run-in-debug-context.js
Ben Noordhuis cf081a4712 vm: fix crash on fatal error in debug context
Ensure that the debug context has an Environment assigned in case
a fatal error is raised.

The fatal exception handler in node.cc is not equipped to deal with
contexts that don't have one and can't easily be taught that due to
a deficiency in the V8 API: there is no way for the embedder to tell
if the data index is in use.

Fixes: https://github.com/iojs/io.js/issues/1190
PR-URL: https://github.com/iojs/io.js/pull/1229
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-03-22 20:07:49 +01:00

5 lines
146 B
JavaScript

if (process.argv[2] === 'handle-fatal-exception')
process._fatalException = process.exit.bind(null, 42);
require('vm').runInDebugContext('*');