Permalink
Cannot retrieve contributors at this time
23 lines (15 sloc)
449 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/es-abstract/2022/IsDataDescriptor.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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; | |
}; |