Bug 19194 - KJS behaves differently when handling redeclaration of a const variable
Summary: KJS behaves differently when handling redeclaration of a const variable
Status: RESOLVED DUPLICATE of bug 14611
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-22 10:34 PDT by Feng Qian
Modified: 2008-05-22 11:10 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Feng Qian 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.
Comment 1 Cameron Zwarich (cpst) 2008-05-22 11:10:37 PDT
This is a duplicate of bug 14611.

*** This bug has been marked as a duplicate of 14611 ***