main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
464 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var $TypeError = require('es-errors/type');
|
---|
4 |
|
---|
5 | var IsPropertyKey = require('./IsPropertyKey');
|
---|
6 | var Type = require('./Type');
|
---|
7 |
|
---|
8 | // https://262.ecma-international.org/6.0/#sec-hasproperty
|
---|
9 |
|
---|
10 | module.exports = function HasProperty(O, P) {
|
---|
11 | if (Type(O) !== 'Object') {
|
---|
12 | throw new $TypeError('Assertion failed: `O` must be an Object');
|
---|
13 | }
|
---|
14 | if (!IsPropertyKey(P)) {
|
---|
15 | throw new $TypeError('Assertion failed: `P` must be a Property Key');
|
---|
16 | }
|
---|
17 | return P in O;
|
---|
18 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.