2020-08-25 23:57:08 +00:00
|
|
|
'use strict';
|
|
|
|
|
2024-03-28 02:00:41 +00:00
|
|
|
var $TypeError = require('es-errors/type');
|
2020-08-25 23:57:08 +00:00
|
|
|
|
2024-03-28 02:00:41 +00:00
|
|
|
var isPropertyDescriptor = require('../helpers/records/property-descriptor');
|
|
|
|
var fromPropertyDescriptor = require('../helpers/fromPropertyDescriptor');
|
2020-08-25 23:57:08 +00:00
|
|
|
|
2024-03-28 02:00:41 +00:00
|
|
|
// https://262.ecma-international.org/6.0/#sec-frompropertydescriptor
|
2020-08-25 23:57:08 +00:00
|
|
|
|
|
|
|
module.exports = function FromPropertyDescriptor(Desc) {
|
2024-03-28 02:00:41 +00:00
|
|
|
if (typeof Desc !== 'undefined' && !isPropertyDescriptor(Desc)) {
|
|
|
|
throw new $TypeError('Assertion failed: `Desc` must be a Property Descriptor');
|
2020-08-25 23:57:08 +00:00
|
|
|
}
|
|
|
|
|
2022-11-10 10:43:16 +00:00
|
|
|
return fromPropertyDescriptor(Desc);
|
2020-08-25 23:57:08 +00:00
|
|
|
};
|