You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, I want to explain why such an error would be thrown. Basic JavaScript data types all have a method named toString(). It's important to note that each method pertains to one class (Function, String, Number or Object) and only handles their kind.
> Function.prototype.toString.call({})
Uncaught TypeError: Function.prototype.toString is not generic(…)
How could this happen when not forcing it with call, like in the code above? (thing.toString()) Well, through somewhat strange inheritance or method assignment:
> var a = {};
> a.toString = Function.prototype.toString;
> a.toString()
Uncaught TypeError: Function.prototype.toString is not generic(…)
You may want to check why you have objects with a broken toString() method.
In any case, we'd rather not have the debugger break on any object no matter how broken its toString() method is, so running it inside a try/catch is indeed a good idea.
Instead of calling toString() twice, with only the first call guarded, I suggest replacing it by a safe function that cannot fail:
Hi,

Whenever I inspect
computedVariables
error showsUncaught TypeError: Function.prototype.toString is not generic
. Any Idea @ntrrgc.From the meantime, I inserted this code as checking.
The text was updated successfully, but these errors were encountered: