Bug 19523
Summary: | delete does not work in javascript | ||
---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | ||
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.5 |
Eric Seidel (no email)
delete does not work in javascript
<script>
var a = 1;
delete a;
alert(a);
</script>
This throws a reference error in FF, not in Safari.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Oliver Hunt
var declarations aren't deletable, per spec. Firefox agrees with this. I would close as invalid, but there is one case we do fuck up:
<script>
a = 1;
</script>
<script>
var a;
delete a;
alert(a);
</script>
the existing a should prevent the creation of a new static slot for a, so the delete should succeed in this case.
Oliver Hunt
Happily we've already fixed this bug. Closing as invalid because the original bug was not valid, and my updated bug was actaully already fixed.
Cameron Zwarich (cpst)
I added a test for the second scenario that Oliver mentioned in r34952, because we did not have any existing coverage of this case.