Open littledan opened 6 years ago
Can the reporter be evangelized to change their site, or do we think this is a more widespread problem?
It's very likely no programmer will expect extra newline before )
, especially old browsers never add it. So it's very likely many old codes of reflection of functions will potentially fail! You don't get many reports just because there is rare use of new Function()
and even rare cases of combination of new Function
and reflections. So the risk of it will likely to be underestimated.
And, IMO, the reason of append newline is flawed, see my comment: https://github.com/tc39/Function-prototype-toString-revision/pull/13#issuecomment-403441040
@littledan Perhaps, if we discover that this is a common enough pattern, we should special-case empty parameter lists to omit the newline? Or even go a step further and test for trailing line comments (though this may be hard to do spec-wise).
Or even go a step further and test for trailing line comments (though this may be hard to do spec-wise).
What's the hard part about this? Could we remove trailing line comments from each parameter, in the Function.prototype.toString representation, for example?
I'm not sure why @hax 's comment was marked as off-topic; it seems relevant to me.
A bug was filed against Chrome for the Function.prototype.toString change. The reporter claims it breaks their site, and is recommending users to switch to IE. The reporter said,
What do we make of this "compatibility issue"? Should we reconsider https://github.com/tc39/Function-prototype-toString-revision/pull/13 ? cc @gsathya