diff --git a/package.json b/package.json index 6d6a16e..9695716 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,8 @@ "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", "set-function-name": "^2.0.2" }, "devDependencies": { diff --git a/shim.js b/shim.js index 3ec77c1..9d22c8b 100644 --- a/shim.js +++ b/shim.js @@ -2,15 +2,15 @@ var supportsDescriptors = require('define-properties').supportsDescriptors; var getPolyfill = require('./polyfill'); -var gOPD = Object.getOwnPropertyDescriptor; +var gOPD = require('gopd'); var defineProperty = Object.defineProperty; -var TypeErr = TypeError; -var getProto = Object.getPrototypeOf; +var $TypeError = require('es-errors'); +var getProto = require('get-proto'); var regex = /a/; module.exports = function shimFlags() { if (!supportsDescriptors || !getProto) { - throw new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors'); + throw new $TypeError('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors'); } var polyfill = getPolyfill(); var proto = getProto(regex);