mirror of
https://github.com/biobulkbende/biobulkbende.org.git
synced 2024-11-16 04:43:05 +00:00
37 lines
801 B
JavaScript
Generated
37 lines
801 B
JavaScript
Generated
'use strict';
|
|
|
|
var assertRecord = require('../helpers/assertRecord');
|
|
|
|
var Type = require('./Type');
|
|
|
|
// https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
|
|
|
|
module.exports = function FromPropertyDescriptor(Desc) {
|
|
if (typeof Desc === 'undefined') {
|
|
return Desc;
|
|
}
|
|
|
|
assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
|
|
|
|
var obj = {};
|
|
if ('[[Value]]' in Desc) {
|
|
obj.value = Desc['[[Value]]'];
|
|
}
|
|
if ('[[Writable]]' in Desc) {
|
|
obj.writable = Desc['[[Writable]]'];
|
|
}
|
|
if ('[[Get]]' in Desc) {
|
|
obj.get = Desc['[[Get]]'];
|
|
}
|
|
if ('[[Set]]' in Desc) {
|
|
obj.set = Desc['[[Set]]'];
|
|
}
|
|
if ('[[Enumerable]]' in Desc) {
|
|
obj.enumerable = Desc['[[Enumerable]]'];
|
|
}
|
|
if ('[[Configurable]]' in Desc) {
|
|
obj.configurable = Desc['[[Configurable]]'];
|
|
}
|
|
return obj;
|
|
};
|