wallet-core/node_modules/core-js/modules/$.classof.js

16 lines
565 B
JavaScript
Raw Normal View History

2017-05-03 15:35:00 +02:00
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = require('./$.cof')
, TAG = require('./$.wks')('toStringTag')
// ES3 wrong here
, ARG = cof(function(){ return arguments; }()) == 'Arguments';
module.exports = function(it){
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = (O = Object(it))[TAG]) == 'string' ? T
// builtinTag case
: ARG ? cof(O)
// ES3 arguments fallback
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};