Sha256: 6b9d808e1c41b08d47d9c2e6e59b62dbc322d4f6810b02e33f3f3244bb6d2a21
Contents?: true
Size: 729 Bytes
Versions: 216
Compression:
Stored size: 729 Bytes
Contents
'use strict'; var GetIntrinsic = require('get-intrinsic'); var $TypeError = GetIntrinsic('%TypeError%'); 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; };
Version data entries
216 entries across 27 versions & 2 rubygems