1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

CoffeeScript 0.1.4

This commit is contained in:
Jeremy Ashkenas 2009-12-25 14:43:24 -08:00
parent d46bf8ee71
commit 62485c2b8c
6 changed files with 35 additions and 5 deletions

View file

@ -1,6 +1,6 @@
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = 'coffee-script' s.name = 'coffee-script'
s.version = '0.1.3' # Keep version in sync with coffee-script.rb s.version = '0.1.4' # Keep version in sync with coffee-script.rb
s.date = '2009-12-25' s.date = '2009-12-25'
s.homepage = "http://jashkenas.github.com/coffee-script/" s.homepage = "http://jashkenas.github.com/coffee-script/"

View file

@ -188,6 +188,7 @@ gem install coffee-script</pre>
<pre> <pre>
coffee-script path/to/script.coffee coffee-script path/to/script.coffee
coffee-script --interactive
coffee-script --watch --lint experimental.coffee coffee-script --watch --lint experimental.coffee
coffee-script --print app/scripts/*.coffee > concatenation.js</pre> coffee-script --print app/scripts/*.coffee > concatenation.js</pre>
@ -442,6 +443,18 @@ coffee-script --print app/scripts/*.coffee > concatenation.js</pre>
</ul> </ul>
<h2 id="change_log">Change Log</h2> <h2 id="change_log">Change Log</h2>
<p>
<b class="header" style="margin-top: 20px;">0.1.4</b>
The official CoffeeScript extension is now <tt>.coffee</tt> instead of
<tt>.cs</tt>, which properly belongs to
<a href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)">C#</a>.
Due to popular demand, you can now also use <tt>=</tt> to assign. Unlike
JavaScript, <tt>=</tt> can also be used within object literals, interchangeably
with <tt>:</tt>. Made a grammatical fix for chained function calls
like <tt>func(1)(2)(3)(4)</tt>. Inheritance and super no longer use
<tt>__proto__</tt>, so they should be IE-compatible now.
</p>
<p> <p>
<b class="header" style="margin-top: 20px;">0.1.3</b> <b class="header" style="margin-top: 20px;">0.1.3</b>

View file

@ -11,9 +11,11 @@
lunch = __d; lunch = __d;
// Zebra-stripe a table. // Zebra-stripe a table.
var __e = table; var __e = table;
var __h = [];
for (var __f=0, __g=__e.length; __f<__g; __f++) { for (var __f=0, __g=__e.length; __f<__g; __f++) {
var row = __e[__f]; var row = __e[__f];
var i = __f; var i = __f;
i % 2 === 0 ? highlight(row) : null; __h[__f] = i % 2 === 0 ? highlight(row) : null;
} }
__h;
})(); })();

View file

@ -258,6 +258,7 @@ gem install coffee-script</pre>
<pre> <pre>
coffee-script path/to/script.coffee coffee-script path/to/script.coffee
coffee-script --interactive
coffee-script --watch --lint experimental.coffee coffee-script --watch --lint experimental.coffee
coffee-script --print app/scripts/*.coffee > concatenation.js</pre> coffee-script --print app/scripts/*.coffee > concatenation.js</pre>
@ -567,11 +568,13 @@ highlight(row) <span class="Keyword">for</span> row, i <span class="Keyword">in<
lunch <span class="Keyword">=</span> __d; lunch <span class="Keyword">=</span> __d;
<span class="Comment"><span class="Comment">//</span> Zebra-stripe a table.</span> <span class="Comment"><span class="Comment">//</span> Zebra-stripe a table.</span>
<span class="Storage">var</span> __e <span class="Keyword">=</span> table; <span class="Storage">var</span> __e <span class="Keyword">=</span> table;
<span class="Storage">var</span> __h <span class="Keyword">=</span> [];
<span class="Keyword">for</span> (<span class="Storage">var</span> __f<span class="Keyword">=</span><span class="Number">0</span>, __g<span class="Keyword">=</span>__e.<span class="LibraryConstant">length</span>; __f<span class="Keyword">&lt;</span>__g; __f<span class="Keyword">++</span>) { <span class="Keyword">for</span> (<span class="Storage">var</span> __f<span class="Keyword">=</span><span class="Number">0</span>, __g<span class="Keyword">=</span>__e.<span class="LibraryConstant">length</span>; __f<span class="Keyword">&lt;</span>__g; __f<span class="Keyword">++</span>) {
<span class="Storage">var</span> row <span class="Keyword">=</span> __e[__f]; <span class="Storage">var</span> row <span class="Keyword">=</span> __e[__f];
<span class="Storage">var</span> i <span class="Keyword">=</span> __f; <span class="Storage">var</span> i <span class="Keyword">=</span> __f;
i <span class="Keyword">%</span> <span class="Number">2</span> <span class="Keyword">===</span> <span class="Number">0</span> ? highlight(row) : <span class="BuiltInConstant">null</span>; __h[__f] <span class="Keyword">=</span> i <span class="Keyword">%</span> <span class="Number">2</span> <span class="Keyword">===</span> <span class="Number">0</span> ? highlight(row) : <span class="BuiltInConstant">null</span>;
} }
__h;
</pre><br class='clear' /></div> </pre><br class='clear' /></div>
<p id="slice"> <p id="slice">
@ -829,6 +832,18 @@ world...";
</ul> </ul>
<h2 id="change_log">Change Log</h2> <h2 id="change_log">Change Log</h2>
<p>
<b class="header" style="margin-top: 20px;">0.1.4</b>
The official CoffeeScript extension is now <tt>.coffee</tt> instead of
<tt>.cs</tt>, which properly belongs to
<a href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)">C#</a>.
Due to popular demand, you can now also use <tt>=</tt> to assign. Unlike
JavaScript, <tt>=</tt> can also be used within object literals, interchangeably
with <tt>:</tt>. Made a grammatical fix for chained function calls
like <tt>func(1)(2)(3)(4)</tt>. Inheritance and super no longer use
<tt>__proto__</tt>, so they should be IE-compatible now.
</p>
<p> <p>
<b class="header" style="margin-top: 20px;">0.1.3</b> <b class="header" style="margin-top: 20px;">0.1.3</b>

View file

@ -9,7 +9,7 @@ require "coffee_script/parse_error"
# Namespace for all CoffeeScript internal classes. # Namespace for all CoffeeScript internal classes.
module CoffeeScript module CoffeeScript
VERSION = '0.1.3' # Keep in sync with the gemspec. VERSION = '0.1.4' # Keep in sync with the gemspec.
# Compile a script (String or IO) to JavaScript. # Compile a script (String or IO) to JavaScript.
def self.compile(script, options={}) def self.compile(script, options={})

View file

@ -5,5 +5,5 @@
"description": "Unfancy JavaScript", "description": "Unfancy JavaScript",
"keywords": ["javascript", "language"], "keywords": ["javascript", "language"],
"author": "Jeremy Ashkenas", "author": "Jeremy Ashkenas",
"version": "0.1.3" "version": "0.1.4"
} }