Skip to content

Commit

Permalink
Add new to RangeError
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nstepien authored and mathiasbynens committed Mar 27, 2015
1 parent cddec52 commit 702cc2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion punycode.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
* @returns {Error} Throws a `RangeError` with the applicable error message.
*/
function error(type) {
throw RangeError(errors[type]);
throw new RangeError(errors[type]);
}

/**
Expand Down

0 comments on commit 702cc2d

Please sign in to comment.