Skip to content

Commit 702cc2d

Browse files
nstepienmathiasbynens
authored andcommitted
Add new to RangeError
Although it is optional, when not including `new` you potentially lose a single useful frame in the stack trace and add a useless frame. nodejs/node#1246 Closes #32.
1 parent cddec52 commit 702cc2d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

punycode.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
* @returns {Error} Throws a `RangeError` with the applicable error message.
6565
*/
6666
function error(type) {
67-
throw RangeError(errors[type]);
67+
throw new RangeError(errors[type]);
6868
}
6969

7070
/**

0 commit comments

Comments
 (0)