From 46e43f4bde4a35785b4997b81e86cd19f046b69b Mon Sep 17 00:00:00 2001 From: Minteck Date: Tue, 21 Dec 2021 16:52:28 +0100 Subject: Commit --- .../es-abstract/2016/IsGenericDescriptor.js | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/node_modules/es-abstract/2016/IsGenericDescriptor.js (limited to 'src/node_modules/es-abstract/2016/IsGenericDescriptor.js') diff --git a/src/node_modules/es-abstract/2016/IsGenericDescriptor.js b/src/node_modules/es-abstract/2016/IsGenericDescriptor.js new file mode 100644 index 0000000..8618ce4 --- /dev/null +++ b/src/node_modules/es-abstract/2016/IsGenericDescriptor.js @@ -0,0 +1,23 @@ +'use strict'; + +var assertRecord = require('../helpers/assertRecord'); + +var IsAccessorDescriptor = require('./IsAccessorDescriptor'); +var IsDataDescriptor = require('./IsDataDescriptor'); +var Type = require('./Type'); + +// https://www.ecma-international.org/ecma-262/6.0/#sec-isgenericdescriptor + +module.exports = function IsGenericDescriptor(Desc) { + if (typeof Desc === 'undefined') { + return false; + } + + assertRecord(Type, 'Property Descriptor', 'Desc', Desc); + + if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) { + return true; + } + + return false; +}; -- cgit