Closed Bug 1381194 Opened 8 years ago Closed 8 years ago

SyntaxError: expected expression, got keyword 'else'

Categories

(Core :: JavaScript Engine, defect)

54 Branch
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: jmichae3, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0 Build ID: 20170628075643 Steps to reproduce: large js code with large curly-bracketed if { ... } else { ... } Actual results: console error: SyntaxError: expected expression, got keyword 'else' given the context of an if statement, this is a mixed up, wrong error message for the type of statement that it is. occurred on keyword else. Expected results: should have shown me where the actual error was.
please search or partial-search the js engine parser source for this string to find where bug is hiding.
or engine strings db.
Flags: needinfo?(jmichae3)
I can't share the code with you because it's commercial.
Flags: needinfo?(jmichae3)
did you do as I requested?
you don't have to provide whole code. reduced testcase that demonstrates the issue is sufficient. please try creating minimal standalone testcase. if you cannot provide any kind of testcase, there's no way to figure out what you're seeing.
Flags: needinfo?(jmichae3)
in most case, that error is thrown when there's unbalanced braces and "else" is placed after a block that is not after "if". please also check if the code works on other browser.
It had an insufficient test cases, didnot contain the entiere code and made the script ended with the error.
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
closing due to lack of response.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Flags: needinfo?(jmichae3)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.