Changeset 79a0317 for imaps-frontend/node_modules/es-abstract/2020/ValidateAndApplyPropertyDescriptor.js
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/es-abstract/2020/ValidateAndApplyPropertyDescriptor.js
r0c6b92a r79a0317 11 11 var IsDataDescriptor = require('./IsDataDescriptor'); 12 12 var IsGenericDescriptor = require('./IsGenericDescriptor'); 13 var IsPropertyKey = require('./IsPropertyKey');13 var isPropertyKey = require('../helpers/isPropertyKey'); 14 14 var SameValue = require('./SameValue'); 15 var Type = require('./Type'); 15 16 var isObject = require('../helpers/isObject'); 16 17 17 18 // https://262.ecma-international.org/6.0/#sec-validateandapplypropertydescriptor … … 21 22 module.exports = function ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current) { 22 23 // this uses the ES2017+ logic, since it fixes a number of bugs in the ES2015 logic. 23 var oType = Type(O); 24 if (oType !== 'Undefined' && oType !== 'Object') { 24 if (typeof O !== 'undefined' && !isObject(O)) { 25 25 throw new $TypeError('Assertion failed: O must be undefined or an Object'); 26 26 } … … 34 34 throw new $TypeError('Assertion failed: current must be a Property Descriptor, or undefined'); 35 35 } 36 if ( oType !== 'Undefined' && !IsPropertyKey(P)) {36 if (typeof O !== 'undefined' && !isPropertyKey(P)) { 37 37 throw new $TypeError('Assertion failed: if O is not undefined, P must be a Property Key'); 38 38 } … … 42 42 } 43 43 if (IsGenericDescriptor(Desc) || IsDataDescriptor(Desc)) { 44 if ( oType !== 'Undefined') {44 if (typeof O !== 'undefined') { 45 45 DefineOwnProperty( 46 46 IsDataDescriptor, … … 61 61 throw new $TypeError('Assertion failed: Desc is not an accessor descriptor'); 62 62 } 63 if ( oType !== 'Undefined') {63 if (typeof O !== 'undefined') { 64 64 return DefineOwnProperty( 65 65 IsDataDescriptor, … … 96 96 } 97 97 if (IsDataDescriptor(current)) { 98 if ( oType !== 'Undefined') {98 if (typeof O !== 'undefined') { 99 99 DefineOwnProperty( 100 100 IsDataDescriptor, … … 110 110 ); 111 111 } 112 } else if ( oType !== 'Undefined') {112 } else if (typeof O !== 'undefined') { 113 113 DefineOwnProperty( 114 114 IsDataDescriptor, … … 147 147 throw new $TypeError('Assertion failed: current and Desc are not both data, both accessors, or one accessor and one data.'); 148 148 } 149 if ( oType !== 'Undefined') {149 if (typeof O !== 'undefined') { 150 150 return DefineOwnProperty( 151 151 IsDataDescriptor,
Note:
See TracChangeset
for help on using the changeset viewer.