Bug 19194

Summary: KJS behaves differently when handling redeclaration of a const variable
Product: WebKit Reporter: Feng Qian <ian.eng.webkit>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: mjs
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   

Feng Qian
Reported 2008-05-22 10:34:22 PDT
In following example: (function() { const c = 0; var c = 1; print(c); })(); FF 3RC1 throws an exception at 'var c = 1;': redeclaration of const c. KJS (and squirrelfish) silently ignores the redeclaration and prints out 0. I think FF's behavior is more desirable. 'var c = 1;' is likely a bug if a JS program, but KJS let the exception continue so it is very hard for the program to figure out what's wrong.
Attachments
Cameron Zwarich (cpst)
Comment 1 2008-05-22 11:10:37 PDT
This is a duplicate of bug 14611. *** This bug has been marked as a duplicate of 14611 ***
Note You need to log in before you can comment on or make changes to this bug.