|
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:
723 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 isPropertyKey = require('../helpers/isPropertyKey');
|
|---|
| 7 | var OrdinaryDefineOwnProperty = require('./OrdinaryDefineOwnProperty');
|
|---|
| 8 |
|
|---|
| 9 | // https://262.ecma-international.org/6.0/#sec-createdataproperty
|
|---|
| 10 |
|
|---|
| 11 | module.exports = function CreateDataProperty(O, P, V) {
|
|---|
| 12 | if (!isObject(O)) {
|
|---|
| 13 | throw new $TypeError('Assertion failed: Type(O) is not Object');
|
|---|
| 14 | }
|
|---|
| 15 | if (!isPropertyKey(P)) {
|
|---|
| 16 | throw new $TypeError('Assertion failed: P is not a Property Key');
|
|---|
| 17 | }
|
|---|
| 18 | var newDesc = {
|
|---|
| 19 | '[[Configurable]]': true,
|
|---|
| 20 | '[[Enumerable]]': true,
|
|---|
| 21 | '[[Value]]': V,
|
|---|
| 22 | '[[Writable]]': true
|
|---|
| 23 | };
|
|---|
| 24 | return OrdinaryDefineOwnProperty(O, P, newDesc);
|
|---|
| 25 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.