2 ms·
Rather than how complete it is, the real improvements of the proposal are: 1. it all but requires that ES-defined functions stringify to their source code. Pre
by masklinn 7y ago
Rather than how complete it is, the real improvements of the proposal are:
1. it all but requires that ES-defined functions stringify to their source code. Pre-ES2019 that's implementation-defined
2. it standardises the placeholder for the case where toString can't or won't create ECMAScript code (e.g. host functions), this could otherwise be an issue as with implementation-defined placeholders subsequent updates to the standard might make the placeholder unexpectedly syntactically valid, by having the placeholder standard future proposals can easily avoid making it valid
3. the stringification should be cross-platform as the algorithm is standardised
- soulofmischief 7y agoOk that makes sense... I was really confused because that's already more or less toString()'s behavior on modern browsers, though the whitespace discrepancy is important to define.
- masklinn 7y agoThat's in part because it was fed back through browsers during the specification process.