blob: e218edad7289469afe4aabebd74878ebd1b89138 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4
5var $TypeError = GetIntrinsic('%TypeError%');
6
7var keys = require('object-keys');
8
9var Type = require('./Type');
10
11// https://ecma-international.org/ecma-262/6.0/#sec-enumerableownnames
12
13module.exports = function EnumerableOwnNames(O) {
14 if (Type(O) !== 'Object') {
15 throw new $TypeError('Assertion failed: Type(O) is not Object');
16 }
17
18 return keys(O);
19};