Comparing changes
Open a pull request
|
|
Steve Howell |
split out Usage section
|
b8d60a9
|
|
|
samcday |
Added AMD support.
|
3564f51
|
|
|
samcday |
Adding updated extras/coffee-script.js
|
8a41ee9
|
|
|
jashkenas |
change_log -> changelog
|
cebfe39
|
|||
|
|
jashkenas |
whoops.
|
74501f6
|
|
|
michaelficarra |
fixes #1832: speed up `CoffeeScript.eval` in browser script
|
11544f2
|
|||
|
|
jashkenas |
Merge pull request #1839 from michaelficarra/issue1832
fixes #1832: speed up `CoffeeScript.eval` in browser script |
97d1eed
|
|||
|
|
joliss |
update link
|
6593022
|
|||
|
|
jashkenas |
Merge pull request #1845 from joliss/master
update link |
7aaaac4
|
|||
|
|
TrevorBurnham |
"Re-fs.watching files on rename event"
See discussion at #1803, #1846, and at nodejs/node-v0.x-archive#2062 |
966063d
|
|||
|
|
TrevorBurnham |
Ensuring that fs.watch duplication does not occur
|
d30aa6d
|
|
|
TrevorBurnham |
Merge pull request #1866 from TrevorBurnham/issue1862
Interface enhancements for cake (#1862) |
9e1d1f5
|
|||
|
|
TrevorBurnham |
Merging pull req #1826
|
fe78e65
|
|||
|
|
jashkenas |
Merge pull request #1851 from michaelficarra/issue1844
fixes #1844: bound functions in nested comprehensions causing empty var statements |
1e25c9d
|
|||
|
|
michaelficarra |
1e25c9d#commitcomment-719177
|
d0b8cde
|
|||
|
|
geraldalewis |
fixes #1840: invocations followed by prototype property access now co…
…rrectly compile |
a24451b
|
|||
|
|
geraldalewis |
rebuilt jison parser for 1840
|
bde1c62
|
|||
|
|
geraldalewis |
tests for 1840
|
fba69f5
|
|||
|
|
geraldalewis |
Merge branch '1840' into 1840_invocation_prototype_prop_access
|
8762e37
|
|||
|
|
jashkenas |
Merge pull request #1868 from geraldalewis/1840_invocation_prototype_…
…prop_access #1840 Invocation Prototype Prop Access |
55521a2
|
|
|
michaelficarra |
I'd rather have a long line than an orphan.
|
30614c5
|
|
|
joliss |
Use "index" for index variable in for loop
This confused me every time I Ctrl+F'ed the home page for "index" and only got this cryptic statement: "Comprehensions replace (and compile into) for loops, with optional guard clauses and the value of the current array index." Now I can see how the index is used in the code. |
57e109f
|
|||
|
|
jashkenas |
Merge pull request #1887 from joliss/index-doc
Use "index" for index variable in for loop |
03b8222
|
|||
|
|
joliss |
Document fat arrow in class definitions.
This pleasently surprised but also confused me when it worked. Now it's documented. No example (yet), alas, but better than nothing. Originally added in/around 07e66dd. |
d2c3b79
|
|||
|
|
jashkenas |
Merge pull request #1888 from joliss/fat-arrow-doc
Document fat arrow in class definitions. |
b9c17ca
|
|
|
jashkenas |
Revert "Closes #1001. Throw cannot be directly used as an expression …
…with parens, but can appear as a statement in an expression." This reverts commit 96b22a1. |
2fb6d0b
|
|||
|
|
jashkenas |
Reverting conclusion of #1001 -- Throw should be able to be used as p…
…art of an expression. |
2c92904
|
|||
|
|
jashkenas |
adding a test case for throw-as-an-expression.
|
e9e5ae1
|
|||
|
|
jashkenas |
amending the previous test
|
7d22a01
|
|
|
marijnh |
Stop treating `debugger` statements as jumps
Since in most debuggers you can continue past them. No tests added, since I wasn't sure how to test code with `debugger` in it. |
24836cc
|
|||
|
|
marijnh |
Fix bug in lexer's reserved word error message
|
26d5c99
|
|||
|
|
jashkenas |
Merge pull request #1892 from marijnh/master
Two tiny fixes |
6cb13f4
|
|||
|
|
jashkenas |
making debugger an expression.
|
35dc56d
|
|||
|
|
jashkenas |
huh.
|
b122406
|
|
|
michaelficarra |
fixes #1911: remove spacing around initial skipped comments/JS
|
0ce332e
|
|
|
ded |
jison 0.2.11 requires node v0.4 - v0.5, which in turns makes coffee-s…
…cript incompatible with node v0.6 |
5debc3c
|
|||
|
|
jashkenas |
Merge pull request #1916 from ded/patch-1
jison 0.2.11 requires node v0.4 - v0.5 |
94e17e0
|
|
|
michaelficarra |
more correct jison requirement
|
69d49e1
|
|||
|
|
michaelficarra |
Merge pull request #1697 from showell/doc-usage
split out Usage section |
8855eed
|
|
|
clutchski |
Documentation fix: s/traverse/traverseChildren/
|
0ad9d4b
|
|||
|
|
michaelficarra |
Merge pull request #1927 from clutchski/traverse-children
Documentation fix: s/traverse/traverseChildren/ |
5f1314c
|
|||
|
|
michaelficarra |
fixes #1509: compile initial comments/literals outside of safety wrapper
|
26a28ab
|
|
|
michaelficarra |
reverting to 26a28ab behaviour
This is only slightly problematic for the most pathological of cases where a prelude is followed by a set of statements, none of which generate top-level variables or attempt to return. In these cases, the non-prelude statements will be indented. See related discussion at e4b3e83. |
38b6a43
|
- +13 −5 Cakefile
- +4 −4 documentation/coffee/array_comprehensions.coffee
- +1 −1 documentation/coffee/block_comment.coffee
- +1 −0 documentation/coffee/embedded.coffee
- +2 −0 documentation/coffee/existence.coffee
- +3 −4 documentation/coffee/heredocs.coffee
- +3 −0 documentation/coffee/interpolation.coffee
- +2 −0 documentation/coffee/multiple_return_values.coffee
- +1 −0 documentation/coffee/object_extraction.coffee
- +3 −0 documentation/coffee/parallel_assignment.coffee
- +2 −0 documentation/coffee/patterns_and_splats.coffee
- +2 −0 documentation/coffee/splices.coffee
- +3 −3 documentation/docs/browser.html
- +19 −12 documentation/docs/cake.html
- +14 −13 documentation/docs/coffee-script.html
- +153 −83 documentation/docs/command.html
- +86 −84 documentation/docs/grammar.html
- +9 −9 documentation/docs/helpers.html
- +40 −40 documentation/docs/lexer.html
- +383 −359 documentation/docs/nodes.html
- +14 −14 documentation/docs/optparse.html
- +9 −9 documentation/docs/repl.html
- +89 −52 documentation/docs/rewriter.html
- +19 −19 documentation/docs/scope.html
- +78 −78 documentation/docs/underscore.html
- +46 −8 documentation/index.html.erb
- +5 −5 documentation/js/array_comprehensions.js
- +1 −3 documentation/js/block_comment.js
- +9 −8 documentation/js/classes.js
- +1 −1 documentation/js/heredocs.js
- +2 −2 documentation/js/overview.js
- +2 −2 documentation/js/patterns_and_splats.js
- +2 −2 documentation/js/splats.js
- +2 −2 extras/coffee-script.js
- +112 −59 index.html
- +16 −6 lib/coffee-script/cake.js
- +6 −4 lib/coffee-script/coffee-script.js
- +226 −94 lib/coffee-script/command.js
- +7 −3 lib/coffee-script/grammar.js
- +5 −6 lib/coffee-script/lexer.js
- +150 −117 lib/coffee-script/nodes.js
- +168 −164 lib/coffee-script/parser.js
- +49 −36 lib/coffee-script/rewriter.js
- +7 −7 lib/coffee-script/scope.js
- +3 −3 package.json
- +15 −8 src/cake.coffee
- +4 −3 src/coffee-script.coffee
- +158 −72 src/command.coffee
- +4 −2 src/grammar.coffee
- +5 −5 src/lexer.coffee
- +49 −27 src/nodes.coffee
- +64 −27 src/rewriter.coffee
- +6 −6 src/scope.coffee
- +6 −0 test/assignment.coffee
- +67 −0 test/classes.coffee
- +3 −0 test/compilation.coffee
- +7 −0 test/comprehensions.coffee
- +12 −0 test/control_flow.coffee
- +20 −19 test/eval.coffee
- +12 −0 test/function_invocation.coffee
- +8 −0 test/functions.coffee
- +15 −1 test/objects.coffee
- +6 −0 test/operators.coffee
| @@ -104,11 +104,19 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser', | ||
| }; | ||
| """ | ||
| code = """ | ||
| - this.CoffeeScript = function() { | ||
| - function require(path){ return require[path]; } | ||
| - #{code} | ||
| - return require['./coffee-script'] | ||
| - }() | ||
| + (function(root) { | ||
| + var CoffeeScript = function() { | ||
| + function require(path){ return require[path]; } | ||
| + #{code} | ||
| + return require['./coffee-script']; | ||
| + }(); | ||
| + | ||
| + if (typeof define === 'function' && define.amd) { | ||
| + define(function() { return CoffeeScript; }); | ||
| + } else { | ||
| + root.CoffeeScript = CoffeeScript; | ||
| + } | ||
| + }(this)); | ||
| """ | ||
| unless process.env.MINIFY is 'false' | ||
| {parser, uglify} = require 'uglify-js' | ||
| @@ -1,10 +1,10 @@ | ||
| # Eat lunch. | ||
| eat food for food in ['toast', 'cheese', 'wine'] | ||
| -# Fine dining | ||
| -courses = ['salad', 'entree', 'dessert'] | ||
| -menu course + 1, dish for dish, course in courses | ||
| +# Fine five course dining. | ||
| +courses = ['greens', 'caviar', 'truffles', 'roast', 'cake'] | ||
| +menu i + 1, dish for dish, i in courses | ||
| -# Health conscious meal | ||
| +# Health conscious meal. | ||
| foods = ['broccoli', 'spinach', 'chocolate'] | ||
| eat food for food in foods when food isnt 'chocolate' |
| @@ -1,5 +1,5 @@ | ||
| ### | ||
| -CoffeeScript Compiler v1.1.3 | ||
| +CoffeeScript Compiler v1.2.0 | ||
| Released under the MIT License | ||
| ### | ||
| @@ -3,3 +3,4 @@ hi = `function() { | ||
| }` | ||
| + | ||
| @@ -8,3 +8,5 @@ footprints = yeti ? "bear" | ||
| + | ||
| + | ||
| @@ -1,7 +1,6 @@ | ||
| -html = ''' | ||
| +html = """ | ||
| <strong> | ||
| cup of coffeescript | ||
| </strong> | ||
| - ''' | ||
| - | ||
| - | ||
| + """ | ||
| + |
| @@ -4,3 +4,6 @@ quote = "A picture is a fact. -- #{ author }" | ||
| sentence = "#{ 22 / 7 } is a decent approximation of π" | ||
| + | ||
| + | ||
| + | ||
| @@ -5,3 +5,5 @@ weatherReport = (location) -> | ||
| [city, temp, forecast] = weatherReport "Berkeley, CA" | ||
| + | ||
| + | ||
| @@ -11,3 +11,4 @@ futurists = | ||
| {poet: {name, address: [street, city]}} = futurists | ||
| + | ||
| @@ -4,3 +4,6 @@ theSwitch = 0 | ||
| [theBait, theSwitch] = [theSwitch, theBait] | ||
| + | ||
| + | ||
| + | ||
| @@ -5,3 +5,5 @@ tag = "<impossible>" | ||
| + | ||
| + | ||
| @@ -3,3 +3,5 @@ numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | ||
| numbers[3..6] = [-3, -4, -5, -6] | ||
| + | ||
| + | ||
| @@ -1,8 +1,8 @@ | ||
| <!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 … <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">¶</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">'./coffee-script'</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">¶</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="p">(</span><span class="nx">code</span><span class="p">,</span> <span class="nx">options</span><span class="p">)</span> <span class="o">-></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">¶</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="p">(</span><span class="nx">code</span><span class="p">,</span> <span class="nv">options = </span><span class="p">{})</span> <span class="o">-></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">¶</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) -></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">¶</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 = {}) -></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">¶</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">¶</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="p">(</span><span class="nx">url</span><span class="p">,</span> <span class="nx">callback</span><span class="p">)</span> <span class="o">-></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">¶</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">¶</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) -></span> | ||
| <span class="nv">xhr = </span><span class="k">new</span> <span class="p">(</span><span class="nb">window</span><span class="p">.</span><span class="nx">ActiveXObject</span> <span class="o">or</span> <span class="nx">XMLHttpRequest</span><span class="p">)(</span><span class="s1">'Microsoft.XMLHTTP'</span><span class="p">)</span> | ||
| <span class="nx">xhr</span><span class="p">.</span><span class="nx">open</span> <span class="s1">'GET'</span><span class="p">,</span> <span class="nx">url</span><span class="p">,</span> <span class="kc">true</span> | ||
| <span class="nx">xhr</span><span class="p">.</span><span class="nx">overrideMimeType</span> <span class="s1">'text/plain'</span> <span class="k">if</span> <span class="s1">'overrideMimeType'</span> <span class="k">of</span> <span class="nx">xhr</span> | ||
Showing you all comments on commits in this comparison.
|
Come on, you're going to wrap this string for one variable? We have a name for these and they're not very popular. |
|
Mm, I don't like the |
|
|
@satyr: thanks. @michaelficarra: Want to fix this? |
|
@satyr: Ah, I thought I remembered this issue being more difficult. Which nodes other than |
|
This is a nice feature, but perhaps the implementation could be cleaned up a bit... Can we extract this into a |
|
What? I don't see anything wrong with how it was working. And now it no longer omits the safety wrapper when there's no top-level variables and no top-level returns. |
|
I'd be glad to put it back in, if we can get the formatting correct. As it stood, because it was guessing the indentation (the "we assume" comment), all output code that the optimization touched looked like this: foo bar
foo bazfoo(bar);
foo(baz); |
|
Well it certainly isn't working correctly now.
Pull request coming shortly. |
|
|