Bug 45480 - missing (new Function).caller for __defineGetter__, __defineSetter__, and Object.defineProperty({get: ... set: ...})
Summary: missing (new Function).caller for __defineGetter__, __defineSetter__, and Obj...
Status: RESOLVED DUPLICATE of bug 80011
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://www.3site.eu/bugs/getter_sette...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-09 11:28 PDT by Andrea Giammarchi
Modified: 2012-03-07 17:20 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrea Giammarchi 2010-09-09 11:28:32 PDT
There is no caller for *non* "use strict" cases when a getter/setter is invoked inside another function.
All other browsers work as expected and since the behavior of caller is undefined but you implemented in any case, I do believe WebKit/Safari should be more consistent bringing the caller in example cases as well.

See the URL for more tests or try this code:

var o = {
    exec: function exec() {
        var wtf = this.test;
    }
};

o.__defineGetter__("test", function test() {
    alert(test.caller);
    return "test";
});

o.exec();


Best Regards,
    Andrea Giammarchi
Comment 1 Andrea Giammarchi 2010-09-09 13:15:25 PDT
this is the reason I am asking for caller, hoping this will never disappear from ECMAScript specs.

http://webreflection.blogspot.com/2010/09/javascript-protected-properties.html

Regards
Comment 2 Gavin Barraclough 2012-03-07 17:20:28 PST

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