[Webkit-unassigned] [Bug 102276] New: Object.getOwnPropertyDescriptor() on a non-strict function exposes strict "caller" property

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 14 13:09:12 PST 2012


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

           Summary: Object.getOwnPropertyDescriptor() on a non-strict
                    function exposes strict "caller" property
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: adamk at chromium.org
                CC: arv at chromium.org


The following code appropriately throws a TypeError as required by ECMAScript:

function nonStrict() { return nonStrict.caller; }
function strict() { "use strict"; return nonStrict() === strict; }
strict()

But the following code does not throw, and returns true:

function nonStrict() { return Object.getOwnPropertyDescriptor(nonStrict, 'caller').value; }
function strict() { "use strict"; return nonStrict() === strict; }
strict()

Though this is underspecified in the spec (it says that only [[Get]] should throw when asked for caller), it seems likely that [[GetOwnProperty]] should do the same, and that's what both Chrome and Firefox do.

-- 
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