Skip to content
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

1.12.3 #4429

Merged
merged 5 commits into from
Jan 24, 2017
Merged

1.12.3 #4429

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
323 changes: 263 additions & 60 deletions docs/v1/annotated-source/coffee-script.html

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions docs/v1/annotated-source/nodes.html
Original file line number Diff line number Diff line change
Expand Up @@ -4114,7 +4114,8 @@ <h3 id="op">Op</h3>

compileFloorDivision: <span class="hljs-function"><span class="hljs-params">(o)</span> -&gt;</span>
floor = <span class="hljs-keyword">new</span> Value <span class="hljs-keyword">new</span> IdentifierLiteral(<span class="hljs-string">'Math'</span>), [<span class="hljs-keyword">new</span> Access <span class="hljs-keyword">new</span> PropertyName <span class="hljs-string">'floor'</span>]
div = <span class="hljs-keyword">new</span> Op <span class="hljs-string">'/'</span>, @first, @second
second = <span class="hljs-keyword">if</span> @second.isComplex() <span class="hljs-keyword">then</span> <span class="hljs-keyword">new</span> Parens @second <span class="hljs-keyword">else</span> @second
div = <span class="hljs-keyword">new</span> Op <span class="hljs-string">'/'</span>, @first, second
<span class="hljs-keyword">new</span> Call(floor, [div]).compileToFragments o

compileModulo: <span class="hljs-function"><span class="hljs-params">(o)</span> -&gt;</span>
Expand Down Expand Up @@ -4591,7 +4592,7 @@ <h3 id="for">For</h3>
@index.error <span class="hljs-string">'cannot use index with for-from'</span> <span class="hljs-keyword">if</span> @from <span class="hljs-keyword">and</span> @index
source.ownTag.error <span class="hljs-string">"cannot use own with for-<span class="hljs-subst">#{<span class="hljs-keyword">if</span> @from <span class="hljs-keyword">then</span> <span class="hljs-string">'from'</span> <span class="hljs-keyword">else</span> <span class="hljs-string">'in'</span>}</span>"</span> <span class="hljs-keyword">if</span> @own <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> @object
[@name, @index] = [@index, @name] <span class="hljs-keyword">if</span> @object
@index.error <span class="hljs-string">'index cannot be a pattern matching expression'</span> <span class="hljs-keyword">if</span> @index <span class="hljs-keyword">instanceof</span> Value
@index.error <span class="hljs-string">'index cannot be a pattern matching expression'</span> <span class="hljs-keyword">if</span> @index <span class="hljs-keyword">instanceof</span> Value <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> @index.isAssignable()
@range = @source <span class="hljs-keyword">instanceof</span> Value <span class="hljs-keyword">and</span> @source.base <span class="hljs-keyword">instanceof</span> Range <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> @source.properties.length <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> @from
@pattern = @name <span class="hljs-keyword">instanceof</span> Value
@index.error <span class="hljs-string">'indexes do not apply to range loops'</span> <span class="hljs-keyword">if</span> @range <span class="hljs-keyword">and</span> @index
Expand Down Expand Up @@ -4625,7 +4626,7 @@ <h3 id="for">For</h3>
name = @name <span class="hljs-keyword">and</span> (@name.compile o, LEVEL_LIST) <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> @pattern
index = @index <span class="hljs-keyword">and</span> (@index.compile o, LEVEL_LIST)
scope.find(name) <span class="hljs-keyword">if</span> name <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> @pattern
scope.find(index) <span class="hljs-keyword">if</span> index
scope.find(index) <span class="hljs-keyword">if</span> index <span class="hljs-keyword">and</span> @index <span class="hljs-keyword">not</span> <span class="hljs-keyword">instanceof</span> Value
rvar = scope.freeVariable <span class="hljs-string">'results'</span> <span class="hljs-keyword">if</span> @returns
<span class="hljs-keyword">if</span> @from
ivar = scope.freeVariable <span class="hljs-string">'x'</span>, single: <span class="hljs-literal">true</span> <span class="hljs-keyword">if</span> @pattern
Expand Down
8 changes: 4 additions & 4 deletions docs/v1/browser-compiler/coffee-script.js

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

23 changes: 19 additions & 4 deletions docs/v1/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@
<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>The CoffeeScript compiler goes to great lengths to generate output JavaScript that runs in every JavaScript runtime, but there are exceptions. Use <a href="#generator-functions">generator functions</a>, <a href="#generator-iteration"><code>for…from</code></a>, or <a href="#tagged-template-literals">tagged template literals</a> only if you know that your <a href="http://kangax.github.io/compat-table/es6/">target runtimes can support them</a>. If you use <a href="#modules">modules</a>, you will need to <a href="#modules-note">use an additional tool to resolve them</a>.</p>
<p><strong>Latest Version:</strong> <a href="http://github.com/jashkenas/coffeescript/tarball/1.12.2">1.12.2</a></p>
<p><strong>Latest Version:</strong> <a href="http://github.com/jashkenas/coffeescript/tarball/1.12.3">1.12.3</a></p>
<blockquote>
<pre><code>npm install -g coffee-script</code></pre></blockquote>

Expand Down Expand Up @@ -1936,8 +1936,10 @@ <h2>Destructuring Assignment</h2><p>Just like JavaScript (since ES2015), CoffeeS
<span class="string">"Bellagio, Italy 22021"</span>
]

{sculptor} = futurists

{poet: {name, address: [street, city]}} = futurists
</code></pre><pre><code><span class="keyword">var</span> city, futurists, name, ref, ref1, street;
</code></pre><pre><code><span class="keyword">var</span> city, futurists, name, ref, ref1, sculptor, street;

futurists = {
<span class="attr">sculptor</span>: <span class="string">"Umberto Boccioni"</span>,
Expand All @@ -1948,8 +1950,10 @@ <h2>Destructuring Assignment</h2><p>Just like JavaScript (since ES2015), CoffeeS
}
};

sculptor = futurists.sculptor;

ref = futurists.poet, name = ref.name, (ref1 = ref.address, street = ref1[<span class="number">0</span>], city = ref1[<span class="number">1</span>]);
</code></pre><script>window.example3 = "futurists =\n sculptor: \"Umberto Boccioni\"\n painter: \"Vladimir Burliuk\"\n poet:\n name: \"F.T. Marinetti\"\n address: [\n \"Via Roma 42R\"\n \"Bellagio, Italy 22021\"\n ]\n\n{poet: {name, address: [street, city]}} = futurists\n"</script><div class='minibutton load' onclick='javascript: loadConsole(example3);'>load</div><div class="minibutton ok" onclick="javascript: var city, futurists, name, ref, ref1, street;
</code></pre><script>window.example3 = "futurists =\n sculptor: \"Umberto Boccioni\"\n painter: \"Vladimir Burliuk\"\n poet:\n name: \"F.T. Marinetti\"\n address: [\n \"Via Roma 42R\"\n \"Bellagio, Italy 22021\"\n ]\n\n{sculptor} = futurists\n\n{poet: {name, address: [street, city]}} = futurists\n"</script><div class='minibutton load' onclick='javascript: loadConsole(example3);'>load</div><div class="minibutton ok" onclick="javascript: var city, futurists, name, ref, ref1, sculptor, street;

futurists = {
sculptor: &quot;Umberto Boccioni&quot;,
Expand All @@ -1960,6 +1964,8 @@ <h2>Destructuring Assignment</h2><p>Just like JavaScript (since ES2015), CoffeeS
}
};

sculptor = futurists.sculptor;

ref = futurists.poet, name = ref.name, (ref1 = ref.address, street = ref1[0], city = ref1[1]);
;alert(name + &quot;-&quot; + street);">run: name + "-" + street</div><br class='clear' /></div><p>Destructuring assignment can even be combined with splats.</p>
<div class='code'><pre><code>tag = <span class="string">"&lt;impossible&gt;"</span>
Expand Down Expand Up @@ -2603,7 +2609,16 @@ <h2>Web Chat (IRC)</h2><p>Quick help and advice can usually be found in the Coff
<button id="open_webchat">click to open #coffeescript</button>

<span class="bookmark" id="changelog"></span>
<h2>Change Log</h2><div class="anchor" id="1.12.2"></div>
<h2>Change Log</h2><div class="anchor" id="1.12.3"></div>
<h2 class="header">
<a href="https://github.com/jashkenas/coffeescript/compare/1.12.2...1.12.3">1.12.3</a>
<span class="timestamp"> &mdash; <time datetime="2017-01-22">January 22, 2017</time></span>
</h2><ul>
<li><code>@</code> values can now be used as indices in <code>for</code> expressions. This loosens the compilation of <code>for</code> expressions to allow the index variable to be an <code>@</code> value, e.g. <code>do @visit for @node, @index in nodes</code>. Within <code>@visit</code>, the index of the current node (<code>@node</code>) would be available as <code>@index</code>.</li>
<li>CoffeeScript’s patched <code>Error.prepareStackTrace</code> has been restored, with some revisions that should prevent the erroneous exceptions that were making life difficult for some downstream projects. This fixes the incorrect line numbers in stack traces since 1.12.2.</li>
<li>The <code>//=</code> operator’s output now wraps parentheses around the right operand, like the other assignment operators.</li>
</ul>
<div class="anchor" id="1.12.2"></div>
<h2 class="header">
<a href="https://github.com/jashkenas/coffeescript/compare/1.12.1...1.12.2">1.12.2</a>
<span class="timestamp"> &mdash; <time datetime="2016-12-16">December 16, 2016</time></span>
Expand Down
8 changes: 8 additions & 0 deletions documentation/sections/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## Change Log

```
releaseHeader('2017-01-22', '1.12.3', '1.12.2')
```

* `@` values can now be used as indices in `for` expressions. This loosens the compilation of `for` expressions to allow the index variable to be an `@` value, e.g. `do @visit for @node, @index in nodes`. Within `@visit`, the index of the current node (`@node`) would be available as `@index`.
* CoffeeScript’s patched `Error.prepareStackTrace` has been restored, with some revisions that should prevent the erroneous exceptions that were making life difficult for some downstream projects. This fixes the incorrect line numbers in stack traces since 1.12.2.
* The `//=` operator’s output now wraps parentheses around the right operand, like the other assignment operators.

```
releaseHeader('2016-12-16', '1.12.2', '1.12.1')
```
Expand Down
2 changes: 1 addition & 1 deletion lib/coffee-script/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/coffee-script/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/coffee-script/coffee-script.js

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

Loading