mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Bump to v4.8.0.
This commit is contained in:
21
_getTag.js
21
_getTag.js
@@ -2,7 +2,8 @@ var DataView = require('./_DataView'),
|
||||
Map = require('./_Map'),
|
||||
Promise = require('./_Promise'),
|
||||
Set = require('./_Set'),
|
||||
WeakMap = require('./_WeakMap');
|
||||
WeakMap = require('./_WeakMap'),
|
||||
toSource = require('./_toSource');
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var mapTag = '[object Map]',
|
||||
@@ -16,21 +17,19 @@ var dataViewTag = '[object DataView]';
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to resolve the decompiled source of functions. */
|
||||
var funcToString = Function.prototype.toString;
|
||||
|
||||
/**
|
||||
* Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||
* Used to resolve the
|
||||
* [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var objectToString = objectProto.toString;
|
||||
|
||||
/** Used to detect maps, sets, and weakmaps. */
|
||||
var dataViewCtorString = DataView ? (DataView + '') : '',
|
||||
mapCtorString = Map ? funcToString.call(Map) : '',
|
||||
promiseCtorString = Promise ? funcToString.call(Promise) : '',
|
||||
setCtorString = Set ? funcToString.call(Set) : '',
|
||||
weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : '';
|
||||
var dataViewCtorString = toSource(DataView),
|
||||
mapCtorString = toSource(Map),
|
||||
promiseCtorString = toSource(Promise),
|
||||
setCtorString = toSource(Set),
|
||||
weakMapCtorString = toSource(WeakMap);
|
||||
|
||||
/**
|
||||
* Gets the `toStringTag` of `value`.
|
||||
@@ -53,7 +52,7 @@ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
||||
getTag = function(value) {
|
||||
var result = objectToString.call(value),
|
||||
Ctor = result == objectTag ? value.constructor : null,
|
||||
ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : '';
|
||||
ctorString = toSource(Ctor);
|
||||
|
||||
if (ctorString) {
|
||||
switch (ctorString) {
|
||||
|
||||
Reference in New Issue
Block a user