mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 03:47:50 +00:00
Use metaMap inference instead of WeakMap.
This commit is contained in:
@@ -2212,7 +2212,7 @@
|
|||||||
* @param {*} data The metadata.
|
* @param {*} data The metadata.
|
||||||
* @returns {Function} Returns `func`.
|
* @returns {Function} Returns `func`.
|
||||||
*/
|
*/
|
||||||
var baseSetData = !WeakMap ? identity : function(func, data) {
|
var baseSetData = !metaMap ? identity : function(func, data) {
|
||||||
metaMap.set(func, data);
|
metaMap.set(func, data);
|
||||||
return func;
|
return func;
|
||||||
};
|
};
|
||||||
@@ -2808,7 +2808,7 @@
|
|||||||
* @param {Function} func The function to query.
|
* @param {Function} func The function to query.
|
||||||
* @returns {*} Returns the metadata for `func`.
|
* @returns {*} Returns the metadata for `func`.
|
||||||
*/
|
*/
|
||||||
var getData = !WeakMap ? noop : function(func) {
|
var getData = !metaMap ? noop : function(func) {
|
||||||
return metaMap.get(func);
|
return metaMap.get(func);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user