Bug 19194
| Summary: | KJS behaves differently when handling redeclaration of a const variable | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Feng Qian <ian.eng.webkit> |
| Component: | JavaScriptCore | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Cameron Zwarich (cpst)
This is a duplicate of bug 14611.
*** This bug has been marked as a duplicate of 14611 ***