.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / internals / classof.js
1 var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');
2 var classofRaw = require('../internals/classof-raw');
3 var wellKnownSymbol = require('../internals/well-known-symbol');
4
5 var TO_STRING_TAG = wellKnownSymbol('toStringTag');
6 // ES3 wrong here
7 var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
8
9 // fallback for IE11 Script Access Denied error
10 var tryGet = function (it, key) {
11   try {
12     return it[key];
13   } catch (error) { /* empty */ }
14 };
15
16 // getting tag from ES6+ `Object.prototype.toString`
17 module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
18   var O, tag, result;
19   return it === undefined ? 'Undefined' : it === null ? 'Null'
20     // @@toStringTag case
21     : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
22     // builtinTag case
23     : CORRECT_ARGUMENTS ? classofRaw(O)
24     // ES3 arguments fallback
25     : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;
26 };