RESOLVED DUPLICATE of bug 80011 45480
missing (new Function).caller for __defineGetter__, __defineSetter__, and Object.defineProperty({get: ... set: ...})
https://bugs.webkit.org/show_bug.cgi?id=45480
Summary missing (new Function).caller for __defineGetter__, __defineSetter__, and Obj...
Andrea Giammarchi
Reported 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
Attachments
Andrea Giammarchi
Comment 1 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
Gavin Barraclough
Comment 2 2012-03-07 17:20:28 PST
*** This bug has been marked as a duplicate of bug 80011 ***
Note You need to log in before you can comment on or make changes to this bug.