mirror of
https://github.com/hanzoai/core-js.git
synced 2026-09-24 16:58:15 +00:00
use a error constructor with new
This commit is contained in:
@@ -3,6 +3,6 @@ var $TypeError = TypeError;
|
||||
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
|
||||
|
||||
module.exports = function (it) {
|
||||
if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
|
||||
if (it > MAX_SAFE_INTEGER) throw new $TypeError('Maximum allowed index exceeded');
|
||||
return it;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user