Bug 19523 - delete does not work in javascript
Summary: delete does not work in javascript
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-12 14:55 PDT by Eric Seidel (no email)
Modified: 2008-07-02 03:09 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2008-06-12 14:55:50 PDT
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.
Comment 1 Oliver Hunt 2008-07-02 02:31:19 PDT
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.

Comment 2 Oliver Hunt 2008-07-02 02:37:34 PDT
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.
Comment 3 Cameron Zwarich (cpst) 2008-07-02 03:09:17 PDT
I added a test for the second scenario that Oliver mentioned in r34952, because we did not have any existing coverage of this case.