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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>20777</bug_id>
          
          <creation_ts>2013-01-25 17:00:55 +0000</creation_ts>
          <short_desc>Getting a property from the global scope polluter ends up in an infinite loop</short_desc>
          <delta_ts>2013-08-04 07:28:57 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>[v1]</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ms2ger">Ms2ger</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>82150</commentid>
    <comment_count>0</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2013-01-25 17:00:55 +0000</bug_when>
    <thetext>Calling [[GetOwnProperty]] on the GSP ends us in [1]. In step 3, we call the &quot;named property visibility algorithm&quot; [2] with object /object/ (==window). In step 7 there, we call [[HasProperty]] on window.__proto__ == Window.prototype. This walks the prototype chain [3] and ends up calling [[GetOwnProperty]] on the GSP again.

[1] http://dev.w3.org/2006/webapi/WebIDL/#named-properties-object-getownproperty
[2] http://dev.w3.org/2006/webapi/WebIDL/#dfn-named-property-visibility
[3] http://ecma-international.org/ecma-262/5.1/#sec-8.12.6</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82151</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-01-25 17:05:44 +0000</bug_when>
    <thetext>Note that we only need to pass in the Window because we need to know stuff about its interface.  We could pass the interface to the named property visibility algorithm and then pass in the gsp or its proto...

That said, I&apos;m also not sure what step 4 of this algorithm means.  Does it not involve calling [[GetOwnProperty]] on the object?  Should it talk about calling the default [[GetOwnProperty]] or something?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82152</commentid>
    <comment_count>2</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2013-01-25 17:09:36 +0000</bug_when>
    <thetext>If fact, it looks like steps 4-8 are just &quot;return !O.[[HasProperty]](P)&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91602</commentid>
    <comment_count>3</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2013-08-04 07:28:57 +0000</bug_when>
    <thetext>I fixed it by manually traversing up the prototype chain and skipping the named properties object.

http://dev.w3.org/cvsweb/2006/webapi/WebIDL/Overview.xml.diff?r1=1.679;r2=1.680;f=h
http://dev.w3.org/cvsweb/2006/webapi/WebIDL/v1.xml.diff?r1=1.121;r2=1.122;f=h</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>