[Webkit-unassigned] [Bug 50431] New: |delete name| in strict mode code should be an early error

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 2 18:56:15 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=50431

           Summary: |delete name| in strict mode code should be an early
                    error
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
               URL: javascript: try { eval("function x() { 'use strict';
                    delete y; }"); throw 'no error'; } catch (e) { alert(e
                    instanceof SyntaxError ? "PASS" : "FAIL " + e); }
        OS/Version: All
            Status: NEW
          Keywords: ES5
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jwalden+bwo at mit.edu
                CC: oliver at apple.com


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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list