Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/es-abstract/2020/DefinePropertyOrThrow.js
r0c6b92a r79a0317 8 8 var FromPropertyDescriptor = require('./FromPropertyDescriptor'); 9 9 var IsDataDescriptor = require('./IsDataDescriptor'); 10 var IsPropertyKey = require('./IsPropertyKey');10 var isPropertyKey = require('../helpers/isPropertyKey'); 11 11 var SameValue = require('./SameValue'); 12 12 var ToPropertyDescriptor = require('./ToPropertyDescriptor'); 13 var Type = require('./Type'); 13 14 var isObject = require('../helpers/isObject'); 14 15 15 16 // https://262.ecma-international.org/6.0/#sec-definepropertyorthrow 16 17 17 18 module.exports = function DefinePropertyOrThrow(O, P, desc) { 18 if ( Type(O) !== 'Object') {19 if (!isObject(O)) { 19 20 throw new $TypeError('Assertion failed: Type(O) is not Object'); 20 21 } 21 22 22 if (! IsPropertyKey(P)) {23 throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');23 if (!isPropertyKey(P)) { 24 throw new $TypeError('Assertion failed: P is not a Property Key'); 24 25 } 25 26
Note:
See TracChangeset
for help on using the changeset viewer.