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');
5 var TO_STRING_TAG = wellKnownSymbol('toStringTag');
7 var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
9 // fallback for IE11 Script Access Denied error
10 var tryGet = function (it, key) {
13 } catch (error) { /* empty */ }
16 // getting tag from ES6+ `Object.prototype.toString`
17 module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
19 return it === undefined ? 'Undefined' : it === null ? 'Null'
21 : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag
23 : CORRECT_ARGUMENTS ? classofRaw(O)
24 // ES3 arguments fallback
25 : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;