0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/test/message/eval_messages.out
Ben Noordhuis c5b07d4ec6 lib: fix beforeExit not working with -e
Commit 93a44d5 ("src: fix deferred events not working with -e") defers
evaluation of the script to the next tick.

A side effect of that change is that 'beforeExit' listeners run before
the actual script.  'beforeExit' is emitted when the event loop is
empty but process.nextTick() does not ref the event loop.

Fix that by using setImmediate().  Because it is implemented in terms
of a uv_check_t handle, it interacts with the event loop properly.

Fixes: https://github.com/nodejs/node/issues/8534
PR-URL: https://github.com/nodejs/node/pull/8821
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-10-24 23:12:47 +02:00

64 lines
2.0 KiB
Plaintext

[eval]
[eval]:1
with(this){__filename}
^^^^
SyntaxError: Strict mode code may not include a with statement
at Object.exports.runInThisContext (vm.js:*)
at Object.<anonymous> ([eval]-wrapper:*:*)
at Module._compile (module.js:*:*)
at Immediate.<anonymous> (bootstrap_node.js:*:*)
at runCallback (timers.js:*:*)
at tryOnImmediate (timers.js:*:*)
at processImmediate [as _immediateCallback] (timers.js:*:*)
42
42
[eval]:1
throw new Error("hello")
^
Error: hello
at [eval]:1:7
at ContextifyScript.Script.runInThisContext (vm.js:*)
at Object.exports.runInThisContext (vm.js:*)
at Object.<anonymous> ([eval]-wrapper:*:*)
at Module._compile (module.js:*:*)
at Immediate.<anonymous> (bootstrap_node.js:*:*)
at runCallback (timers.js:*:*)
at tryOnImmediate (timers.js:*:*)
at processImmediate [as _immediateCallback] (timers.js:*:*)
[eval]:1
throw new Error("hello")
^
Error: hello
at [eval]:1:7
at ContextifyScript.Script.runInThisContext (vm.js:*)
at Object.exports.runInThisContext (vm.js:*)
at Object.<anonymous> ([eval]-wrapper:*:*)
at Module._compile (module.js:*:*)
at Immediate.<anonymous> (bootstrap_node.js:*:*)
at runCallback (timers.js:*:*)
at tryOnImmediate (timers.js:*:*)
at processImmediate [as _immediateCallback] (timers.js:*:*)
100
[eval]:1
var x = 100; y = x;
^
ReferenceError: y is not defined
at [eval]:1:16
at ContextifyScript.Script.runInThisContext (vm.js:*)
at Object.exports.runInThisContext (vm.js:*)
at Object.<anonymous> ([eval]-wrapper:*:*)
at Module._compile (module.js:*:*)
at Immediate.<anonymous> (bootstrap_node.js:*:*)
at runCallback (timers.js:*:*)
at tryOnImmediate (timers.js:*:*)
at processImmediate [as _immediateCallback] (timers.js:*:*)
[eval]:1
var ______________________________________________; throw 10
^
10
[eval]:1
var ______________________________________________; throw 10
^
10
done