2.6.1 (#5381) · jashkenas/coffeescript@ed6733d

@@ -1009,11 +1009,12 @@ <h3 id="base">Base</h3>

10091009

<div class="sswrap ">

10101010

<a class="ss" href="#section-42">&#x00a7;</a>

10111011

</div>

1012-

<p><code>jumps</code> tells you if an expression, or an internal part of an expression

1013-

has a flow control construct (like <code>break</code>, or <code>continue</code>, or <code>return</code>,

1014-

or <code>throw</code>) that jumps out of the normal flow of control and can’t be

1015-

used as a value. This is important because things like this make no sense;

1016-

we have to disallow them.</p>

1012+

<p><code>jumps</code> tells you if an expression, or an internal part of an expression,

1013+

has a flow control construct (like <code>break</code>, <code>continue</code>, or <code>return</code>)

1014+

that jumps out of the normal flow of control and can’t be used as a value.

1015+

(Note that <code>throw</code> is not considered a flow control construct.)

1016+

This is important because flow control in the middle of an expression

1017+

makes no sense; we have to disallow it.</p>

1017101810181019

</div>

10191020

@@ -1350,13 +1351,8 @@ <h3 id="root">Root</h3>

13501351

@initializeScope o

13511352

fragments = @body.compileRoot o

13521353

<span class="hljs-keyword">return</span> fragments <span class="hljs-keyword">if</span> o.bare

1353-

parts = []

1354-

parts.push @makeCode <span class="hljs-string">&#x27;(&#x27;</span>

1355-

parts.push @makeCode <span class="hljs-string">&#x27;async &#x27;</span> <span class="hljs-keyword">if</span> @isAsync

1356-

parts.push @makeCode <span class="hljs-string">&#x27;function() {\n&#x27;</span>

1357-

parts.push ...fragments

1358-

parts.push @makeCode <span class="hljs-string">&#x27;\n}).call(this);\n&#x27;</span>

1359-

[].concat ...parts

1354+

functionKeyword = <span class="hljs-string">&quot;<span class="hljs-subst">#{<span class="hljs-keyword">if</span> @isAsync <span class="hljs-keyword">then</span> <span class="hljs-string">&#x27;async &#x27;</span> <span class="hljs-keyword">else</span> <span class="hljs-string">&#x27;&#x27;</span>}</span>function&quot;</span>

1355+

[].concat @makeCode(<span class="hljs-string">&quot;(<span class="hljs-subst">#{functionKeyword}</span>() {\n&quot;</span>), fragments, @makeCode(<span class="hljs-string">&quot;\n}).call(this);\n&quot;</span>)

1360135613611357

initializeScope: <span class="hljs-function"><span class="hljs-params">(o)</span> -&gt;</span>

13621358

o.scope = <span class="hljs-keyword">new</span> Scope <span class="hljs-literal">null</span>, @body, <span class="hljs-literal">null</span>, o.referencedVars ? []</pre></div></div>

@@ -9055,7 +9051,7 @@ <h3 id="try">Try</h3>

9055905190569052

isStatement: YES

905790539058-

jumps: <span class="hljs-function"><span class="hljs-params">(o)</span> -&gt;</span> @recovery.jumps(o)

9054+

jumps: <span class="hljs-function"><span class="hljs-params">(o)</span> -&gt;</span> @recovery.jumps o

9059905590609056

makeReturn: <span class="hljs-function"><span class="hljs-params">(results, mark)</span> -&gt;</span>

90619057

ret = @recovery.makeReturn results, mark