<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <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#c24">Comment # 24</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:sbarati&#64;apple.com" title="Saam Barati &lt;sbarati&#64;apple.com&gt;"> <span class="fn">Saam Barati</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=298664&amp;action=diff" name="attach_298664" title="Patch">attachment 298664</a> <a href="attachment.cgi?id=298664&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=298664&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=298664&amp;action=review</a>

This LGTM, I think it's just about ready to land,  just a few remaining comments.

<span class="quote">&gt; Source/JavaScriptCore/bytecode/BytecodeList.json:157
&gt; +            { &quot;name&quot; : &quot;op_resolve_closest_var_scope&quot;, &quot;length&quot; : 4 }</span >

I have a naming suggestion for this bytecode (and the various functions &amp; DFG node for it)
Instead of calling it &quot;resolve_closest_var_scope&quot;, we should maybe call it:
&quot;resolve_closest_or_var_scope&quot; since the intention is to do a normal scope walk, but stop if we see a var scope. The objective is not to *always* stop at the closest var scope.

<span class="quote">&gt; Source/JavaScriptCore/llint/LowLevelInterpreter32_64.asm:-2115
&gt; -</span >

revert

<span class="quote">&gt; Source/JavaScriptCore/llint/LowLevelInterpreter64.asm:-2068
&gt; -</span >

revert

<span class="quote">&gt; Source/JavaScriptCore/parser/Parser.h:639
&gt; +                    addResult.iterator-&gt;value.setIsFunction();</span >

I don't think this is strictly true here.
Is this needed?

<span class="quote">&gt; Source/JavaScriptCore/runtime/JSScope.cpp:219
&gt; +JSObject* JSScope::resolveClosestVar(ExecState* exec, JSScope* scope, const Identifier&amp; ident)</span >

This function is almost identical to the below resolve. Maybe you can combine them by defining a common function that takes some kind of shouldStopEarly lambda? And just make that function ALWAYS_INLINE.

<span class="quote">&gt; Source/JavaScriptCore/runtime/JSScope.cpp:231
&gt; +            JSScope* globalScopeExtension = scope-&gt;globalObject(vm)-&gt;globalScopeExtension();</span >

Do you know what this is? We should have a test for this if it's easily doable.</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>