'use strict';

var _toObject = require('./_to-object-329a650b.js');
var es6_string_iterator = require('./es6.string.iterator-cc0bbaa4.js');

// getting tag from 19.1.3.6 Object.prototype.toString()

var TAG = es6_string_iterator._wks('toStringTag');
// ES3 wrong here
var ARG = _toObject._cof(function () { return arguments; }()) == 'Arguments';

// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
  try {
    return it[key];
  } catch (e) { /* empty */ }
};

var _classof = function (it) {
  var O, T, B;
  return it === undefined ? 'Undefined' : it === null ? 'Null'
    // @@toStringTag case
    : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
    // builtinTag case
    : ARG ? _toObject._cof(O)
    // ES3 arguments fallback
    : (B = _toObject._cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};

var ITERATOR = es6_string_iterator._wks('iterator');

var core_getIteratorMethod = _toObject._core.getIteratorMethod = function (it) {
  if (it != undefined) return it[ITERATOR]
    || it['@@iterator']
    || es6_string_iterator._iterators[_classof(it)];
};

exports._classof = _classof;
exports.core_getIteratorMethod = core_getIteratorMethod;
