Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/es-abstract/2016/IsGenericDescriptor.js')
-rw-r--r--node_modules/es-abstract/2016/IsGenericDescriptor.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/node_modules/es-abstract/2016/IsGenericDescriptor.js b/node_modules/es-abstract/2016/IsGenericDescriptor.js
new file mode 100644
index 000000000..8618ce414
--- /dev/null
+++ b/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;
+};