source: frontend/node_modules/es-abstract/2018/Get.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 568 bytes
Line 
1'use strict';
2
3var $TypeError = require('es-errors/type');
4
5var inspect = require('object-inspect');
6
7var isPropertyKey = require('../helpers/isPropertyKey');
8
9var isObject = require('es-object-atoms/isObject');
10
11// https://262.ecma-international.org/6.0/#sec-get-o-p
12
13module.exports = function Get(O, P) {
14 // 7.3.1.1
15 if (!isObject(O)) {
16 throw new $TypeError('Assertion failed: Type(O) is not Object');
17 }
18 // 7.3.1.2
19 if (!isPropertyKey(P)) {
20 throw new $TypeError('Assertion failed: P is not a Property Key, got ' + inspect(P));
21 }
22 // 7.3.1.3
23 return O[P];
24};
Note: See TracBrowser for help on using the repository browser.