Bug 50431 - |delete name| in strict mode code should be an early error
Summary: |delete name| in strict mode code should be an early error
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Oliver Hunt
URL: javascript: try { eval("function x() ...
Keywords: ES5
Depends on:
Reported: 2010-12-02 18:56 PST by Jeff Walden (remove +bwo to email)
Modified: 2010-12-20 17:02 PST (History)
1 user (show)

See Also:

Patch (4.07 KB, patch)
2010-12-20 16:23 PST, Oliver Hunt
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Walden (remove +bwo to email) 2010-12-02 18:56:15 PST
ES5 16:

"An early error is an error that can be detected and reported prior to the evaluation of any construct in the Program containing the error. An implementation must report early errors in a Program prior to the first evaluation of that Program."

A name always evaluates to either an unresolvable Reference or a Reference with an environment record as its base.  But an object environment record's HasBinding method calls [[HasProperty]] and through it [[GetProperty]].  Neither of these in the spec has any side effect, nor does either terminate abruptly (ignoring OOM and the like), so only host objects matter.  But it seems clear enough that going down the rat's nest just for host objects (or for proxies should they reach full standardization) is a bad idea, so |delete name| should just be an early error.  This is also how it's implemented in SpiderMonkey.
Comment 1 Oliver Hunt 2010-12-20 16:05:45 PST
fixing now.
Comment 2 Oliver Hunt 2010-12-20 16:23:22 PST
Created attachment 77050 [details]
Comment 3 Geoffrey Garen 2010-12-20 16:39:02 PST
Comment on attachment 77050 [details]

r=me if you delete deleteProperty and related code.
Comment 4 Oliver Hunt 2010-12-20 17:02:48 PST
Committed r74377: <http://trac.webkit.org/changeset/74377>