← Back to release summary

Function.prototype.toString revision

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 66)
Intent stage
None

Summary

The "implementation-dependent String" returned from Function.prototype.toString() is now a fully-specified String, which is a substring of the source code that defines the function. For example, this preserves whitespace and comments between the "function" keyword and the function name identifier. For functions created with CreateDynamicFunction (such as through `new Function()`), the String is fully-specified and includes the parameters passed to CreateDynamicFunction.

Standards & signals

Docs: https://github.com/tc39/Function-prototype-toString-revision https://tc39.github.io/Function-prototype-toString-revision/

View on chromestatus.com