* Update changelog for 2.2.4

* Bump version to 2.2.4; update output
This commit is contained in:
Geoffrey Booth 2018-03-29 20:00:45 -07:00 committed by GitHub
parent 001f97ac39
commit e5aa758dda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 598 additions and 592 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -646,7 +646,7 @@ div.CodeMirror-cursor {
<section id="overview"> <section id="overview">
<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><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>“Its 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>The golden rule of CoffeeScript is: <em>“Its 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.2.3">2.2.3</a></p> <p><strong>Latest Version:</strong> <a href="https://github.com/jashkenas/coffeescript/tarball/2.2.4">2.2.4</a></p>
<blockquote class="uneditable-code-block"><pre><code class="language-bash"><span class="comment"># Install locally for a project:</span> <blockquote class="uneditable-code-block"><pre><code class="language-bash"><span class="comment"># Install locally for a project:</span>
npm install --save-dev coffeescript npm install --save-dev coffeescript
@ -4790,7 +4790,7 @@ The CoffeeScript logo is available in SVG for use in presentations.</li>
</section> </section>
<section id="annotated-source"> <section id="annotated-source">
<h2>Annotated Source</h2> <h2>Annotated Source</h2>
<p>You can browse the CoffeeScript 2.2.3 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.2.4 source in readable, annotated form <a href="annotated-source/">here</a>. You can also jump directly to a particular source file:</p>
<ul> <ul>
<li><a href="annotated-source/grammar.html">Grammar Rules — src/grammar</a></li> <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> <li><a href="annotated-source/lexer.html">Lexing Tokens — src/lexer</a></li>
@ -5467,9 +5467,17 @@ x = <span class="number">2</span> + <span class="number">2</span>
</section> </section>
<section id="changelog"> <section id="changelog">
<h2>Changelog</h2> <h2>Changelog</h2>
<div class="anchor" id="2.2.4"></div>
<h2 class="header">
<a href="https://github.com/jashkenas/coffeescript/compare/2.2.3...2.2.4">2.2.4</a>
<span class="timestamp"> &mdash; <time datetime="2018-03-29">March 29, 2018</time></span>
</h2><ul>
<li>When the <code>by</code> value in a <code>for</code> loop is a literal number, e.g. <code>for x in [2..1] by -1</code>, fewer checks are necessary to determine if the loop is in range.</li>
<li>Bugfix for regression in 2.2.0 where a statement inside parentheses, e.g. <code>(fn(); break) while condition</code>, was compiling. Pure statements like <code>break</code> or <code>return</code> cannot turn a parenthesized block into an expression, and should throw an error.</li>
</ul>
<div class="anchor" id="2.2.3"></div> <div class="anchor" id="2.2.3"></div>
<h2 class="header"> <h2 class="header">
<a href="https://github.com/jashkenas/coffeescript/compare/2.1.2...2.2.3">2.2.3</a> <a href="https://github.com/jashkenas/coffeescript/compare/2.2.2...2.2.3">2.2.3</a>
<span class="timestamp"> &mdash; <time datetime="2018-03-11">March 11, 2018</time></span> <span class="timestamp"> &mdash; <time datetime="2018-03-11">March 11, 2018</time></span>
</h2><ul> </h2><ul>
<li>Bugfix for object destructuring with an empty array as a keys value: <code>{ key: [] } = obj</code>.</li> <li>Bugfix for object destructuring with an empty array as a keys value: <code>{ key: [] } = obj</code>.</li>
@ -5477,7 +5485,7 @@ x = <span class="number">2</span> + <span class="number">2</span>
</ul> </ul>
<div class="anchor" id="2.2.2"></div> <div class="anchor" id="2.2.2"></div>
<h2 class="header"> <h2 class="header">
<a href="https://github.com/jashkenas/coffeescript/compare/2.1.1...2.2.2">2.2.2</a> <a href="https://github.com/jashkenas/coffeescript/compare/2.2.1...2.2.2">2.2.2</a>
<span class="timestamp"> &mdash; <time datetime="2018-02-21">February 21, 2018</time></span> <span class="timestamp"> &mdash; <time datetime="2018-02-21">February 21, 2018</time></span>
</h2><ul> </h2><ul>
<li>Bugfix for regression in 2.2.0 where a range with a <code>by</code> (step) value that increments or decrements in the opposite direction as the range was returning an array containing the first value of the range, whereas it should be returning an empty array. In other words, <code>x for x in [2..1] by 1</code> should equal <code>[]</code>, not <code>[2]</code> (because the step value is positive 1, counting up, whereas the range goes from 2 to 1, counting down).</li> <li>Bugfix for regression in 2.2.0 where a range with a <code>by</code> (step) value that increments or decrements in the opposite direction as the range was returning an array containing the first value of the range, whereas it should be returning an empty array. In other words, <code>x for x in [2..1] by 1</code> should equal <code>[]</code>, not <code>[2]</code> (because the step value is positive 1, counting up, whereas the range goes from 2 to 1, counting down).</li>
@ -5485,7 +5493,7 @@ x = <span class="number">2</span> + <span class="number">2</span>
</ul> </ul>
<div class="anchor" id="2.2.1"></div> <div class="anchor" id="2.2.1"></div>
<h2 class="header"> <h2 class="header">
<a href="https://github.com/jashkenas/coffeescript/compare/2.1.0...2.2.1">2.2.1</a> <a href="https://github.com/jashkenas/coffeescript/compare/2.2.0...2.2.1">2.2.1</a>
<span class="timestamp"> &mdash; <time datetime="2018-02-06">February 6, 2018</time></span> <span class="timestamp"> &mdash; <time datetime="2018-02-06">February 6, 2018</time></span>
</h2><ul> </h2><ul>
<li>Bugfix for regression in 2.2.0 involving an error thrown by the compiler in certain cases when using destructuring with a splat or expansion in an array.</li> <li>Bugfix for regression in 2.2.0 involving an error thrown by the compiler in certain cases when using destructuring with a splat or expansion in an array.</li>

View File

@ -1664,9 +1664,10 @@ test "#5004: array destructuring with accessors", ->
<script type="text/x-coffeescript" class="test" id="async"> <script type="text/x-coffeescript" class="test" id="async">
# Functions that contain the `await` keyword will compile into async functions, # Functions that contain the `await` keyword will compile into async functions,
# supported by Node 7.6+, Chrome 55+, Firefox 52+, Safari 10.1+ and Edge. # supported by Node 7.6+, Chrome 55+, Firefox 52+, Safari 10.1+ and Edge.
# But runtimes that dont support the `await` keyword will throw an error, # But runtimes that dont support the `await` keyword will throw an error just
# even if we put `return unless global.supportsAsync` at the top of this file. # from parsing this file, even without executing it, even if we put
# Therefore we need to prevent runtimes which will choke on such code from even # `return unless try new Function 'async () => {}'` at the top of this file.
# Therefore we need to prevent runtimes which will choke on such code from
# parsing it, which is handled in `Cakefile`. # parsing it, which is handled in `Cakefile`.
@ -2154,6 +2155,7 @@ test "classes with value'd constructors", ->
inner = ++counter inner = ++counter
-> ->
@value = inner @value = inner
@
class One class One
constructor: classMaker() constructor: classMaker()
@ -6808,37 +6810,6 @@ test "#3921: `switch`", ->
else "none" else "none"
eq "five", c eq "five", c
# Issue #3441: Parentheses wrapping expression throw invalid error in `then` clause
test "#3441: `StatementLiteral` in parentheses", ->
i = 0
r1 = ((i++; break) while i < 10)
arrayEq r1, []
i = 0
r2 = ((i++; continue) while i < 10)
arrayEq r2, []
i = 0
r4 = while i < 10 then (i++; break)
arrayEq r4, []
i = 0
r5 = while i < 10 then (i++; continue)
arrayEq r5, []
arr = [0..9]
r6 = ((a; break) for a in arr)
arrayEq r6, []
r7 = ((a; continue) for a in arr)
arrayEq r7, []
r8 = for a in arr then (a; break)
arrayEq r8, []
r9 = for a in arr then (a; continue)
arrayEq r9, []
# Issue #3909: backslash to break line in `for` loops throw syntax error # Issue #3909: backslash to break line in `for` loops throw syntax error
test "#3909: backslash `for own ... of`", -> test "#3909: backslash `for own ... of`", ->
@ -8794,6 +8765,42 @@ test "#4097: `yield return` as an expression", ->
^^^^^^^^^^^^ ^^^^^^^^^^^^
''' '''
test "#5013: `await return` as an expression", ->
assertErrorFormat '''
-> (await return)
''', '''
[stdin]:1:5: error: cannot use a pure statement in an expression
-> (await return)
^^^^^^^^^^^^
'''
test "#5013: `return` as an expression", ->
assertErrorFormat '''
-> (return)
''', '''
[stdin]:1:5: error: cannot use a pure statement in an expression
-> (return)
^^^^^^
'''
test "#5013: `break` as an expression", ->
assertErrorFormat '''
(b = 1; break) for b in a
''', '''
[stdin]:1:9: error: cannot use a pure statement in an expression
(b = 1; break) for b in a
^^^^^
'''
test "#5013: `continue` as an expression", ->
assertErrorFormat '''
(b = 1; continue) for b in a
''', '''
[stdin]:1:9: error: cannot use a pure statement in an expression
(b = 1; continue) for b in a
^^^^^^^^
'''
test "`&&=` and `||=` with a space in-between", -> test "`&&=` and `||=` with a space in-between", ->
assertErrorFormat ''' assertErrorFormat '''
a = 0 a = 0
@ -16886,7 +16893,7 @@ testRepl "keeps running after runtime error", (input, output) ->
eq 'undefined', output.lastWrite() eq 'undefined', output.lastWrite()
testRepl "#4604: wraps an async function", (input, output) -> testRepl "#4604: wraps an async function", (input, output) ->
return unless global.supportsAsync return unless try new Function 'async () => {}' # Feature detect support for async functions.
input.emitLine 'await new Promise (resolve) -> setTimeout (-> resolve 33), 10' input.emitLine 'await new Promise (resolve) -> setTimeout (-> resolve 33), 10'
setTimeout -> setTimeout ->
eq '33', output.lastWrite() eq '33', output.lastWrite()

View File

@ -1,19 +1,25 @@
## Changelog ## Changelog
``` ```
releaseHeader('2018-03-11', '2.2.3', '2.1.2') releaseHeader('2018-03-29', '2.2.4', '2.2.3')
```
* When the `by` value in a `for` loop is a literal number, e.g. `for x in [2..1] by -1`, fewer checks are necessary to determine if the loop is in range.
* Bugfix for regression in 2.2.0 where a statement inside parentheses, e.g. `(fn(); break) while condition`, was compiling. Pure statements like `break` or `return` cannot turn a parenthesized block into an expression, and should throw an error.
```
releaseHeader('2018-03-11', '2.2.3', '2.2.2')
``` ```
* Bugfix for object destructuring with an empty array as a keys value: `{ key: [] } = obj`. * Bugfix for object destructuring with an empty array as a keys value: `{ key: [] } = obj`.
* Bugfix for array destructuring onto targets attached to `this`: `[ @most... , @penultimate, @last ] = arr`. * Bugfix for array destructuring onto targets attached to `this`: `[ @most... , @penultimate, @last ] = arr`.
``` ```
releaseHeader('2018-02-21', '2.2.2', '2.1.1') releaseHeader('2018-02-21', '2.2.2', '2.2.1')
``` ```
* Bugfix for regression in 2.2.0 where a range with a `by` (step) value that increments or decrements in the opposite direction as the range was returning an array containing the first value of the range, whereas it should be returning an empty array. In other words, `x for x in [2..1] by 1` should equal `[]`, not `[2]` (because the step value is positive 1, counting up, whereas the range goes from 2 to 1, counting down). * Bugfix for regression in 2.2.0 where a range with a `by` (step) value that increments or decrements in the opposite direction as the range was returning an array containing the first value of the range, whereas it should be returning an empty array. In other words, `x for x in [2..1] by 1` should equal `[]`, not `[2]` (because the step value is positive 1, counting up, whereas the range goes from 2 to 1, counting down).
* Bugfixes for allowing backslashes in `import` and `export` statements and lines that trigger the start of an indented block, like an `if` statement. * Bugfixes for allowing backslashes in `import` and `export` statements and lines that trigger the start of an indented block, like an `if` statement.
``` ```
releaseHeader('2018-02-06', '2.2.1', '2.1.0') releaseHeader('2018-02-06', '2.2.1', '2.2.0')
``` ```
* Bugfix for regression in 2.2.0 involving an error thrown by the compiler in certain cases when using destructuring with a splat or expansion in an array. * Bugfix for regression in 2.2.0 involving an error thrown by the compiler in certain cases when using destructuring with a splat or expansion in an array.
* Bugfix for regression in 2.2.0 where in certain cases a range iterator variable was declared in the global scope. * Bugfix for regression in 2.2.0 where in certain cases a range iterator variable was declared in the global scope.

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
// This **Browser** compatibility layer extends core CoffeeScript functions // This **Browser** compatibility layer extends core CoffeeScript functions
// to make things work smoothly when compiling code directly in the browser. // to make things work smoothly when compiling code directly in the browser.

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
// `cake` is a simplified version of [Make](http://www.gnu.org/software/make/) // `cake` is a simplified version of [Make](http://www.gnu.org/software/make/)
// ([Rake](http://rake.rubyforge.org/), [Jake](https://github.com/280north/jake)) // ([Rake](http://rake.rubyforge.org/), [Jake](https://github.com/280north/jake))

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
// CoffeeScript can be used both on the server, as a command-line compiler based // CoffeeScript can be used both on the server, as a command-line compiler based
// on Node.js/V8, or to run CoffeeScript directly in the browser. This module // on Node.js/V8, or to run CoffeeScript directly in the browser. This module

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
// The `coffee` utility. Handles command-line compilation of CoffeeScript // The `coffee` utility. Handles command-line compilation of CoffeeScript
// into various forms: saved into `.js` files or printed to stdout // into various forms: saved into `.js` files or printed to stdout

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
// The CoffeeScript parser is generated by [Jison](https://github.com/zaach/jison) // The CoffeeScript parser is generated by [Jison](https://github.com/zaach/jison)
// from this grammar file. Jison is a bottom-up parser generator, similar in // from this grammar file. Jison is a bottom-up parser generator, similar in

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
// This file contains the common helper functions that we'd like to share among // This file contains the common helper functions that we'd like to share among
// the **Lexer**, **Rewriter**, and the **Nodes**. Merge objects, flatten // the **Lexer**, **Rewriter**, and the **Nodes**. Merge objects, flatten

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
// Node.js Implementation // Node.js Implementation
var CoffeeScript, ext, fs, helpers, i, len, path, ref, universalCompile, vm, var CoffeeScript, ext, fs, helpers, i, len, path, ref, universalCompile, vm,

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
// The CoffeeScript Lexer. Uses a series of token-matching regexes to attempt // The CoffeeScript Lexer. Uses a series of token-matching regexes to attempt
// matches against the beginning of the source code. When a match is found, // matches against the beginning of the source code. When a match is found,

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
// `nodes.coffee` contains all of the node classes for the syntax tree. Most // `nodes.coffee` contains all of the node classes for the syntax tree. Most
// nodes are created as the result of actions in the [grammar](grammar.html), // nodes are created as the result of actions in the [grammar](grammar.html),

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments, repeat, var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments, repeat,
splice = [].splice; splice = [].splice;

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
var CoffeeScript, Module, binary, child_process, ext, findExtension, fork, getRootModule, helpers, i, len, loadFile, path, ref; var CoffeeScript, Module, binary, child_process, ext, findExtension, fork, getRootModule, helpers, i, len, loadFile, path, ref;

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
var CoffeeScript, addHistory, addMultilineHandler, fs, getCommandId, merge, nodeREPL, path, replDefaults, runInContext, sawSIGINT, transpile, updateSyntaxError, vm; var CoffeeScript, addHistory, addMultilineHandler, fs, getCommandId, merge, nodeREPL, path, replDefaults, runInContext, sawSIGINT, transpile, updateSyntaxError, vm;

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
// The CoffeeScript language has a good deal of optional syntax, implicit syntax, // The CoffeeScript language has a good deal of optional syntax, implicit syntax,
// and shorthand syntax. This can greatly complicate a grammar and bloat // and shorthand syntax. This can greatly complicate a grammar and bloat

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
// The **Scope** class regulates lexical scoping within CoffeeScript. As you // The **Scope** class regulates lexical scoping within CoffeeScript. As you
// generate code, you create a tree of scopes in the same shape as the nested // generate code, you create a tree of scopes in the same shape as the nested

View File

@ -1,4 +1,4 @@
// Generated by CoffeeScript 2.2.3 // Generated by CoffeeScript 2.2.4
(function() { (function() {
// Source maps allow JavaScript runtimes to match running JavaScript back to // Source maps allow JavaScript runtimes to match running JavaScript back to
// the original source code that corresponds to it. This can be minified // the original source code that corresponds to it. This can be minified

View File

@ -8,7 +8,7 @@
"compiler" "compiler"
], ],
"author": "Jeremy Ashkenas", "author": "Jeremy Ashkenas",
"version": "2.2.3", "version": "2.2.4",
"license": "MIT", "license": "MIT",
"engines": { "engines": {
"node": ">=6" "node": ">=6"