Version 1
[yaffs-website] / node_modules / core-js / library / modules / _classof.js
1 // getting tag from 19.1.3.6 Object.prototype.toString()
2 var cof = require('./_cof')
3   , TAG = require('./_wks')('toStringTag')
4   // ES3 wrong here
5   , ARG = cof(function(){ return arguments; }()) == 'Arguments';
6
7 // fallback for IE11 Script Access Denied error
8 var tryGet = function(it, key){
9   try {
10     return it[key];
11   } catch(e){ /* empty */ }
12 };
13
14 module.exports = function(it){
15   var O, T, B;
16   return it === undefined ? 'Undefined' : it === null ? 'Null'
17     // @@toStringTag case
18     : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
19     // builtinTag case
20     : ARG ? cof(O)
21     // ES3 arguments fallback
22     : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
23 };