Compare commits

...

6 Commits
1.3.2 ... 1.3.3

Author SHA1 Message Date
Jeremy Ashkenas
79492aab36 CoffeeScript 1.3.3 2012-05-15 12:35:40 -04:00
Jeremy Ashkenas
e3454ed7fb Fixes #2331 -- bound 'super' regression 2012-05-15 12:30:51 -04:00
Michael Ficarra
8dcbe54e55 Fixes broken autocompletion from 8bc6001d27
8bc6001d27 removed autocompletions of
non-enumerable own-properties in trying to add enumerable prototype
properties to the autocompletions. This commit adds them back and unions
them with the enumerable prototype properties.
2012-05-15 02:25:28 -04:00
Michael Ficarra
dac24a3d8a small refactoring of 66c751be11 2012-05-14 21:07:54 -04:00
Michael Ficarra
5c8eef2ab5 package.json: changing license URL to new github raw URL format 2012-05-14 17:50:04 -04:00
Michael Ficarra
66c751be11 fixed REPL to allow streamed input from stdin 2012-05-14 15:55:51 -04:00
64 changed files with 145 additions and 90 deletions

View File

@@ -1,5 +1,5 @@
###
CoffeeScript Compiler v1.3.2
CoffeeScript Compiler v1.3.3
Released under the MIT License
###

View File

@@ -13,7 +13,7 @@ execute all scripts present in <code>text/coffeescript</code> tags.</p>
<span class="nv">content = </span><span class="nx">compile</span> <span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="nx">filename</span><span class="p">,</span> <span class="s1">&#39;utf8&#39;</span><span class="p">),</span> <span class="p">{</span><span class="nx">filename</span><span class="p">}</span>
<span class="nx">module</span><span class="p">.</span><span class="nx">_compile</span> <span class="nx">content</span><span class="p">,</span> <span class="nx">filename</span>
<span class="k">else</span> <span class="k">if</span> <span class="nx">require</span><span class="p">.</span><span class="nx">registerExtension</span>
<span class="nx">require</span><span class="p">.</span><span class="nx">registerExtension</span> <span class="s1">&#39;.coffee&#39;</span><span class="p">,</span> <span class="nf">(content) -&gt;</span> <span class="nx">compile</span> <span class="nx">content</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>The current CoffeeScript version number.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.VERSION = </span><span class="s1">&#39;1.3.2&#39;</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Words that cannot be used as identifiers in CoffeeScript code</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.RESERVED = </span><span class="nx">RESERVED</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Expose helpers for testing.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.helpers = </span><span class="nx">require</span> <span class="s1">&#39;./helpers&#39;</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Compile a string of CoffeeScript code to JavaScript, using the Coffee/Jison
<span class="nx">require</span><span class="p">.</span><span class="nx">registerExtension</span> <span class="s1">&#39;.coffee&#39;</span><span class="p">,</span> <span class="nf">(content) -&gt;</span> <span class="nx">compile</span> <span class="nx">content</span></pre></div> </td> </tr> <tr id="section-3"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-3">&#182;</a> </div> <p>The current CoffeeScript version number.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.VERSION = </span><span class="s1">&#39;1.3.3&#39;</span></pre></div> </td> </tr> <tr id="section-4"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-4">&#182;</a> </div> <p>Words that cannot be used as identifiers in CoffeeScript code</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.RESERVED = </span><span class="nx">RESERVED</span></pre></div> </td> </tr> <tr id="section-5"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-5">&#182;</a> </div> <p>Expose helpers for testing.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.helpers = </span><span class="nx">require</span> <span class="s1">&#39;./helpers&#39;</span></pre></div> </td> </tr> <tr id="section-6"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-6">&#182;</a> </div> <p>Compile a string of CoffeeScript code to JavaScript, using the Coffee/Jison
compiler.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.compile = compile = </span><span class="nf">(code, options = {}) -&gt;</span>
<span class="p">{</span><span class="nx">merge</span><span class="p">}</span> <span class="o">=</span> <span class="nx">exports</span><span class="p">.</span><span class="nx">helpers</span>
<span class="k">try</span>

View File

@@ -384,7 +384,8 @@ method.</p> </td> <td class="code"> <div c
<span class="p">(</span><span class="k">new</span> <span class="nx">Value</span> <span class="p">(</span><span class="k">new</span> <span class="nx">Literal</span> <span class="nx">method</span><span class="p">.</span><span class="nx">klass</span><span class="p">),</span> <span class="nx">accesses</span><span class="p">).</span><span class="nx">compile</span> <span class="nx">o</span>
<span class="k">else</span>
<span class="s2">&quot;#{name}.__super__.constructor&quot;</span></pre></div> </td> </tr> <tr id="section-50"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-50">&#182;</a> </div> <p>The appropriate <code>this</code> value for a <code>super</code> call.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">superThis : </span><span class="nf">(o) -&gt;</span>
<span class="nx">o</span><span class="p">.</span><span class="nx">scope</span><span class="p">.</span><span class="nx">method</span><span class="o">?</span><span class="p">.</span><span class="nx">context</span> <span class="o">or</span> <span class="s2">&quot;this&quot;</span></pre></div> </td> </tr> <tr id="section-51"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-51">&#182;</a> </div> <p>Soaked chained invocations unfold into if/else ternary structures.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">unfoldSoak: </span><span class="nf">(o) -&gt;</span>
<span class="nv">method = </span><span class="nx">o</span><span class="p">.</span><span class="nx">scope</span><span class="p">.</span><span class="nx">method</span>
<span class="p">(</span><span class="nx">method</span> <span class="o">and</span> <span class="o">not</span> <span class="nx">method</span><span class="p">.</span><span class="nx">klass</span> <span class="o">and</span> <span class="nx">method</span><span class="p">.</span><span class="nx">context</span><span class="p">)</span> <span class="o">or</span> <span class="s2">&quot;this&quot;</span></pre></div> </td> </tr> <tr id="section-51"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-51">&#182;</a> </div> <p>Soaked chained invocations unfold into if/else ternary structures.</p> </td> <td class="code"> <div class="highlight"><pre> <span class="nv">unfoldSoak: </span><span class="nf">(o) -&gt;</span>
<span class="k">if</span> <span class="nx">@soak</span>
<span class="k">if</span> <span class="nx">@variable</span>
<span class="k">return</span> <span class="nx">ifn</span> <span class="k">if</span> <span class="nv">ifn = </span><span class="nx">unfoldSoak</span> <span class="nx">o</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="s1">&#39;variable&#39;</span>

View File

@@ -23,7 +23,11 @@ Using it looks like this:</p>
<span class="nv">val = </span><span class="nx">Script</span><span class="p">.</span><span class="nx">runInThisContext</span> <span class="nx">obj</span>
<span class="k">catch</span> <span class="nx">error</span>
<span class="k">return</span>
<span class="nv">completions = </span><span class="nx">getCompletions</span> <span class="nx">prefix</span><span class="p">,</span> <span class="p">(</span><span class="nx">key</span> <span class="k">for</span> <span class="nx">key</span> <span class="k">of</span> <span class="nb">Object</span><span class="p">(</span><span class="nx">val</span><span class="p">))</span>
<span class="nv">val = </span><span class="nb">Object</span> <span class="nx">val</span>
<span class="nv">possibilities = </span><span class="nb">Object</span><span class="p">.</span><span class="nx">getOwnPropertyNames</span> <span class="nx">val</span>
<span class="k">for</span> <span class="nx">key</span> <span class="k">of</span> <span class="nx">val</span> <span class="k">when</span> <span class="o">~</span><span class="nx">possibilities</span><span class="p">.</span><span class="nx">indexOf</span> <span class="nx">val</span>
<span class="nx">possibilities</span><span class="p">.</span><span class="nx">push</span> <span class="nx">key</span>
<span class="nv">completions = </span><span class="nx">getCompletions</span> <span class="nx">prefix</span><span class="p">,</span> <span class="nx">possibilities</span>
<span class="p">[</span><span class="nx">completions</span><span class="p">,</span> <span class="nx">prefix</span><span class="p">]</span></pre></div> </td> </tr> <tr id="section-11"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-11">&#182;</a> </div> <p>Attempt to autocomplete an in-scope free variable: <code>one</code>.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">completeVariable = </span><span class="nf">(text) -&gt;</span>
<span class="nv">free = </span><span class="nx">text</span><span class="p">.</span><span class="nx">match</span><span class="p">(</span><span class="nx">SIMPLEVAR</span><span class="p">)</span><span class="o">?</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
<span class="nv">free = </span><span class="s2">&quot;&quot;</span> <span class="k">if</span> <span class="nx">text</span> <span class="o">is</span> <span class="s2">&quot;&quot;</span>
@@ -74,8 +78,15 @@ of exiting.</p> </td> <td class="code"> <d
<span class="kc">on</span><span class="o">:</span> <span class="o">-&gt;</span>
<span class="nx">stdin</span><span class="p">.</span><span class="kc">on</span> <span class="s1">&#39;data&#39;</span><span class="p">,</span> <span class="nf">(chunk) -&gt;</span>
<span class="nx">pipedInput</span> <span class="o">+=</span> <span class="nx">chunk</span>
<span class="k">return</span> <span class="nx">unless</span> <span class="sr">/\n/</span><span class="p">.</span><span class="nx">test</span> <span class="nx">pipedInput</span>
<span class="nv">lines = </span><span class="nx">pipedInput</span><span class="p">.</span><span class="nx">split</span> <span class="s2">&quot;\n&quot;</span>
<span class="nv">pipedInput = </span><span class="nx">lines</span><span class="p">[</span><span class="nx">lines</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span>
<span class="k">for</span> <span class="nx">line</span> <span class="k">in</span> <span class="nx">lines</span><span class="p">[...</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="k">when</span> <span class="nx">line</span>
<span class="nx">stdout</span><span class="p">.</span><span class="nx">write</span> <span class="s2">&quot;#{line}\n&quot;</span>
<span class="nx">run</span> <span class="nx">line</span>
<span class="k">return</span>
<span class="nx">stdin</span><span class="p">.</span><span class="kc">on</span> <span class="s1">&#39;end&#39;</span><span class="p">,</span> <span class="o">-&gt;</span>
<span class="k">for</span> <span class="nx">line</span> <span class="k">in</span> <span class="nx">pipedInput</span><span class="p">.</span><span class="nx">trim</span><span class="p">().</span><span class="nx">split</span> <span class="s2">&quot;\n&quot;</span>
<span class="k">for</span> <span class="nx">line</span> <span class="k">in</span> <span class="nx">pipedInput</span><span class="p">.</span><span class="nx">trim</span><span class="p">().</span><span class="nx">split</span> <span class="s2">&quot;\n&quot;</span> <span class="k">when</span> <span class="nx">line</span>
<span class="nx">stdout</span><span class="p">.</span><span class="nx">write</span> <span class="s2">&quot;#{line}\n&quot;</span>
<span class="nx">run</span> <span class="nx">line</span>
<span class="nx">stdout</span><span class="p">.</span><span class="nx">write</span> <span class="s1">&#39;\n&#39;</span>

View File

@@ -136,7 +136,7 @@
<p>
<b>Latest Version:</b>
<a href="http://github.com/jashkenas/coffee-script/tarball/1.3.2">1.3.2</a>
<a href="http://github.com/jashkenas/coffee-script/tarball/1.3.3">1.3.3</a>
</p>
<h2>
@@ -1111,8 +1111,8 @@ Expressions
<p>
<b class="header" style="margin-top: 20px;">
<a href="https://github.com/jashkenas/coffee-script/compare/1.3.1...1.3.2">1.3.2</a>
<span class="timestamp"> &ndash; <small>May 14, 2012</small></span>
<a href="https://github.com/jashkenas/coffee-script/compare/1.3.1...1.3.3">1.3.3</a>
<span class="timestamp"> &ndash; <small>May 15, 2012</small></span>
</b>
<ul>
<li>

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var volume, winner;
if (ignition === true) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var courses, dish, food, foods, i, _i, _j, _k, _len, _len1, _len2, _ref;
_ref = ['toast', 'cheese', 'wine'];

View File

@@ -1,6 +1,6 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
/*
CoffeeScript Compiler v1.3.2
CoffeeScript Compiler v1.3.3
Released under the MIT License
*/

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var fs;
fs = require('fs');

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var Animal, Horse, Snake, sam, tom,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var cholesterol, healthy;
cholesterol = 127;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var date, mood;
if (singing) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var fill;
fill = function(container, liquid) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var filename, _fn, _i, _len;
_fn = function(filename) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var hi;
hi = function() {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var footprints, solipsism, speed;
if ((typeof mind !== "undefined" && mind !== null) && !(typeof world !== "undefined" && world !== null)) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var eldest, grade;
grade = function(student) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var one, six, three, two;
six = (one = 1) + (two = 2) + (three = 3);

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var globals, name;
globals = ((function() {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
alert((function() {
try {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var Account;
Account = function(customer, cart) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var cube, square;
square = function(x) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var html;
html = "<strong>\n cup of coffeescript\n</strong>";

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var OPERATOR;
OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var author, quote, sentence;
author = "Wittgenstein";

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var city, forecast, temp, weatherReport, _ref;
weatherReport = function(location) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var age, ages, child, yearsOld;
yearsOld = {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var city, futurists, name, street, _ref, _ref1;
futurists = {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var bitlist, kids, singers, song;
song = ["do", "re", "mi", "fa", "so"];

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
$('.account').attr({
"class": 'active'

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var cubes, list, math, num, number, opposite, race, square,
__slice = [].slice;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var theBait, theSwitch, _ref;
theBait = 1000;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var close, contents, open, tag, _i, _ref,
__slice = [].slice;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
String.prototype.dasherize = function() {
return this.replace(/_/g, "-");

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var countdown, num;
countdown = (function() {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var changeNumbers, inner, outer;
outer = 1;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var copy, end, middle, numbers, start;
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9];

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var zip, _ref;
zip = typeof lottery.drawWinner === "function" ? (_ref = lottery.drawWinner().address) != null ? _ref.zipcode : void 0 : void 0;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var awardMedals, contenders, gold, rest, silver,
__slice = [].slice;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var numbers, _ref;
numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var mobyDick;
mobyDick = "Call me Ishmael. Some years ago -- never mind how long precisely -- having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world...";

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
switch (day) {
case "Mon":

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
try {
allHellBreaksLoose();

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
var lyrics, num;
if (this.studyingEconomics) {

File diff suppressed because one or more lines are too long

View File

@@ -113,7 +113,7 @@
<p>
<b>Latest Version:</b>
<a href="http://github.com/jashkenas/coffee-script/tarball/1.3.2">1.3.2</a>
<a href="http://github.com/jashkenas/coffee-script/tarball/1.3.3">1.3.3</a>
</p>
<h2>
@@ -1987,18 +1987,18 @@ html = "<strong>\n cup of coffeescript\n</strong>";
are preserved in the generated code.
</p>
<div class='code'><pre class="idle"><span class="Comment"><span class="Comment">###</span></span>
<span class="Comment">CoffeeScript Compiler v1.3.2</span>
<span class="Comment">CoffeeScript Compiler v1.3.3</span>
<span class="Comment">Released under the MIT License</span>
<span class="Comment"><span class="Comment">###</span></span>
</pre><pre class="idle"><span class="Comment"><span class="Comment">/*</span></span>
<span class="Comment">CoffeeScript Compiler v1.3.2</span>
<span class="Comment">CoffeeScript Compiler v1.3.3</span>
<span class="Comment">Released under the MIT License</span>
<span class="Comment"><span class="Comment">*/</span></span>
</pre><script>window.example37 = "###\nCoffeeScript Compiler v1.3.2\nReleased under the MIT License\n###\n\n\n"</script><div class='minibutton load' onclick='javascript: loadConsole(example37);'>load</div><br class='clear' /></div>
</pre><script>window.example37 = "###\nCoffeeScript Compiler v1.3.3\nReleased under the MIT License\n###\n\n\n"</script><div class='minibutton load' onclick='javascript: loadConsole(example37);'>load</div><br class='clear' /></div>
<p>
<span id="regexes" class="bookmark"></span>
@@ -2281,8 +2281,8 @@ task(<span class="String"><span class="String">'</span>build:parser<span class="
<p>
<b class="header" style="margin-top: 20px;">
<a href="https://github.com/jashkenas/coffee-script/compare/1.3.1...1.3.2">1.3.2</a>
<span class="timestamp"> &ndash; <small>May 14, 2012</small></span>
<a href="https://github.com/jashkenas/coffee-script/compare/1.3.1...1.3.3">1.3.3</a>
<span class="timestamp"> &ndash; <small>May 15, 2012</small></span>
</b>
<ul>
<li>

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var CoffeeScript, runScripts;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var CoffeeScript, cakefileDirectory, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var Lexer, RESERVED, compile, fs, lexer, parser, path, vm, _ref,
__hasProp = {}.hasOwnProperty;
@@ -27,7 +27,7 @@
});
}
exports.VERSION = '1.3.2';
exports.VERSION = '1.3.3';
exports.RESERVED = RESERVED;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, forkNode, fs, helpers, hidden, joinTimeout, lint, loadRequires, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, sourceCode, sources, spawn, timeLog, unwatchDir, usage, version, wait, watch, watchDir, watchers, writeJs, _ref;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var extend, flatten;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var key, val, _ref;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, STRICT_PROSCRIBED, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, key, last, starts, _ref, _ref1,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var Access, Arr, Assign, Base, Block, Call, Class, Closure, Code, Comment, Existence, Extends, For, IDENTIFIER, IDENTIFIER_STR, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, compact, del, ends, extend, flatten, last, merge, multident, starts, unfoldSoak, utility, _ref, _ref1,
__hasProp = {}.hasOwnProperty,
@@ -821,8 +821,9 @@
};
Call.prototype.superThis = function(o) {
var _ref2;
return ((_ref2 = o.scope.method) != null ? _ref2.context : void 0) || "this";
var method;
method = o.scope.method;
return (method && !method.klass && method.context) || "this";
};
Call.prototype.unfoldSoak = function(o) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var ACCESSOR, CoffeeScript, Module, REPL_PROMPT, REPL_PROMPT_CONTINUATION, REPL_PROMPT_MULTILINE, SIMPLEVAR, Script, autocomplete, backlog, completeAttribute, completeVariable, enableColours, error, getCompletions, inspect, multilineMode, pipedInput, readline, repl, run, stdin, stdout;
@@ -41,7 +41,7 @@
};
completeAttribute = function(text) {
var all, completions, key, match, obj, prefix, val;
var all, completions, key, match, obj, possibilities, prefix, val;
if (match = text.match(ACCESSOR)) {
all = match[0], obj = match[1], prefix = match[2];
try {
@@ -49,14 +49,14 @@
} catch (error) {
return;
}
completions = getCompletions(prefix, (function() {
var _results;
_results = [];
for (key in Object(val)) {
_results.push(key);
val = Object(val);
possibilities = Object.getOwnPropertyNames(val);
for (key in val) {
if (~possibilities.indexOf(val)) {
possibilities.push(key);
}
return _results;
})());
}
completions = getCompletions(prefix, possibilities);
return [completions, prefix];
}
};
@@ -156,13 +156,31 @@
on: function() {}
};
stdin.on('data', function(chunk) {
return pipedInput += chunk;
var line, lines, _i, _len, _ref;
pipedInput += chunk;
if (!/\n/.test(pipedInput)) {
return;
}
lines = pipedInput.split("\n");
pipedInput = lines[lines.length - 1];
_ref = lines.slice(0, -1);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
line = _ref[_i];
if (!(line)) {
continue;
}
stdout.write("" + line + "\n");
run(line);
}
});
stdin.on('end', function() {
var line, _i, _len, _ref;
_ref = pipedInput.trim().split("\n");
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
line = _ref[_i];
if (!(line)) {
continue;
}
stdout.write("" + line + "\n");
run(line);
}

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_BLOCK, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, left, rite, _i, _len, _ref,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.3.2
// Generated by CoffeeScript 1.3.3
(function() {
var Scope, extend, last, _ref;

View File

@@ -3,10 +3,10 @@
"description": "Unfancy JavaScript",
"keywords": ["javascript", "language", "coffeescript", "compiler"],
"author": "Jeremy Ashkenas",
"version": "1.3.2",
"version": "1.3.3",
"licenses": [{
"type": "MIT",
"url": "https://github.com/jashkenas/coffee-script/raw/master/LICENSE"
"url": "https://raw.github.com/jashkenas/coffee-script/master/LICENSE"
}],
"engines": {
"node": ">=0.4.0"

View File

@@ -21,7 +21,7 @@ else if require.registerExtension
require.registerExtension '.coffee', (content) -> compile content
# The current CoffeeScript version number.
exports.VERSION = '1.3.2'
exports.VERSION = '1.3.3'
# Words that cannot be used as identifiers in CoffeeScript code
exports.RESERVED = RESERVED

View File

@@ -525,7 +525,8 @@ exports.Call = class Call extends Base
# The appropriate `this` value for a `super` call.
superThis : (o) ->
o.scope.method?.context or "this"
method = o.scope.method
(method and not method.klass and method.context) or "this"
# Soaked chained invocations unfold into if/else ternary structures.
unfoldSoak: (o) ->

View File

@@ -47,7 +47,11 @@ completeAttribute = (text) ->
val = Script.runInThisContext obj
catch error
return
completions = getCompletions prefix, (key for key of Object(val))
val = Object val
possibilities = Object.getOwnPropertyNames val
for key of val when ~possibilities.indexOf val
possibilities.push key
completions = getCompletions prefix, possibilities
[completions, prefix]
# Attempt to autocomplete an in-scope free variable: `one`.
@@ -119,8 +123,15 @@ if stdin.readable
on: ->
stdin.on 'data', (chunk) ->
pipedInput += chunk
return unless /\n/.test pipedInput
lines = pipedInput.split "\n"
pipedInput = lines[lines.length - 1]
for line in lines[...-1] when line
stdout.write "#{line}\n"
run line
return
stdin.on 'end', ->
for line in pipedInput.trim().split "\n"
for line in pipedInput.trim().split "\n" when line
stdout.write "#{line}\n"
run line
stdout.write '\n'

View File

@@ -67,28 +67,40 @@ test "#1183: super + fat arrows", ->
@_i += 2
super cb
b = new B()
b = new B
b.foo => eq b._i, 3
test "#1183: super + wrap", ->
class A
m : -> 10
class B extends A
constructor : -> super
B::m = -> r = try super()
eq (new B()).m(), 10
eq (new B).m(), 10
test "#1183: super + closures", ->
class A
constructor: ->
@i = 10
foo : -> @i
class B extends A
foo : ->
ret = switch 1
when 0 then 0
when 1 then super()
ret
eq (new B()).foo(), 10
eq (new B).foo(), 10
test "#2331: bound super regression", ->
class A
@value = 'A'
method: -> @constructor.value
class B extends A
method: => super
eq (new B).method(), 'A'