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/2017/IsDataDescriptor.js')
-rw-r--r--node_modules/es-abstract/2017/IsDataDescriptor.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/node_modules/es-abstract/2017/IsDataDescriptor.js b/node_modules/es-abstract/2017/IsDataDescriptor.js
new file mode 100644
index 000000000..0ad304585
--- /dev/null
+++ b/node_modules/es-abstract/2017/IsDataDescriptor.js
@@ -0,0 +1,23 @@
+'use strict';
+
+var has = require('has');
+
+var assertRecord = require('../helpers/assertRecord');
+
+var Type = require('./Type');
+
+// https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
+
+module.exports = function IsDataDescriptor(Desc) {
+ if (typeof Desc === 'undefined') {
+ return false;
+ }
+
+ assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
+
+ if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {
+ return false;
+ }
+
+ return true;
+};