Ensure func is a function before querying the weakmap. [closes #1319]

This commit is contained in:
jdalton
2015-07-06 08:23:11 -07:00
committed by John-David Dalton
parent a5e2caf40b
commit 2e50d11be5
2 changed files with 15 additions and 1 deletions

View File

@@ -3998,7 +3998,7 @@
* @returns {*} Returns the metadata for `func`.
*/
var getData = !metaMap ? noop : function(func) {
return metaMap.get(func);
return typeof func == 'function' ? metaMap.get(func) : undefined;
};
/**