Bug 21532 - Remove duplicate const declaration in fast/js/const.html
Summary: Remove duplicate const declaration in fast/js/const.html
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Adam Barth
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-10 15:08 PDT by Pam Greene (IRC:pamg)
Modified: 2008-10-12 18:57 PDT (History)
1 user (show)

See Also:


Attachments
Fixes inadvertent const redeclaration and adds test for it (1.56 KB, patch)
2008-10-10 15:37 PDT, Pam Greene (IRC:pamg)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pam Greene (IRC:pamg) 2008-10-10 15:08:34 PDT
The test fast/js/const.js contains the lines

const x = "RIGHT";
...
const x = "RIGHT", y = "RIGHT";

Redeclaring 'const x', which produces an error.  (http://www.mozilla.org/js/language/js20-2002-04/core/variables.html discusses disallowing redefining consts; other places may too.)

The test should be fixed to use a different variable name there, since that portion is not trying to test redefining constants.  A separate test can be added for the latter.
Comment 1 Pam Greene (IRC:pamg) 2008-10-10 15:37:03 PDT
Created attachment 24276 [details]
Fixes inadvertent const redeclaration and adds test for it

Note that the const-redeclaration part of this doesn't currently do the right thing.  That's bug 14611.
Comment 2 Darin Adler 2008-10-10 16:19:08 PDT
Comment on attachment 24276 [details]
Fixes inadvertent const redeclaration and adds test for it

r=me
Comment 3 Adam Barth 2008-10-12 13:44:40 PDT
I'll land this.
Comment 4 Adam Barth 2008-10-12 18:57:07 PDT
Fixed in r37543.