<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>45480</bug_id>
          
          <creation_ts>2010-09-09 11:28:32 -0700</creation_ts>
          <short_desc>missing (new Function).caller for __defineGetter__, __defineSetter__, and Object.defineProperty({get: ... set: ...})</short_desc>
          <delta_ts>2012-03-07 17:20:28 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>80011</dup_id>
          
          <bug_file_loc>http://www.3site.eu/bugs/getter_setter_caller.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Andrea Giammarchi">andrea.giammarchi</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>barraclough</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>276623</commentid>
    <comment_count>0</comment_count>
    <who name="Andrea Giammarchi">andrea.giammarchi</who>
    <bug_when>2010-09-09 11:28:32 -0700</bug_when>
    <thetext>There is no caller for *non* &quot;use strict&quot; 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__(&quot;test&quot;, function test() {
    alert(test.caller);
    return &quot;test&quot;;
});

o.exec();


Best Regards,
    Andrea Giammarchi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>276699</commentid>
    <comment_count>1</comment_count>
    <who name="Andrea Giammarchi">andrea.giammarchi</who>
    <bug_when>2010-09-09 13:15:25 -0700</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>573393</commentid>
    <comment_count>2</comment_count>
    <who name="Gavin Barraclough">barraclough</who>
    <bug_when>2012-03-07 17:20:28 -0800</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 80011 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>