If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

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

RESOLVED INVALID

Status

()

Firefox
Untriaged
RESOLVED INVALID
6 months ago
6 months ago

People

(Reporter: Jim Michaels, Unassigned)

Tracking

52 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 months ago
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
Last Resolved: 6 months ago
Resolution: --- → INVALID
(Reporter)

Comment 2

6 months ago
it seems to do this with large code. this is part of a parser.
(Reporter)

Comment 3

6 months ago
my how fun it is for you to close bugs before trying anything at all.

Comment 4

6 months ago
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.