Skip to content

Commit

Permalink
2.6.1 (#5381)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffreyBooth committed Oct 5, 2021
1 parent d572d74 commit ed6733d
Show file tree
Hide file tree
Showing 26 changed files with 86 additions and 41 deletions.
31 changes: 31 additions & 0 deletions docs/v2/annotated-source/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,37 @@ <h1>index.coffee</h1>

</li>


<li id="section-18">
<div class="annotation">

<div class="sswrap ">

This comment has been minimized.

Copy link
@alexey55501

alexey55501 Oct 17, 2021

rm space "sswrap "

<a class="ss" href="#section-18">&#x00a7;</a>
</div>
<p>Explicitly define all named exports so that Node’s automatic detection of
named exports from CommonJS packages finds all of them. This enables consuming
packages to write code like <code>import { compile } from &#39;coffeescript&#39;</code>.
Don’t simplify this into a loop or similar; the <code>module.exports.name</code> part is
essential for Node’s algorithm to successfully detect the name.</p>

</div>

<div class="content"><div class='highlight'><pre>module.<span class="hljs-built_in">exports</span>.VERSION = CoffeeScript.VERSION
module.<span class="hljs-built_in">exports</span>.FILE_EXTENSIONS = CoffeeScript.FILE_EXTENSIONS
module.<span class="hljs-built_in">exports</span>.helpers = CoffeeScript.helpers
module.<span class="hljs-built_in">exports</span>.registerCompiled = CoffeeScript.registerCompiled
module.<span class="hljs-built_in">exports</span>.compile = CoffeeScript.compile
module.<span class="hljs-built_in">exports</span>.tokens = CoffeeScript.tokens
module.<span class="hljs-built_in">exports</span>.nodes = CoffeeScript.nodes
module.<span class="hljs-built_in">exports</span>.register = CoffeeScript.register
module.<span class="hljs-built_in">exports</span>.<span class="hljs-built_in">eval</span> = CoffeeScript.<span class="hljs-built_in">eval</span>
module.<span class="hljs-built_in">exports</span>.run = CoffeeScript.run
module.<span class="hljs-built_in">exports</span>.transpile = CoffeeScript.transpile
module.<span class="hljs-built_in">exports</span>._compileRawFileContent = CoffeeScript._compileRawFileContent
module.<span class="hljs-built_in">exports</span>._compileFile = CoffeeScript._compileFile</pre></div></div>

</li>

</ul>
</div>
</body>
Expand Down
22 changes: 9 additions & 13 deletions docs/v2/annotated-source/nodes.html
Original file line number Diff line number Diff line change
Expand Up @@ -1009,11 +1009,12 @@ <h3 id="base">Base</h3>
<div class="sswrap ">
<a class="ss" href="#section-42">&#x00a7;</a>
</div>
<p><code>jumps</code> tells you if an expression, or an internal part of an expression
has a flow control construct (like <code>break</code>, or <code>continue</code>, or <code>return</code>,
or <code>throw</code>) that jumps out of the normal flow of control and can’t be
used as a value. This is important because things like this make no sense;
we have to disallow them.</p>
<p><code>jumps</code> tells you if an expression, or an internal part of an expression,
has a flow control construct (like <code>break</code>, <code>continue</code>, or <code>return</code>)
that jumps out of the normal flow of control and can’t be used as a value.
(Note that <code>throw</code> is not considered a flow control construct.)
This is important because flow control in the middle of an expression
makes no sense; we have to disallow it.</p>

</div>

Expand Down Expand Up @@ -1350,13 +1351,8 @@ <h3 id="root">Root</h3>
@initializeScope o
fragments = @body.compileRoot o
<span class="hljs-keyword">return</span> fragments <span class="hljs-keyword">if</span> o.bare
parts = []
parts.push @makeCode <span class="hljs-string">&#x27;(&#x27;</span>
parts.push @makeCode <span class="hljs-string">&#x27;async &#x27;</span> <span class="hljs-keyword">if</span> @isAsync
parts.push @makeCode <span class="hljs-string">&#x27;function() {\n&#x27;</span>
parts.push ...fragments
parts.push @makeCode <span class="hljs-string">&#x27;\n}).call(this);\n&#x27;</span>
[].concat ...parts
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>
[].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>)

initializeScope: <span class="hljs-function"><span class="hljs-params">(o)</span> -&gt;</span>
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>
Expand Down Expand Up @@ -9055,7 +9051,7 @@ <h3 id="try">Try</h3>

isStatement: YES

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

makeReturn: <span class="hljs-function"><span class="hljs-params">(results, mark)</span> -&gt;</span>
ret = @recovery.makeReturn results, mark
Expand Down
4 changes: 2 additions & 2 deletions docs/v2/browser-compiler-legacy/coffeescript.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/v2/browser-compiler-modern/coffeescript.js

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions docs/v2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@
<section id="introduction">
<p><strong>CoffeeScript is a little language that compiles into JavaScript.</strong> Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.</p>
<p>The golden rule of CoffeeScript is: <em>“It’s just JavaScript.”</em> The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable, pretty-printed, and tends to run as fast or faster than the equivalent handwritten JavaScript.</p>
<p><strong>Latest Version:</strong> <a href="https://github.com/jashkenas/coffeescript/tarball/2.6.0">2.6.0</a></p>
<p><strong>Latest Version:</strong> <a href="https://github.com/jashkenas/coffeescript/tarball/2.6.1">2.6.1</a></p>
<blockquote class="uneditable-code-block"><pre><code class="language-bash"><span class="comment"># Install locally for a project:</span>
npm install --save-dev coffeescript

Expand Down Expand Up @@ -4922,7 +4922,7 @@ <h2>Web Chat (IRC)</h2>
</section>
<section id="annotated-source">
<h2>Annotated Source</h2>
<p>You can browse the CoffeeScript 2.6.0 source in readable, annotated form <a href="annotated-source/">here</a>. You can also jump directly to a particular source file:</p>
<p>You can browse the CoffeeScript 2.6.1 source in readable, annotated form <a href="annotated-source/">here</a>. You can also jump directly to a particular source file:</p>
<ul>
<li><a href="annotated-source/grammar.html">Grammar Rules — src/grammar</a></li>
<li><a href="annotated-source/lexer.html">Lexing Tokens — src/lexer</a></li>
Expand Down Expand Up @@ -5600,6 +5600,15 @@ <h3>Argument parsing and shebang (<code>#!</code>) lines</h3>
<section id="changelog">
<h2>Changelog</h2>

<section id="2.6.1">
<h3><a href="https://github.com/jashkenas/coffeescript/compare/2.6.0...2.6.1">2.6.1</a>
<span class="timestamp"> &mdash; <time datetime="2021-10-03">2021-10-03</time></span>
</h3><ul>
<li>The <code>coffeescript</code> package itself now supports named exports when used by ES modules in Node.js; or in other words, <code>import { compile } from 'coffeescript'</code> now works, rather than only <code>import CoffeeScript from 'coffeescript'</code>.</li>
<li>Bugfix for a stack overflow error when compiling large files in non-bare mode.</li>
</ul>

</section>
<section id="2.6.0">
<h3><a href="https://github.com/jashkenas/coffeescript/compare/2.5.1...2.6.0">2.6.0</a>
<span class="timestamp"> &mdash; <time datetime="2021-09-19">2021-09-19</time></span>
Expand Down
6 changes: 6 additions & 0 deletions documentation/sections/changelog/2.6.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```
releaseHeader('2021-10-03', '2.6.1', '2.6.0')
```

* The `coffeescript` package itself now supports named exports when used by ES modules in Node.js; or in other words, `import { compile } from 'coffeescript'` now works, rather than only `import CoffeeScript from 'coffeescript'`.
* Bugfix for a stack overflow error when compiling large files in non-bare mode.
3 changes: 3 additions & 0 deletions documentation/site/body.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@
</section>
<section id="changelog">
<%= htmlFor('changelog') %>
<section id="2.6.1">
<%= htmlFor('changelog/2.6.1') %>
</section>
<section id="2.6.0">
<%= htmlFor('changelog/2.6.0') %>
</section>
Expand Down
4 changes: 2 additions & 2 deletions lib/coffeescript-browser-compiler-legacy/coffeescript.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/coffeescript-browser-compiler-modern/coffeescript.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/coffeescript/browser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/cake.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/coffeescript.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/grammar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/helpers.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/lexer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/nodes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/optparse.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/register.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/repl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/rewriter.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/scope.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/coffeescript/sourcemap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"compiler"
],
"author": "Jeremy Ashkenas",
"version": "2.6.0",
"version": "2.6.1",
"license": "MIT",
"engines": {
"node": ">=6"
Expand Down

0 comments on commit ed6733d

Please sign in to comment.