Closed
Bug 286937
Opened 20 years ago
Closed 16 years ago
"Warning: trailing comma is not legal in ECMA-262 object initializers" Line and Source Code should be the line with the comma
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
VERIFIED
INVALID
People
(Reporter: sgautherie, Unassigned)
References
Details
[Mozilla Thunderbird, version 1.0+ (20050319)] (nightly) (W98SE)
Spun off from bug 286881:
{{
Description: [reply]
Warning: trailing comma is not legal in ECMA-262 object initializers
Source File: file:///W:/PROGRAM%20FILES/MOZILLA%20THUNDERBIRD/components/newsblog.js
Line: 281
Source Code:
};
------- Additional Comment #2 From Serge GAUTHERIE 2005-03-19 13:01 PST
[reply] -------
Brendan,
it seems that the line (number) for this warning should be 1 less:
is it something fixable ?
------- Additional Comment #3 From Brendan Eich 2005-03-19 19:57 PST [reply] -------
Serge, this isn't easy to fix. The SpiderMonkey lexical scanner was designed to
point to an offending token in the currently-buffered line. I'd rather fix this
by bootstrapping the next-gen JS front end (Narcissus). If you want to file a
bug on this assigned to general@js.bugs, feel free and cc: me.
}}
I wonder if the message could be changed to add "in the preceding line" in the
meantime ?
Then feel free to morph this bug to "replace SpiderMonkey by Narcissus" or
whatever !
Comment 1•20 years ago
|
||
There could be many preceding lines that are empty or full of comments. There
is no guarantee that the previous line contains the comma.
/be
Updated•19 years ago
|
Summary: "Warning: trailing comma is not legal in ECMA-262 object initializers" Line and Source Code should be the preceding line → "Warning: trailing comma is not legal in ECMA-262 object initializers" Line and Source Code should be the line with the comma
Comment 2•16 years ago
|
||
But if there's no warning for trailing commas, then it doesn't matter which line the warning that doesn't exist doesn't refer to :)
You need to log in
before you can comment on or make changes to this bug.
Description
•