source: imaps-frontend/node_modules/es-abstract/2016/IsGenericDescriptor.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 656 bytes
Line 
1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var IsAccessorDescriptor = require('./IsAccessorDescriptor');
6var IsDataDescriptor = require('./IsDataDescriptor');
7
8var isPropertyDescriptor = require('../helpers/records/property-descriptor');
9
10// https://262.ecma-international.org/6.0/#sec-isgenericdescriptor
11
12module.exports = function IsGenericDescriptor(Desc) {
13 if (typeof Desc === 'undefined') {
14 return false;
15 }
16
17 if (!isPropertyDescriptor(Desc)) {
18 throw new $TypeError('Assertion failed: `Desc` must be a Property Descriptor');
19 }
20
21 if (!IsAccessorDescriptor(Desc) && !IsDataDescriptor(Desc)) {
22 return true;
23 }
24
25 return false;
26};
Note: See TracBrowser for help on using the repository browser.