From 17fbdc18b8cec0b6b2827d9e3c6360b694e6e9c3 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 5 May 2014 16:48:51 +0200 Subject: lib: name EventEmitter prototype methods Before this commit the EventEmitter methods were anonymous functions. V8 tries to infer names for anonymous functions based on the execution context but it frequently gets it wrong and when that happens, the stack trace is usually confusing and unhelpful. This commit names all methods so V8 can fall back to the method.name property. The above gotcha applies to all anonymous functions but is exacerbated for EventEmitter methods because those are invoked with a plenitude of different receivers. Signed-off-by: Trevor Norris --- test/message/stdin_messages.out | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/message') diff --git a/test/message/stdin_messages.out b/test/message/stdin_messages.out index cd7c12a7b9..2dc4574bf6 100644 --- a/test/message/stdin_messages.out +++ b/test/message/stdin_messages.out @@ -8,7 +8,7 @@ SyntaxError: Strict mode code may not include a with statement at Module._compile (module.js:*:*) at evalScript (node.js:*:*) at Socket. (node.js:*:*) - at Socket.EventEmitter.emit (events.js:*:*) + at Socket.emit (events.js:*:*) at _stream_readable.js:*:* at process._tickCallback (node.js:*:*) 42 @@ -23,7 +23,7 @@ Error: hello at Module._compile (module.js:*:*) at evalScript (node.js:*:*) at Socket. (node.js:*:*) - at Socket.EventEmitter.emit (events.js:*:*) + at Socket.emit (events.js:*:*) at _stream_readable.js:*:* at process._tickCallback (node.js:*:*) @@ -36,7 +36,7 @@ Error: hello at Module._compile (module.js:*:*) at evalScript (node.js:*:*) at Socket. (node.js:*:*) - at Socket.EventEmitter.emit (events.js:*:*) + at Socket.emit (events.js:*:*) at _stream_readable.js:*:* at process._tickCallback (node.js:*:*) 100 @@ -50,7 +50,7 @@ ReferenceError: y is not defined at Module._compile (module.js:*:*) at evalScript (node.js:*:*) at Socket. (node.js:*:*) - at Socket.EventEmitter.emit (events.js:*:*) + at Socket.emit (events.js:*:*) at _stream_readable.js:*:* at process._tickCallback (node.js:*:*) -- cgit v1.2.1