<html>
    <head>
      <base href="https://bugs.webkit.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:gskachkov&#64;gmail.com" title="GSkachkov &lt;gskachkov&#64;gmail.com&gt;"> <span class="fn">GSkachkov</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6]. Implement Annex B.3.3 function hoisting rules for eval"
   href="https://bugs.webkit.org/show_bug.cgi?id=163208">bug 163208</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">CC</td>
           <td>
               &nbsp;
           </td>
           <td>adamk&#64;chromium.org
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6]. Implement Annex B.3.3 function hoisting rules for eval"
   href="https://bugs.webkit.org/show_bug.cgi?id=163208#c68">Comment # 68</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [ES6]. Implement Annex B.3.3 function hoisting rules for eval"
   href="https://bugs.webkit.org/show_bug.cgi?id=163208">bug 163208</a>
              from <span class="vcard"><a class="email" href="mailto:gskachkov&#64;gmail.com" title="GSkachkov &lt;gskachkov&#64;gmail.com&gt;"> <span class="fn">GSkachkov</span></a>
</span></b>
        <pre>(In reply to Caitlin Potter (:caitp) from <a href="show_bug.cgi?id=163208#c66">comment #66</a>)
<span class="quote">&gt; (In reply to GSkachkov from <a href="show_bug.cgi?id=163208#c65">comment #65</a>)
&gt; &gt; (In reply to Caitlin Potter (:caitp) from <a href="show_bug.cgi?id=163208#c63">comment #63</a>)
&gt; &gt; &gt; (In reply to Saam Barati from <a href="show_bug.cgi?id=163208#c46">comment #46</a>)
&gt; &gt; &gt; &gt; If you run this program in Chrome Canary, you can see V8's behavior here
&gt; &gt; &gt; &gt; w.r.t the specification. It looks like the eval does indeed perform `has` on
&gt; &gt; &gt; &gt; the thing inside the with scope.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; ```
&gt; &gt; &gt; &gt; function foo() {
&gt; &gt; &gt; &gt;     let p2 = new Proxy({}, {
&gt; &gt; &gt; &gt;         has(t, p) {
&gt; &gt; &gt; &gt;             console.log(p)
&gt; &gt; &gt; &gt;             return Reflect.has(t, p);
&gt; &gt; &gt; &gt;         }
&gt; &gt; &gt; &gt;     });
&gt; &gt; &gt; &gt;     with (p2) {
&gt; &gt; &gt; &gt;         eval(&quot;Reflect.has(p2, 'bar'); { function baz() { };  }&quot;);
&gt; &gt; &gt; &gt;     }
&gt; &gt; &gt; &gt; }
&gt; &gt; &gt; &gt; foo();
&gt; &gt; &gt; &gt; ```
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; I'm not sure if V8 is correct here, but we should verify the correct
&gt; &gt; &gt; &gt; behavior and try to get that landed. V8 will have the following output:
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; ```
&gt; &gt; &gt; &gt; eval
&gt; &gt; &gt; &gt; Reflect
&gt; &gt; &gt; &gt; p2
&gt; &gt; &gt; &gt; bar
&gt; &gt; &gt; &gt; baz
&gt; &gt; &gt; &gt; ```
&gt; &gt; &gt; 
&gt; &gt; &gt; I believe this is correct, per
&gt; &gt; &gt; <a href="https://tc39.github.io/ecma262/#sec-object-environment-records-hasbinding-n">https://tc39.github.io/ecma262/#sec-object-environment-records-hasbinding-n</a>
&gt; &gt; &gt; and
&gt; &gt; &gt; <a href="https://tc39.github.io/ecma262/#sec-object-environment-records">https://tc39.github.io/ecma262/#sec-object-environment-records</a>-
&gt; &gt; &gt; getbindingvalue-n-s
&gt; &gt; 
&gt; &gt; Hmm, I stil think that it should not be printed 'baz', because according to
&gt; &gt; the p.B.3.3.3.1.d.ii.4.b('If thisEnvRec is not an object Environment Record,
&gt; &gt; then') we don't invoke hasBinding, and just go to outer env recode
&gt; &gt; <a href="https://tc39.github.io/ecma262/#sec-web-compat-evaldeclarationinstantiation">https://tc39.github.io/ecma262/#sec-web-compat-evaldeclarationinstantiation</a>
&gt; 
&gt; As I said on IRC, I wasn't commenting on the hoisting of baz, because the
&gt; behaviour of block scoping of functions and annex B changes to that are
&gt; somewhat hard to follow.
&gt; 
&gt; It looks like you're right about that HasProperty() not occurring from step
&gt; 5, but it may occur further down in the algorithm, from `Let fobj be !
&gt; benvRec.GetBindingValue(F, false).`, as I believe in this instance, benv
&gt; still refers to the with block.
&gt; 
&gt; I could be wrong about this, Adam Klein is much more knowledgable about the
&gt; block-scoping of functions than I am.</span >

Oh sorry, I misunderstood your message in IRC. I'll try to chat with Adam Klein.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>