<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#c64">Comment # 64</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=304941&amp;action=diff" name="attach_304941" title="Patch">attachment 304941</a> <a href="attachment.cgi?id=304941&amp;action=edit" title="Patch">[details]</a></span>
Patch

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

<span class="quote">&gt; Source/JavaScriptCore/interpreter/Interpreter.cpp:1094
&gt; +    int numTopLevelFunctionDecls = eval-&gt;numTopLevelFunctionDecls();</span >

I know this is how the code was before, but let's make this function return an unsigned integer. It's dumb that this is a signed int.

<span class="quote">&gt;&gt;&gt; Source/JavaScriptCore/interpreter/Interpreter.cpp:1095
&gt;&gt;&gt; +    unsigned numCodeBlockFunctionDecls = eval-&gt;numCodeBlockFunctionDecls();
&gt;&gt; 
&gt;&gt; These names are not better IMO.
&gt;&gt; 
&gt;&gt; I still don't understand what the difference here is. Can you explain this to me with an example?
&gt; 
&gt; As I remember spec, top level function in eval might lead to error of redeclaration. 
&gt; ```
&gt; function bar() {
&gt;     {
&gt;         let f = 20;
&gt;         let value = 10; 
&gt;         eval(&quot;function f() { value = 20; }; f();&quot;);
&gt;         print(value);
&gt;     }
&gt; }
&gt; bar(); // SyntaxError: Can't create duplicate variable in eval: 'f'
&gt; ``` 
&gt; 
&gt; but function declared in code block not lead to error
&gt; ```
&gt; function baz() {
&gt;     {
&gt;         let f = 20;
&gt;         let value = 10; 
&gt;         eval(&quot;{ function f() { value = 20; }; f();}&quot;);
&gt;         print(value);
&gt;     }
&gt; }
&gt; baz(); // 20
&gt; ``` 
&gt; So we need to differentiate them.</span >

Ok. I understand what's going on now.
I like the name top level function. For the &quot;CodeBlockFunctions&quot;, I'll propose a different name: &quot;functionHoistingCandidates&quot; or something similar.
This is more in line with our terminology elsewhere.</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>