source: imaps-frontend/node_modules/es-abstract/2022/CreateMethodProperty.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 940 bytes
RevLine 
[d565449]1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var DefineOwnProperty = require('../helpers/DefineOwnProperty');
6
7var FromPropertyDescriptor = require('./FromPropertyDescriptor');
8var IsDataDescriptor = require('./IsDataDescriptor');
[79a0317]9var isPropertyKey = require('../helpers/isPropertyKey');
[d565449]10var SameValue = require('./SameValue');
[79a0317]11
12var isObject = require('../helpers/isObject');
[d565449]13
14// https://262.ecma-international.org/6.0/#sec-createmethodproperty
15
16module.exports = function CreateMethodProperty(O, P, V) {
[79a0317]17 if (!isObject(O)) {
[d565449]18 throw new $TypeError('Assertion failed: Type(O) is not Object');
19 }
20
[79a0317]21 if (!isPropertyKey(P)) {
22 throw new $TypeError('Assertion failed: P is not a Property Key');
[d565449]23 }
24
25 var newDesc = {
26 '[[Configurable]]': true,
27 '[[Enumerable]]': false,
28 '[[Value]]': V,
29 '[[Writable]]': true
30 };
31 return DefineOwnProperty(
32 IsDataDescriptor,
33 SameValue,
34 FromPropertyDescriptor,
35 O,
36 P,
37 newDesc
38 );
39};
Note: See TracBrowser for help on using the repository browser.