diff options
Diffstat (limited to 'node_modules/es-abstract/helpers/isPropertyDescriptor.js')
-rw-r--r-- | node_modules/es-abstract/helpers/isPropertyDescriptor.js | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/node_modules/es-abstract/helpers/isPropertyDescriptor.js b/node_modules/es-abstract/helpers/isPropertyDescriptor.js deleted file mode 100644 index 3eff7eb..0000000 --- a/node_modules/es-abstract/helpers/isPropertyDescriptor.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -var GetIntrinsic = require('../GetIntrinsic'); - -var has = require('has'); -var $TypeError = GetIntrinsic('%TypeError%'); - -module.exports = function IsPropertyDescriptor(ES, Desc) { - if (ES.Type(Desc) !== 'Object') { - return false; - } - var allowed = { - '[[Configurable]]': true, - '[[Enumerable]]': true, - '[[Get]]': true, - '[[Set]]': true, - '[[Value]]': true, - '[[Writable]]': true - }; - - for (var key in Desc) { // eslint-disable-line no-restricted-syntax - if (has(Desc, key) && !allowed[key]) { - return false; - } - } - - if (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) { - throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); - } - return true; -}; |