All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.2016.IsDataDescriptor.js Maven / Gradle / Ivy

There is a newer version: 1.22.3
Show newest version
'use strict';

var has = require('has');

var Type = require('./Type');

var assertRecord = require('../helpers/assertRecord');

// https://262.ecma-international.org/5.1/#sec-8.10.2

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;
};




© 2015 - 2025 Weber Informatics LLC | Privacy Policy