Bug 79843

Summary: Should not box `this` in strict-mode getters
Product: WebKit Reporter: Domenic Denicola <domenic>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: barraclough, erights, oliver
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Domenic Denicola 2012-02-28 16:04:38 PST
The following code should log "number" according to the ES5 spec, section 10.4.3 [1]:


Object.defineProperty(Object.prototype, "getMe", {
    get: function () {
        "use strict";
        console.log(typeof this);
    }
});

(0).getMe;


Instead it logs "object".

See also es-discuss discussion [2] and test-262 bug [3].


[1]: http://es5.github.com/#x10.4.3
[2]: https://mail.mozilla.org/pipermail/es-discuss/2012-February/020781.html
[3]: https://bugs.ecmascript.org/show_bug.cgi?id=284
Comment 1 Gavin Barraclough 2012-02-29 15:29:30 PST
Please retest in a nightly, this is already fixed. :-)

*** This bug has been marked as a duplicate of bug 79588 ***