3 ms·
Prior to ES2015, the spec's definition of Function.prototype.toString() was pretty vague. The behavior was implementation-dependent, although I don't know the d
by TheAceOfHearts 9y ago
Prior to ES2015, the spec's definition of Function.prototype.toString() was pretty vague. The behavior was implementation-dependent, although I don't know the differences per browsers, since I've never used this feature seriously. Here's the text from ES5.1 [0]:
> An implementation-dependent representation of the function is returned. This representation has the syntax of a FunctionDeclaration. Note in particular that the use and placement of white space, line terminators, and semicolons within the representation String is implementation-dependent.
[0] http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.4.2 http://www.ecma-international.org/ecma-262/5.1/#sec-15.3.4.2