User-Agent: Opera/9.20 (Windows NT 5.1; U; nb) Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:18.104.22.168) Gecko/20070725 Firefox/22.214.171.124 According to the ECMAScript spec, return /* */ someVariable; should be executed as return someVariable; i.e. return undefined, since automatic semicolon insertion will occur after return statement. Reproducible: Always Steps to Reproduce: 1. 2. 3.
7.4 Comments Comments behave like white space and are discarded except that, if a MultiLineComment contains a line terminator character, then the entire comment is considered to be a LineTerminator for purposes of parsing by the syntactic grammar. 7.9.1 Rules of Automatic Semicolon Insertion ReturnStatement : return [no LineTerminator here] Expressionopt ;
Status: UNCONFIRMED → NEW
Ever confirmed: true
Brendan, would you like me to fuzz to find more bugs of this type? If you think it's worth it, I can look for more bugs where "/*\n*/" and "\n" don't result in the same decompilation or disassembly (assuming bug 396512 gets fixed) or syntax error message.
Opera has the only browser hosted ECMAScript engines that comply to this part of the ES3 spec. Wouldn't it be better for interoperability to change the spec behaviour instead of all those "broken" engines? I doubt there are any developers out there who expects that /**/ and /*\n*/ will give different results.
This is a dup of bug 475834, which in turn has been fixed in 1.9.1, so this bug report can be closed as well.
Dup'ing forward. /be
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 475834
You need to log in before you can comment on or make changes to this bug.