From d7e9bb7bdefee04ccaff3f9ab89124ef4b966879 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 21 Jan 2016 13:07:25 -0500 Subject: process: support symbol events MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Event emitters support symbols as event names. The process object assumes that the event name is a string, and examines the first three characters to check for signals. This causes an exception if the event name is a symbol. This commit ensures that the event name is a string before trying to slice() it. PR-URL: https://github.com/nodejs/node/pull/4798 Reviewed-By: Sam Roberts Reviewed-By: Michaƫl Zasso Reviewed-By: Wyatt Preul --- src/node.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/node.js b/src/node.js index c194c239c..41e8fb195 100644 --- a/src/node.js +++ b/src/node.js @@ -782,7 +782,8 @@ var signalWraps = {}; function isSignal(event) { - return event.slice(0, 3) === 'SIG' && + return typeof event === 'string' && + event.slice(0, 3) === 'SIG' && startup.lazyConstants().hasOwnProperty(event); } -- cgit v1.2.3