Skip to content

2.6.1 #5381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 5, 2021
Merged

2.6.1 #5381

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ">
<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.

9 changes: 9 additions & 0 deletions docs/v2/index.html
Original file line number Diff line number Diff line change
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.

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