Bug 45480
Summary: | missing (new Function).caller for __defineGetter__, __defineSetter__, and Object.defineProperty({get: ... set: ...}) | ||
---|---|---|---|
Product: | WebKit | Reporter: | Andrea Giammarchi <andrea.giammarchi> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | barraclough |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | OS X 10.5 | ||
URL: | http://www.3site.eu/bugs/getter_setter_caller.html |
Andrea Giammarchi
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Andrea Giammarchi
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
*** This bug has been marked as a duplicate of bug 80011 ***