Closed Bug 1356039 Opened 7 years ago Closed 7 years ago

SyntaxError: return not in function (but return statement is valid)

Categories

(Firefox :: Untriaged, defect)

52 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jmichae3, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:52.0) Gecko/20100101 Firefox/52.0
Build ID: 20170323105023

Steps to reproduce:

return new Array('0'.charAt(0),0,0,0+1,0);//failure



Actual results:

SyntaxError: return not in function


Expected results:

no syntax error, just execute it.
return can be used only in a function.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
it seems to do this with large code. this is part of a parser.
my how fun it is for you to close bugs before trying anything at all.
You need a function for return to work:

( () => {return new Array('0'.charAt(0),0,0,0+1,0);} )();
You need to log in before you can comment on or make changes to this bug.