You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IsDataDescriptor.js 454B

1234567891011121314151617181920212223
  1. 'use strict';
  2. var has = require('has');
  3. var Type = require('./Type');
  4. var assertRecord = require('../helpers/assertRecord');
  5. // https://ecma-international.org/ecma-262/5.1/#sec-8.10.2
  6. module.exports = function IsDataDescriptor(Desc) {
  7. if (typeof Desc === 'undefined') {
  8. return false;
  9. }
  10. assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
  11. if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {
  12. return false;
  13. }
  14. return true;
  15. };