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 |
|
---|
3 | var $TypeError = require('es-errors/type');
|
---|
4 |
|
---|
5 | var IsAccessorDescriptor = require('./IsAccessorDescriptor');
|
---|
6 | var IsDataDescriptor = require('./IsDataDescriptor');
|
---|
7 |
|
---|
8 | var isPropertyDescriptor = require('../helpers/records/property-descriptor');
|
---|
9 |
|
---|
10 | // https://262.ecma-international.org/6.0/#sec-isgenericdescriptor
|
---|
11 |
|
---|
12 | module.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.