Show More
Commit Description:
submission report
Commit Description:
submission report
File last commit:
Show/Diff file:
Action:
node_modules/es-abstract/2018/IsDataDescriptor.js | 23 lines | 468 B | application/javascript | JavascriptLexer |
'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;
};