Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

23 righe
555 B

  1. 'use strict';
  2. var GetIntrinsic = require('../GetIntrinsic');
  3. var $TypeError = GetIntrinsic('%TypeError%');
  4. var has = require('has');
  5. var IsPropertyKey = require('./IsPropertyKey');
  6. var Type = require('./Type');
  7. // https://ecma-international.org/ecma-262/6.0/#sec-hasownproperty
  8. module.exports = function HasOwnProperty(O, P) {
  9. if (Type(O) !== 'Object') {
  10. throw new $TypeError('Assertion failed: `O` must be an Object');
  11. }
  12. if (!IsPropertyKey(P)) {
  13. throw new $TypeError('Assertion failed: `P` must be a Property Key');
  14. }
  15. return has(O, P);
  16. };