Permalink
Browse files

CoffeeScript 1.3.0

  • Loading branch information...
1 parent 1b3af68 commit ed8d94f69ca2cf11f6bade26f1bce1a5afabd312 @jashkenas jashkenas committed Apr 10, 2012
Showing with 1,588 additions and 699 deletions.
  1. +1 −1 LICENSE
  2. +1 −1 documentation/coffee/block_comment.coffee
  3. +0 −1 documentation/coffee/conditionals.coffee
  4. +2 −1 documentation/coffee/existence.coffee
  5. +2 −1 documentation/docs/browser.html
  6. +3 −2 documentation/docs/cake.html
  7. +8 −5 documentation/docs/coffee-script.html
  8. +35 −40 documentation/docs/command.html
  9. +3 −2 documentation/docs/grammar.html
  10. +46 −26 documentation/docs/lexer.html
  11. +207 −109 documentation/docs/nodes.html
  12. +34 −28 documentation/docs/optparse.html
  13. +78 −33 documentation/docs/repl.html
  14. +47 −44 documentation/docs/rewriter.html
  15. +1 −1 documentation/docs/scope.html
  16. +54 −9 documentation/index.html.erb
  17. +16 −5 documentation/js/aliases.js
  18. +8 −5 documentation/js/array_comprehensions.js
  19. +3 −1 documentation/js/block_comment.js
  20. +1 −0 documentation/js/cake_tasks.js
  21. +10 −3 documentation/js/classes.js
  22. +1 −0 documentation/js/comparisons.js
  23. +4 −3 documentation/js/conditionals.js
  24. +4 −1 documentation/js/default_args.js
  25. +1 −0 documentation/js/do.js
  26. +1 −0 documentation/js/embedded.js
  27. +7 −2 documentation/js/existence.js
  28. +1 −0 documentation/js/expressions.js
  29. +1 −0 documentation/js/expressions_assignment.js
  30. +1 −0 documentation/js/expressions_comprehension.js
  31. +1 −0 documentation/js/expressions_try.js
  32. +1 −0 documentation/js/fat_arrow.js
  33. +1 −0 documentation/js/functions.js
  34. +1 −0 documentation/js/heredocs.js
  35. +1 −0 documentation/js/heregexes.js
  36. +1 −0 documentation/js/interpolation.js
  37. +1 −0 documentation/js/multiple_return_values.js
  38. +1 −0 documentation/js/object_comprehensions.js
  39. +3 −2 documentation/js/object_extraction.js
  40. +1 −0 documentation/js/objects_and_arrays.js
  41. +1 −0 documentation/js/objects_reserved.js
  42. +8 −3 documentation/js/overview.js
  43. +1 −0 documentation/js/parallel_assignment.js
  44. +2 −1 documentation/js/patterns_and_splats.js
  45. +1 −0 documentation/js/prototypes.js
  46. +3 −2 documentation/js/range_comprehensions.js
  47. +1 −0 documentation/js/scope.js
  48. +9 −4 documentation/js/slices.js
  49. +1 −0 documentation/js/soaks.js
  50. +2 −1 documentation/js/splats.js
  51. +1 −0 documentation/js/splices.js
  52. +1 −0 documentation/js/strings.js
  53. +1 −0 documentation/js/switch.js
  54. +1 −0 documentation/js/try.js
  55. +1 −0 documentation/js/while.js
  56. +2 −2 extras/coffee-script.js
  57. +174 −72 index.html
  58. +22 −8 lib/coffee-script/browser.js
  59. +16 −6 lib/coffee-script/cake.js
  60. +20 −8 lib/coffee-script/coffee-script.js
  61. +88 −30 lib/coffee-script/command.js
  62. +13 −5 lib/coffee-script/grammar.js
  63. +7 −3 lib/coffee-script/helpers.js
  64. +1 −1 lib/coffee-script/index.js
  65. +121 −41 lib/coffee-script/lexer.js
  66. +375 −132 lib/coffee-script/nodes.js
  67. +13 −5 lib/coffee-script/optparse.js
  68. +25 −8 lib/coffee-script/repl.js
  69. +52 −18 lib/coffee-script/rewriter.js
  70. +28 −10 lib/coffee-script/scope.js
  71. +1 −1 package.json
  72. +1 −1 src/coffee-script.coffee
  73. +1 −11 src/nodes.coffee
  74. +1 −0 src/repl.coffee
View
@@ -1,4 +1,4 @@
-Copyright (c) 2011 Jeremy Ashkenas
+Copyright (c) 2009-2012 Jeremy Ashkenas
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -1,5 +1,5 @@
###
-CoffeeScript Compiler v1.2.0
+CoffeeScript Compiler v1.3.0
Released under the MIT License
###
@@ -8,6 +8,5 @@ else
date = if friday then sue else jill
-options or= defaults
@@ -1,6 +1,7 @@
solipsism = true if mind? and not world?
-speed ?= 75
+speed = 0
+speed ?= 15
footprints = yeti ? "bear"
@@ -1,5 +1,6 @@
<!DOCTYPE html> <html> <head> <title>browser.coffee</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <link rel="stylesheet" media="all" href="docco.css" /> </head> <body> <div id="container"> <div id="background"></div> <div id="jump_to"> Jump To &hellip; <div id="jump_wrapper"> <div id="jump_page"> <a class="source" href="browser.html"> browser.coffee </a> <a class="source" href="cake.html"> cake.coffee </a> <a class="source" href="coffee-script.html"> coffee-script.coffee </a> <a class="source" href="command.html"> command.coffee </a> <a class="source" href="grammar.html"> grammar.coffee </a> <a class="source" href="helpers.html"> helpers.coffee </a> <a class="source" href="index.html"> index.coffee </a> <a class="source" href="lexer.html"> lexer.coffee </a> <a class="source" href="nodes.html"> nodes.coffee </a> <a class="source" href="optparse.html"> optparse.coffee </a> <a class="source" href="repl.html"> repl.coffee </a> <a class="source" href="rewriter.html"> rewriter.coffee </a> <a class="source" href="scope.html"> scope.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> browser.coffee </h1> </th> <th class="code"> </th> </tr> </thead> <tbody> <tr id="section-1"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-1">&#182;</a> </div> <p>Override exported methods for non-Node.js engines.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">CoffeeScript = </span><span class="nx">require</span> <span class="s1">&#39;./coffee-script&#39;</span>
-<span class="nv">CoffeeScript.require = </span><span class="nx">require</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Use standard JavaScript <code>eval</code> to eval code.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">CoffeeScript.eval = </span><span class="nf">(code, options) -&gt;</span>
+<span class="nv">CoffeeScript.require = </span><span class="nx">require</span></pre></div> </td> </tr> <tr id="section-2"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-2">&#182;</a> </div> <p>Use standard JavaScript <code>eval</code> to eval code.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">CoffeeScript.eval = </span><span class="nf">(code, options = {}) -&gt;</span>
+ <span class="nx">options</span><span class="p">.</span><span class="nx">bare</span> <span class="o">?=</span> <span class="kc">on</span>
<span class="nb">eval</span> <span class="nx">CoffeeScript</span><span class="p">.</span><span class="nx">compile</span> <span class="nx">code</span><span class="p">,</span> <span class="nx">options</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>Running code does not provide access to this scope.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">CoffeeScript.run = </span><span class="nf">(code, options = {}) -&gt;</span>
<span class="nv">options.bare = </span><span class="kc">on</span>
<span class="nb">Function</span><span class="p">(</span><span class="nx">CoffeeScript</span><span class="p">.</span><span class="nx">compile</span> <span class="nx">code</span><span class="p">,</span> <span class="nx">options</span><span class="p">)()</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>If we're not in a browser environment, we're finished with the public API.</p> </td> <td class="code"> <div class="highlight"><pre><span class="k">return</span> <span class="nx">unless</span> <span class="nb">window</span><span class="o">?</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>Load a remote script from the current domain via XHR.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">CoffeeScript.load = </span><span class="nf">(url, callback) -&gt;</span>
@@ -25,7 +25,7 @@
original directory name, when running Cake tasks from subdirectories.</p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">exports.run = </span><span class="o">-&gt;</span>
<span class="nv">global.__originalDirname = </span><span class="nx">fs</span><span class="p">.</span><span class="nx">realpathSync</span> <span class="s1">&#39;.&#39;</span>
<span class="nx">process</span><span class="p">.</span><span class="nx">chdir</span> <span class="nx">cakefileDirectory</span> <span class="nx">__originalDirname</span>
- <span class="nv">args = </span><span class="nx">process</span><span class="p">.</span><span class="nx">argv</span><span class="p">.</span><span class="nx">slice</span> <span class="mi">2</span>
+ <span class="nv">args = </span><span class="nx">process</span><span class="p">.</span><span class="nx">argv</span><span class="p">[</span><span class="mi">2</span><span class="p">..]</span>
<span class="nx">CoffeeScript</span><span class="p">.</span><span class="nx">run</span> <span class="nx">fs</span><span class="p">.</span><span class="nx">readFileSync</span><span class="p">(</span><span class="s1">&#39;Cakefile&#39;</span><span class="p">).</span><span class="nx">toString</span><span class="p">(),</span> <span class="nv">filename: </span><span class="s1">&#39;Cakefile&#39;</span>
<span class="nv">oparse = </span><span class="k">new</span> <span class="nx">optparse</span><span class="p">.</span><span class="nx">OptionParser</span> <span class="nx">switches</span>
<span class="k">return</span> <span class="nx">printTasks</span><span class="p">()</span> <span class="nx">unless</span> <span class="nx">args</span><span class="p">.</span><span class="nx">length</span>
@@ -34,7 +34,8 @@
<span class="k">catch</span> <span class="nx">e</span>
<span class="k">return</span> <span class="nx">fatalError</span> <span class="s2">&quot;#{e}&quot;</span>
<span class="nx">invoke</span> <span class="nx">arg</span> <span class="k">for</span> <span class="nx">arg</span> <span class="k">in</span> <span class="nx">options</span><span class="p">.</span><span class="nx">arguments</span></pre></div> </td> </tr> <tr id="section-9"> <td class="docs"> <div class="pilwrap"> <a class="pilcrow" href="#section-9">&#182;</a> </div> <p>Display the list of Cake tasks in a format similar to <code>rake -T</code></p> </td> <td class="code"> <div class="highlight"><pre><span class="nv">printTasks = </span><span class="o">-&gt;</span>
- <span class="nv">cakefilePath = </span><span class="nx">path</span><span class="p">.</span><span class="nx">join</span> <span class="nx">path</span><span class="p">.</span><span class="nx">relative</span><span class="p">(</span><span class="nx">__originalDirname</span><span class="p">,</span> <span class="nx">process</span><span class="p">.</span><span class="nx">cwd</span><span class="p">()),</span> <span class="s1">&#39;Cakefile&#39;</span>
+ <span class="nv">relative = </span><span class="nx">path</span><span class="p">.</span><span class="nx">relative</span> <span class="o">or</span> <span class="nx">path</span><span class="p">.</span><span class="nx">resolve</span>
+ <span class="nv">cakefilePath = </span><span class="nx">path</span><span class="p">.</span><span class="nx">join</span> <span class="nx">relative</span><span class="p">(</span><span class="nx">__originalDirname</span><span class="p">,</span> <span class="nx">process</span><span class="p">.</span><span class="nx">cwd</span><span class="p">()),</span> <span class="s1">&#39;Cakefile&#39;</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span> <span class="s2">&quot;#{cakefilePath} defines the following tasks:\n&quot;</span>
<span class="k">for</span> <span class="nx">name</span><span class="p">,</span> <span class="nx">task</span> <span class="k">of</span> <span class="nx">tasks</span>
<span class="nv">spaces = </span><span class="mi">20</span> <span class="o">-</span> <span class="nx">name</span><span class="p">.</span><span class="nx">length</span>
Oops, something went wrong.

0 comments on commit ed8d94f

Please sign in to comment.