SyntaxError: expected expression, got keyword 'else'

RESOLVED INCOMPLETE

Status

()

RESOLVED INCOMPLETE
a year ago
a year ago

People

(Reporter: jmichae3, Unassigned)

Tracking

54 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

a year ago
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.
(Reporter)

Comment 1

a year ago
please search or partial-search the js engine parser source for this string to find where bug is hiding.
(Reporter)

Comment 2

a year ago
or engine strings db.
please provide a testcase.
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Bug_writing_guidelines
Flags: needinfo?(jmichae3)
(Reporter)

Comment 4

a year ago
I can't share the code with you because it's commercial.
Flags: needinfo?(jmichae3)
(Reporter)

Comment 5

a year ago
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.

Comment 8

a year ago
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
Last Resolved: a year ago
Flags: needinfo?(jmichae3)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.