Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/es-abstract/2023/DefineMethodProperty.js
r0c6b92a r79a0317 5 5 var DefinePropertyOrThrow = require('./DefinePropertyOrThrow'); 6 6 var IsExtensible = require('./IsExtensible'); 7 var IsPropertyKey = require('./IsPropertyKey'); 8 var Type = require('./Type'); 7 8 var isObject = require('../helpers/isObject'); 9 var isPropertyKey = require('../helpers/isPropertyKey'); 9 10 10 11 // https://262.ecma-international.org/13.0/#sec-definemethodproperty 11 12 12 13 module.exports = function DefineMethodProperty(homeObject, key, closure, enumerable) { 13 if ( Type(homeObject) !== 'Object') {14 if (!isObject(homeObject)) { 14 15 throw new $TypeError('Assertion failed: `homeObject` is not an Object'); 15 16 } 16 if (! IsPropertyKey(key)) {17 if (!isPropertyKey(key)) { 17 18 throw new $TypeError('Assertion failed: `key` is not a Property Key or a Private Name'); 18 19 }
Note:
See TracChangeset
for help on using the changeset viewer.