"Warning: trailing comma is not legal in ECMA-262 object initializers" Line and Source Code should be the line with the comma

VERIFIED INVALID

Status

()

Core
JavaScript Engine
--
minor
VERIFIED INVALID
13 years ago
9 years ago

People

(Reporter: sgautherie, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
[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 !
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

12 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
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 :)
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Depends on: 508637
Resolution: --- → INVALID
(Reporter)

Comment 3

9 years ago
V.Invalid
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.