mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
2.2.3 (#5010)
* Bump version to 2.2.3; update packages * Update output * Update changelog
This commit is contained in:
parent
1869f3121d
commit
820942c3d0
22 changed files with 1759 additions and 955 deletions
|
@ -3215,7 +3215,9 @@ is the index of the beginning.</p>
|
|||
<div class="content"><div class='highlight'><pre> message = isUnassignable prop.unwrapAll().value
|
||||
prop.error message <span class="hljs-keyword">if</span> message
|
||||
|
||||
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>
|
||||
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> <span class="hljs-keyword">and</span>
|
||||
prop.value?.base <span class="hljs-keyword">not</span> <span class="hljs-keyword">instanceof</span> Arr
|
||||
<span class="hljs-keyword">return</span> <span class="hljs-literal">no</span> <span class="hljs-keyword">unless</span> prop.isAssignable()
|
||||
<span class="hljs-literal">yes</span>
|
||||
|
||||
|
@ -4933,7 +4935,8 @@ variable if it isn’t already.</p>
|
|||
vvarText = ref
|
||||
<span class="hljs-function">
|
||||
<span class="hljs-title">slicer</span> = <span class="hljs-params">(type)</span> -></span> (vvar, start, end = <span class="hljs-literal">no</span>) ->
|
||||
args = [<span class="hljs-keyword">new</span> IdentifierLiteral(vvar), <span class="hljs-keyword">new</span> NumberLiteral(start)]
|
||||
vvar = <span class="hljs-keyword">new</span> IdentifierLiteral vvar <span class="hljs-keyword">unless</span> vvar <span class="hljs-keyword">instanceof</span> Value
|
||||
args = [vvar, <span class="hljs-keyword">new</span> NumberLiteral(start)]
|
||||
args.push <span class="hljs-keyword">new</span> NumberLiteral end <span class="hljs-keyword">if</span> end
|
||||
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>]
|
||||
<span class="hljs-keyword">new</span> Value <span class="hljs-keyword">new</span> Call slice, args</pre></div></div>
|
||||
|
@ -5184,7 +5187,7 @@ b) <code>Expansion</code>
|
|||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> refExp = <span class="hljs-keyword">switch</span>
|
||||
<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>
|
||||
<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>
|
||||
<span class="hljs-keyword">when</span> isExpans <span class="hljs-keyword">then</span> compSlice vvarText, rightObjs.length * <span class="hljs-number">-1</span>
|
||||
<span class="hljs-keyword">if</span> complexObjects rightObjs
|
||||
restVar = refExp
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -646,7 +646,7 @@ div.CodeMirror-cursor {
|
|||
<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>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.2.2">2.2.2</a></p>
|
||||
<p><strong>Latest Version:</strong> <a href="https://github.com/jashkenas/coffeescript/tarball/2.2.3">2.2.3</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
|
||||
|
||||
|
@ -4790,7 +4790,7 @@ The CoffeeScript logo is available in SVG for use in presentations.</li>
|
|||
</section>
|
||||
<section id="annotated-source">
|
||||
<h2>Annotated Source</h2>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
|
@ -5467,6 +5467,14 @@ x = <span class="number">2</span> + <span class="number">2</span>
|
|||
</section>
|
||||
<section id="changelog">
|
||||
<h2>Changelog</h2>
|
||||
<div class="anchor" id="2.2.3"></div>
|
||||
<h2 class="header">
|
||||
<a href="https://github.com/jashkenas/coffeescript/compare/2.1.2...2.2.3">2.2.3</a>
|
||||
<span class="timestamp"> — <time datetime="2018-03-11">March 11, 2018</time></span>
|
||||
</h2><ul>
|
||||
<li>Bugfix for object destructuring with an empty array as a key’s value: <code>{ key: [] } = obj</code>.</li>
|
||||
<li>Bugfix for array destructuring onto targets attached to <code>this</code>: <code>[ @most... , @penultimate, @last ] = arr</code>.</li>
|
||||
</ul>
|
||||
<div class="anchor" id="2.2.2"></div>
|
||||
<h2 class="header">
|
||||
<a href="https://github.com/jashkenas/coffeescript/compare/2.1.1...2.2.2">2.2.2</a>
|
||||
|
|
|
@ -1586,7 +1586,7 @@ test "#4878: Compile error when using destructuring with a splat or expansion in
|
|||
([first, ...] = list); first
|
||||
|
||||
f4 = (list) ->
|
||||
([first, ...rest] = list); rest
|
||||
([first, rest...] = list); rest
|
||||
|
||||
arrayEq f1(arr), arr
|
||||
arrayEq f2(arr), arr
|
||||
|
@ -1606,13 +1606,60 @@ test "#4878: Compile error when using destructuring with a splat or expansion in
|
|||
bar = (list) ->
|
||||
ret =
|
||||
if list?.length > 0
|
||||
[first, ...rest] = list
|
||||
[first, rest...] = list
|
||||
[first, rest]
|
||||
else
|
||||
[]
|
||||
|
||||
arrayEq bar(arr), ['a', ['b', 'c', 'd']]
|
||||
|
||||
test "destructuring assignment with an empty array in object", ->
|
||||
obj =
|
||||
a1: [1, 2]
|
||||
b1: 3
|
||||
|
||||
{a1:[], b1} = obj
|
||||
eq 'undefined', typeof a1
|
||||
eq b1, 3
|
||||
|
||||
obj =
|
||||
a2:
|
||||
b2: [1, 2]
|
||||
c2: 3
|
||||
|
||||
{a2: {b2:[]}, c2} = obj
|
||||
eq 'undefined', typeof b2
|
||||
eq c2, 3
|
||||
|
||||
test "#5004: array destructuring with accessors", ->
|
||||
obj =
|
||||
arr: ['a', 'b', 'c', 'd']
|
||||
list: {}
|
||||
f1: ->
|
||||
[@first, @rest...] = @arr
|
||||
f2: ->
|
||||
[@second, @third..., @last] = @rest
|
||||
f3: ->
|
||||
[@list.a, @list.middle..., @list.d] = @arr
|
||||
|
||||
obj.f1()
|
||||
eq obj.first, 'a'
|
||||
arrayEq obj.rest, ['b', 'c', 'd']
|
||||
|
||||
obj.f2()
|
||||
eq obj.second, 'b'
|
||||
arrayEq obj.third, ['c']
|
||||
eq obj.last, 'd'
|
||||
|
||||
obj.f3()
|
||||
eq obj.list.a, 'a'
|
||||
arrayEq obj.list.middle, ['b', 'c']
|
||||
eq obj.list.d, 'd'
|
||||
|
||||
[obj.list.middle..., d] = obj.arr
|
||||
eq d, 'd'
|
||||
arrayEq obj.list.middle, ['a', 'b', 'c']
|
||||
|
||||
</script>
|
||||
<script type="text/x-coffeescript" class="test" id="async">
|
||||
# Functions that contain the `await` keyword will compile into async functions,
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
## Changelog
|
||||
|
||||
```
|
||||
releaseHeader('2018-03-11', '2.2.3', '2.1.2')
|
||||
```
|
||||
* Bugfix for object destructuring with an empty array as a key’s value: `{ key: [] } = obj`.
|
||||
* Bugfix for array destructuring onto targets attached to `this`: `[ @most... , @penultimate, @last ] = arr`.
|
||||
|
||||
```
|
||||
releaseHeader('2018-02-21', '2.2.2', '2.1.1')
|
||||
```
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
// This **Browser** compatibility layer extends core CoffeeScript functions
|
||||
// to make things work smoothly when compiling code directly in the browser.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
// `cake` is a simplified version of [Make](http://www.gnu.org/software/make/)
|
||||
// ([Rake](http://rake.rubyforge.org/), [Jake](https://github.com/280north/jake))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
// 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
// The `coffee` utility. Handles command-line compilation of CoffeeScript
|
||||
// into various forms: saved into `.js` files or printed to stdout
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
// 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
// This file contains the common helper functions that we'd like to share among
|
||||
// the **Lexer**, **Rewriter**, and the **Nodes**. Merge objects, flatten
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
// Node.js Implementation
|
||||
var CoffeeScript, ext, fs, helpers, i, len, path, ref, universalCompile, vm,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
// 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,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
// `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),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments, repeat,
|
||||
splice = [].splice;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
var CoffeeScript, Module, binary, child_process, ext, findExtension, fork, getRootModule, helpers, i, len, loadFile, path, ref;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
var CoffeeScript, addHistory, addMultilineHandler, fs, getCommandId, merge, nodeREPL, path, replDefaults, runInContext, sawSIGINT, transpile, updateSyntaxError, vm;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
// The CoffeeScript language has a good deal of optional syntax, implicit syntax,
|
||||
// and shorthand syntax. This can greatly complicate a grammar and bloat
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
// 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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Generated by CoffeeScript 2.2.2
|
||||
// Generated by CoffeeScript 2.2.3
|
||||
(function() {
|
||||
// Source maps allow JavaScript runtimes to match running JavaScript back to
|
||||
// the original source code that corresponds to it. This can be minified
|
||||
|
|
2598
package-lock.json
generated
2598
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -8,7 +8,7 @@
|
|||
"compiler"
|
||||
],
|
||||
"author": "Jeremy Ashkenas",
|
||||
"version": "2.2.2",
|
||||
"version": "2.2.3",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
|
@ -49,7 +49,7 @@
|
|||
"jison": ">=0.4.18",
|
||||
"markdown-it": "~8.4.1",
|
||||
"underscore": "~1.8.3",
|
||||
"webpack": "~3.11.0"
|
||||
"webpack": "~4.1.1"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue