|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
944 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | var $TypeError = require('es-errors/type');
|
|---|
| 4 | var isObject = require('es-object-atoms/isObject');
|
|---|
| 5 |
|
|---|
| 6 | var DefineOwnProperty = require('../helpers/DefineOwnProperty');
|
|---|
| 7 |
|
|---|
| 8 | var FromPropertyDescriptor = require('./FromPropertyDescriptor');
|
|---|
| 9 | var IsDataDescriptor = require('./IsDataDescriptor');
|
|---|
| 10 | var isPropertyKey = require('../helpers/isPropertyKey');
|
|---|
| 11 | var SameValue = require('./SameValue');
|
|---|
| 12 |
|
|---|
| 13 | // https://262.ecma-international.org/6.0/#sec-createmethodproperty
|
|---|
| 14 |
|
|---|
| 15 | module.exports = function CreateMethodProperty(O, P, V) {
|
|---|
| 16 | if (!isObject(O)) {
|
|---|
| 17 | throw new $TypeError('Assertion failed: Type(O) is not Object');
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | if (!isPropertyKey(P)) {
|
|---|
| 21 | throw new $TypeError('Assertion failed: P is not a Property Key');
|
|---|
| 22 | }
|
|---|
| 23 |
|
|---|
| 24 | var newDesc = {
|
|---|
| 25 | '[[Configurable]]': true,
|
|---|
| 26 | '[[Enumerable]]': false,
|
|---|
| 27 | '[[Value]]': V,
|
|---|
| 28 | '[[Writable]]': true
|
|---|
| 29 | };
|
|---|
| 30 | return DefineOwnProperty(
|
|---|
| 31 | IsDataDescriptor,
|
|---|
| 32 | SameValue,
|
|---|
| 33 | FromPropertyDescriptor,
|
|---|
| 34 | O,
|
|---|
| 35 | P,
|
|---|
| 36 | newDesc
|
|---|
| 37 | );
|
|---|
| 38 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.