anonymous functions split over two lines
Reported by
somewher...@gmail.com,
Apr 20 2018
|
||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36
Example URL:
Steps to reproduce the problem:
1. Create new Function in JavaScript using new Function()
2.
3.
What is the expected behavior?
This will create an anonymous function similar to
Function anonymous() {
}
What went wrong?
Since upgrading to version 66 of Chrome this now splits the function across two lines. Previous versions work correctly and all other browsers work correctly.
Function anonymous(
) {
instead of
Function anonymous() {
Does it occur on multiple sites: Yes
Is it a problem with a plugin? No
Did this work before? N/A
Does this work in other browsers? Yes
Chrome version: 66.0.3359.117 Channel: stable
OS Version: 10.0
Flash Version:
We have .replace() code specifically looking for .replace('function anonymous() {', '') which no longer works since upgrading to version 66 of Chrome
,
Apr 21 2018
But this breaks all existing platforms with customers and has prevented use of our software! We are now having to advise customers to use IE instead as it doesn't have the same issue. We are aware of how to counteract the change. But this change doesnt seem logical?
,
Apr 21 2018
Quoting the new specification: http://tc39.github.io/Function-prototype-toString-revision/#proposal-sec-createdynamicfunction 39. Let sourceText be the String value whose elements are, in order, the code units of prefix, the code units of " anonymous(", the code units of P, 0x000A (LINE FEED), the code units of ") {", 0x000A (LINE FEED), the code units of bodyText, 0x000A (LINE FEED), and the code units of "}". As you can see Chrome matches the specification. It's still Stage 3 draft, though. FWIW, to disable the feature you can add --js-flags=--noharmony-function-tostring to the chrome's shortcut command line.
,
Apr 24 2018
Thanks for filing the issue! @Reporter: Could you please share a sample test file which helps us to triage the issue in a better way. Any further inputs from your end may be helpful. And as per comment #1 cc'ing @adamk for more inputs on this issue.
,
Apr 25 2018
,
May 29 2018
,
Jun 6 2018
Oh, looks like this fell through the cracks. As #3 points out, this is per the new spec. Are you still facing breakage or has this been fixed on your end? Firefox is now shipping this behavior as well, so we'd like to know sooner than later if this is still breaking.
,
Jul 9
What's the current thought on this issue? Should we bring it up again at the next TC39 meeting for discussion?
,
Aug 16
Closing as WontFix as this is the specced behavior. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by woxxom@gmail.com
, Apr 20 2018