summaryrefslogtreecommitdiff
path: root/lib/events.js
diff options
context:
space:
mode:
authorMayhem <stepien.nicolas@gmail.com>2015-03-24 15:15:57 +0100
committerBrendan Ashworth <brendan.ashworth@me.com>2015-03-24 12:42:15 -0700
commit1832743e181149c16ccd3752247f4306d3aa0fe1 (patch)
tree936fa7014782d993aef319599602ecd61c704788 /lib/events.js
parent7dd5e824be53e222af63cc86e89b7ab7f841901c (diff)
downloadnodejs-1832743e181149c16ccd3752247f4306d3aa0fe1.tar.gz
nodejs-1832743e181149c16ccd3752247f4306d3aa0fe1.tar.bz2
nodejs-1832743e181149c16ccd3752247f4306d3aa0fe1.zip
lib: add missing `new` for errors lib/*.js
Not including `new` adds a useless frame and removes a potentially useful frame. PR-URL: https://github.com/iojs/io.js/pull/1246 Reviewed-By: Petka Antonov <petka_antonov@hotmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Diffstat (limited to 'lib/events.js')
-rw-r--r--lib/events.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/events.js b/lib/events.js
index 6bd2a77db..064f3838b 100644
--- a/lib/events.js
+++ b/lib/events.js
@@ -140,7 +140,7 @@ EventEmitter.prototype.emit = function emit(type) {
} else if (er instanceof Error) {
throw er; // Unhandled 'error' event
} else {
- throw Error('Uncaught, unspecified "error" event.');
+ throw new Error('Uncaught, unspecified "error" event.');
}
return false;
}