Skip to content

Commit 820942c

Browse files
2.2.3 (#5010)
* Bump version to 2.2.3; update packages * Update output * Update changelog
1 parent 1869f31 commit 820942c

File tree

22 files changed

+1783
-979
lines changed

22 files changed

+1783
-979
lines changed

docs/v2/annotated-source/nodes.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3215,7 +3215,9 @@ <h3 id="obj">Obj</h3>
32153215
<div class="content"><div class='highlight'><pre> message = isUnassignable prop.unwrapAll().value
32163216
prop.error message <span class="hljs-keyword">if</span> message
32173217

3218-
prop = prop.value <span class="hljs-keyword">if</span> prop <span class="hljs-keyword">instanceof</span> Assign <span class="hljs-keyword">and</span> prop.context <span class="hljs-keyword">is</span> <span class="hljs-string">'object'</span>
3218+
prop = prop.value <span class="hljs-keyword">if</span> prop <span class="hljs-keyword">instanceof</span> Assign <span class="hljs-keyword">and</span>
3219+
prop.context <span class="hljs-keyword">is</span> <span class="hljs-string">'object'</span> <span class="hljs-keyword">and</span>
3220+
prop.value?.base <span class="hljs-keyword">not</span> <span class="hljs-keyword">instanceof</span> Arr
32193221
<span class="hljs-keyword">return</span> <span class="hljs-literal">no</span> <span class="hljs-keyword">unless</span> prop.isAssignable()
32203222
<span class="hljs-literal">yes</span>
32213223

@@ -4933,7 +4935,8 @@ <h3 id="assign">Assign</h3>
49334935
vvarText = ref
49344936
<span class="hljs-function">
49354937
<span class="hljs-title">slicer</span> = <span class="hljs-params">(type)</span> -&gt;</span> (vvar, start, end = <span class="hljs-literal">no</span>) -&gt;
4936-
args = [<span class="hljs-keyword">new</span> IdentifierLiteral(vvar), <span class="hljs-keyword">new</span> NumberLiteral(start)]
4938+
vvar = <span class="hljs-keyword">new</span> IdentifierLiteral vvar <span class="hljs-keyword">unless</span> vvar <span class="hljs-keyword">instanceof</span> Value
4939+
args = [vvar, <span class="hljs-keyword">new</span> NumberLiteral(start)]
49374940
args.push <span class="hljs-keyword">new</span> NumberLiteral end <span class="hljs-keyword">if</span> end
49384941
slice = <span class="hljs-keyword">new</span> Value (<span class="hljs-keyword">new</span> IdentifierLiteral utility type, o), [<span class="hljs-keyword">new</span> Access <span class="hljs-keyword">new</span> PropertyName <span class="hljs-string">'call'</span>]
49394942
<span class="hljs-keyword">new</span> Value <span class="hljs-keyword">new</span> Call slice, args</pre></div></div>
@@ -5184,7 +5187,7 @@ <h3 id="assign">Assign</h3>
51845187
</div>
51855188

51865189
<div class="content"><div class='highlight'><pre> refExp = <span class="hljs-keyword">switch</span>
5187-
<span class="hljs-keyword">when</span> isSplat <span class="hljs-keyword">then</span> compSplice objects[expIdx].unwrapAll().value, rightObjs.length * <span class="hljs-number">-1</span>
5190+
<span class="hljs-keyword">when</span> isSplat <span class="hljs-keyword">then</span> compSplice <span class="hljs-keyword">new</span> Value(objects[expIdx].name), rightObjs.length * <span class="hljs-number">-1</span>
51885191
<span class="hljs-keyword">when</span> isExpans <span class="hljs-keyword">then</span> compSlice vvarText, rightObjs.length * <span class="hljs-number">-1</span>
51895192
<span class="hljs-keyword">if</span> complexObjects rightObjs
51905193
restVar = refExp

docs/v2/browser-compiler/coffeescript.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/v2/index.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@
646646
<section id="overview">
647647
<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>
648648
<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>
649-
<p><strong>Latest Version:</strong> <a href="https://github.com/jashkenas/coffeescript/tarball/2.2.2">2.2.2</a></p>
649+
<p><strong>Latest Version:</strong> <a href="https://github.com/jashkenas/coffeescript/tarball/2.2.3">2.2.3</a></p>
650650
<blockquote class="uneditable-code-block"><pre><code class="language-bash"><span class="comment"># Install locally for a project:</span>
651651
npm install --save-dev coffeescript
652652

@@ -4790,7 +4790,7 @@ <h2>Web Chat (IRC)</h2>
47904790
</section>
47914791
<section id="annotated-source">
47924792
<h2>Annotated Source</h2>
4793-
<p>You can browse the CoffeeScript 2.2.2 source in readable, annotated form <a href="annotated-source/">here</a>. You can also jump directly to a particular source file:</p>
4793+
<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>
47944794
<ul>
47954795
<li><a href="annotated-source/grammar.html">Grammar Rules — src/grammar</a></li>
47964796
<li><a href="annotated-source/lexer.html">Lexing Tokens — src/lexer</a></li>
@@ -5467,6 +5467,14 @@ <h3>Argument parsing and shebang (<code>#!</code>) lines</h3>
54675467
</section>
54685468
<section id="changelog">
54695469
<h2>Changelog</h2>
5470+
<div class="anchor" id="2.2.3"></div>
5471+
<h2 class="header">
5472+
<a href="https://github.com/jashkenas/coffeescript/compare/2.1.2...2.2.3">2.2.3</a>
5473+
<span class="timestamp"> &mdash; <time datetime="2018-03-11">March 11, 2018</time></span>
5474+
</h2><ul>
5475+
<li>Bugfix for object destructuring with an empty array as a key’s value: <code>{ key: [] } = obj</code>.</li>
5476+
<li>Bugfix for array destructuring onto targets attached to <code>this</code>: <code>[ @most... , @penultimate, @last ] = arr</code>.</li>
5477+
</ul>
54705478
<div class="anchor" id="2.2.2"></div>
54715479
<h2 class="header">
54725480
<a href="https://github.com/jashkenas/coffeescript/compare/2.1.1...2.2.2">2.2.2</a>

docs/v2/test.html

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,7 +1586,7 @@ <h1>CoffeeScript Test Suite</h1>
15861586
([first, ...] = list); first
15871587

15881588
f4 = (list) ->
1589-
([first, ...rest] = list); rest
1589+
([first, rest...] = list); rest
15901590

15911591
arrayEq f1(arr), arr
15921592
arrayEq f2(arr), arr
@@ -1606,13 +1606,60 @@ <h1>CoffeeScript Test Suite</h1>
16061606
bar = (list) ->
16071607
ret =
16081608
if list?.length > 0
1609-
[first, ...rest] = list
1609+
[first, rest...] = list
16101610
[first, rest]
16111611
else
16121612
[]
16131613

16141614
arrayEq bar(arr), ['a', ['b', 'c', 'd']]
16151615

1616+
test "destructuring assignment with an empty array in object", ->
1617+
obj =
1618+
a1: [1, 2]
1619+
b1: 3
1620+
1621+
{a1:[], b1} = obj
1622+
eq 'undefined', typeof a1
1623+
eq b1, 3
1624+
1625+
obj =
1626+
a2:
1627+
b2: [1, 2]
1628+
c2: 3
1629+
1630+
{a2: {b2:[]}, c2} = obj
1631+
eq 'undefined', typeof b2
1632+
eq c2, 3
1633+
1634+
test "#5004: array destructuring with accessors", ->
1635+
obj =
1636+
arr: ['a', 'b', 'c', 'd']
1637+
list: {}
1638+
f1: ->
1639+
[@first, @rest...] = @arr
1640+
f2: ->
1641+
[@second, @third..., @last] = @rest
1642+
f3: ->
1643+
[@list.a, @list.middle..., @list.d] = @arr
1644+
1645+
obj.f1()
1646+
eq obj.first, 'a'
1647+
arrayEq obj.rest, ['b', 'c', 'd']
1648+
1649+
obj.f2()
1650+
eq obj.second, 'b'
1651+
arrayEq obj.third, ['c']
1652+
eq obj.last, 'd'
1653+
1654+
obj.f3()
1655+
eq obj.list.a, 'a'
1656+
arrayEq obj.list.middle, ['b', 'c']
1657+
eq obj.list.d, 'd'
1658+
1659+
[obj.list.middle..., d] = obj.arr
1660+
eq d, 'd'
1661+
arrayEq obj.list.middle, ['a', 'b', 'c']
1662+
16161663
</script>
16171664
<script type="text/x-coffeescript" class="test" id="async">
16181665
# Functions that contain the `await` keyword will compile into async functions,

documentation/sections/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## Changelog
22

3+
```
4+
releaseHeader('2018-03-11', '2.2.3', '2.1.2')
5+
```
6+
* Bugfix for object destructuring with an empty array as a key’s value: `{ key: [] } = obj`.
7+
* Bugfix for array destructuring onto targets attached to `this`: `[ @most... , @penultimate, @last ] = arr`.
8+
39
```
410
releaseHeader('2018-02-21', '2.2.2', '2.1.1')
511
```

lib/coffeescript/browser.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/coffeescript/cake.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/coffeescript/coffeescript.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/coffeescript/command.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/coffeescript/grammar.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)