ags
This commit is contained in:
parent
eddf7cecb8
commit
aea798d119
16631 changed files with 1480363 additions and 257 deletions
23
home/ags/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js
generated
vendored
Normal file
23
home/ags/node_modules/es-abstract/2016/CreateDataPropertyOrThrow.js
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
'use strict';
|
||||
|
||||
var $TypeError = require('es-errors/type');
|
||||
|
||||
var CreateDataProperty = require('./CreateDataProperty');
|
||||
var IsPropertyKey = require('./IsPropertyKey');
|
||||
var Type = require('./Type');
|
||||
|
||||
// // https://262.ecma-international.org/6.0/#sec-createdatapropertyorthrow
|
||||
|
||||
module.exports = function CreateDataPropertyOrThrow(O, P, V) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
if (!IsPropertyKey(P)) {
|
||||
throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
|
||||
}
|
||||
var success = CreateDataProperty(O, P, V);
|
||||
if (!success) {
|
||||
throw new $TypeError('unable to create data property');
|
||||
}
|
||||
return success;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue