Comparing changes
Open a pull request
|
|
jashkenas |
adding a link to the high-rez logo
|
9d4dc09
|
|
|
jashkenas |
adding a rel=canonical
|
3fc0e6b
|
|
|
jashkenas |
Merge branch 'master' into gh-pages
|
b4af24b
|
|
|
jashkenas |
Merge branch 'master' into gh-pages
|
1cba2e2
|
|
|
jashkenas |
Fixes #2577 -- better instructions for installing master
|
caed958
|
|
|
jashkenas |
Merge branch 'master' into gh-pages
|
be65807
|
|
|
jashkenas |
Adding new coffeescript book per request
|
e7f72c9
|
|||
|
|
jashkenas |
Merge branch 'master' into gh-pages
|
39a05b7
|
|
|
spinda |
Prevent repl from crashing on error [Fixes #2716]
Move execution of the compiled code inside the try/catch block:
try
js = CoffeeScript.compile "_=(#{input}\n)", {filename, bare: yes}
catch err
cb err
> cb null, vm.runInContext(js, context, filename)
try
js = CoffeeScript.compile "_=(#{input}\n)", {filename, bare: yes}
> cb null, vm.runInContext(js, context, filename)
catch err
cb err |
This user has not uploaded their public key yet.
GPG key ID: 74223E91A6ACAFA2
Learn about signing commits
|
deaa31d
|
||
|
|
spinda |
Fix repl handling of blank line
Since the move to the nodeREPL package, input lines to be evaluated are
now wrapped in parentheses; that is:
'foo'
would become:
('foo'
)
The old way of detecting empty lines was to see if the input string was
either totally empty, or whitespace-only. The addition of these
parentheses breaks that.
In order to fix this, we simply tweak the regex a little to ignore these
added parentheses if they're present. As an added bonus, the regex
should match empty inputs even if they aren't.
This also makes the "empty command evaluates to undefined" test pass,
for the right reasons (i.e. not because of the broken error behavior
from before). |
This user has not uploaded their public key yet.
GPG key ID: 74223E91A6ACAFA2
Learn about signing commits
|
ff1ddd0
|
||
|
|
Michael Smith |
Use blank line regex from Redux
|
5698e42
|
|||
|
|
michaelficarra |
Merge pull request #2725 from mintplant/repl-fix
Fix REPL crashing on execution error |
965237e
|
|||
|
|
jwalton |
Compile to an array of CodeFragments instead of to a giant string.
|
541ab83
|
|
|
troels |
Improve the handling of implicit object and implicit call combinations
by handling them together. |
1666716
|
|
|
jashkenas |
Fixes #2721, super outside of classes with extends for instance methods.
|
6b79af2
|
|||
|
|
jashkenas |
Fixes #2721 -- show error message for naked super
|
5dea70b
|
|||
|
|
surjikal |
Fixed key name in source map, added coffee file to map sources
These are the modifications I had to do in order to get source maps working in 27.0.1425.2 (Official Build 185250) canary. I haven't tested other browsers. I first looked at the V3 spec and a few examples, and I saw that the `source` key of the source map should be called `sources`. After doing the `source` to `sources` change, the coffee source and for some odd reason the javascript file would not show up in the browser dev tools (it was being fetched but not evaluated). To fix this, I had to add the coffee source to the `sources` list in the source map file. |
88e0232
|
|||
|
|
jwalton |
Merge branch 'master' into sourcemaps
Conflicts: lib/coffee-script/coffee-script.js lib/coffee-script/nodes.js src/nodes.coffee |
0d6d479
|
|||
|
|
jwalton |
Merge branch 'sourcemaps' of https://github.com/surjikal/coffee-script …
…into sourcemaps |
0e718f0
|
|||
|
|
jwalton |
Fix generated file name in v3 source map
|
51fe417
|
|||
|
|
jwalton |
Minor API clean up, and make it so sourcemaps are pretty-printed to t…
…he .map file. |
8445499
|
|||
|
|
jwalton |
Optionally allow replacement of existing mappings in SourceMap#addMap…
…ping(). |
ea86e3e
|
|||
|
|
jwalton |
Fix from code inspect: Use "not" instead of "!".
|
d626e70
|
|||
|
|
jwalton |
Change compileWithSourceMap() so it returns an object instead of an A…
…rray, and return the SourceMap object. |
ad0306b
|
|||
|
|
jwalton |
Change some more "!"s to "not"s. Make spacing consistent after period…
…s in commnets. |
ad7dcbc
|
|||
|
|
marchaefner |
Fix line numbers when first line is indented.
* Offset @chunkLine for inserted line break. * Avoid line break insertion for blank lines. |
3c38a34
|
- +11 −9 Cakefile
- +1 −1 documentation/coffee/block_comment.coffee
- +5 −3 documentation/css/docs.css
- +10 −7 documentation/docs/browser.html
- +1 −1 documentation/docs/cake.html
- +58 −18 documentation/docs/coffee-script.html
- +51 −34 documentation/docs/command.html
- +37 −37 documentation/docs/grammar.html
- +9 −2 documentation/docs/helpers.html
- +1 −1 documentation/docs/index.html
- +15 −15 documentation/docs/lexer.html
- +505 −389 documentation/docs/nodes.html
- +1 −1 documentation/docs/optparse.html
- +3 −3 documentation/docs/repl.html
- +185 −123 documentation/docs/rewriter.html
- +155 −0 documentation/docs/sourcemap.html
- BIN documentation/images/logo.png
- +81 −11 documentation/index.html.erb
- +1 −1 documentation/js/aliases.js
- +1 −1 documentation/js/array_comprehensions.js
- +2 −2 documentation/js/block_comment.js
- +1 −1 documentation/js/cake_tasks.js
- +3 −3 documentation/js/classes.js
- +1 −1 documentation/js/comparisons.js
- +1 −1 documentation/js/conditionals.js
- +1 −1 documentation/js/default_args.js
- +1 −1 documentation/js/do.js
- +1 −1 documentation/js/embedded.js
- +1 −1 documentation/js/existence.js
- +1 −1 documentation/js/expressions.js
- +1 −1 documentation/js/expressions_assignment.js
- +1 −1 documentation/js/expressions_comprehension.js
- +1 −1 documentation/js/expressions_try.js
- +1 −1 documentation/js/fat_arrow.js
- +1 −1 documentation/js/functions.js
- +1 −1 documentation/js/heredocs.js
- +1 −1 documentation/js/heregexes.js
- +1 −1 documentation/js/interpolation.js
- +1 −1 documentation/js/multiple_return_values.js
- +1 −1 documentation/js/object_comprehensions.js
- +1 −1 documentation/js/object_extraction.js
- +1 −1 documentation/js/objects_and_arrays.js
- +1 −1 documentation/js/objects_reserved.js
- +1 −1 documentation/js/overview.js
- +1 −1 documentation/js/parallel_assignment.js
- +1 −1 documentation/js/patterns_and_splats.js
- +1 −1 documentation/js/prototypes.js
- +1 −1 documentation/js/range_comprehensions.js
- +1 −1 documentation/js/scope.js
- +1 −1 documentation/js/slices.js
- +1 −1 documentation/js/soaks.js
- +1 −1 documentation/js/splats.js
- +1 −1 documentation/js/splices.js
- +1 −1 documentation/js/strings.js
- +1 −1 documentation/js/switch.js
- +1 −1 documentation/js/try.js
- +1 −1 documentation/js/while.js
- +5 −5 extras/coffee-script.js
- +88 −18 index.html
- +20 −11 lib/coffee-script/browser.js
- +1 −1 lib/coffee-script/cake.js
- +67 −25 lib/coffee-script/coffee-script.js
- +61 −50 lib/coffee-script/command.js
- +36 −35 lib/coffee-script/grammar.js
- +27 −1 lib/coffee-script/helpers.js
- +1 −1 lib/coffee-script/index.js
- +15 −9 lib/coffee-script/lexer.js
- +497 −408 lib/coffee-script/nodes.js
- +1 −1 lib/coffee-script/optparse.js
- +146 −147 lib/coffee-script/parser.js
- +4 −4 lib/coffee-script/repl.js
- +217 −120 lib/coffee-script/rewriter.js
- +3 −2 lib/coffee-script/scope.js
- +237 −0 lib/coffee-script/sourcemap.js
- +1 −1 package.json
- +9 −6 src/browser.coffee
- +56 −14 src/coffee-script.coffee
- +49 −32 src/command.coffee
- +35 −35 src/grammar.coffee
- +16 −0 src/helpers.coffee
- +13 −13 src/lexer.coffee
- +427 −300 src/nodes.coffee
- +2 −2 src/repl.coffee
- +235 −118 src/rewriter.coffee
- +1 −1 src/scope.litcoffee
- +246 −0 src/sourcemap.coffee
- +78 −34 test/classes.coffee
- +0 −1 test/control_flow.coffee
- +21 −5 test/exception_handling.coffee
- +93 −2 test/function_invocation.coffee
- +20 −0 test/location.coffee
- +136 −3 test/objects.coffee
- +3 −1 test/operators.coffee
- +46 −0 test/sourcemap.coffee
| @@ -1,8 +1,8 @@ | ||
| fs = require 'fs' | ||
| path = require 'path' | ||
| -{extend} = require './lib/coffee-script/helpers' | ||
| CoffeeScript = require './lib/coffee-script' | ||
| {spawn, exec} = require 'child_process' | ||
| +helpers = require './lib/coffee-script/helpers' | ||
| # ANSI Terminal Colors. | ||
| bold = red = green = reset = '' | ||
| @@ -23,6 +23,12 @@ header = """ | ||
| */ | ||
| """ | ||
| +# Build the CoffeeScript language from source. | ||
| +build = (cb) -> | ||
| + files = fs.readdirSync 'src' | ||
| + files = ('src/' + file for file in files when file.match(/\.(lit)?coffee$/)) | ||
| + run ['-c', '-o', 'lib/coffee-script'].concat(files), cb | ||
| + | ||
| # Run a CoffeeScript through our node/coffee interpreter. | ||
| run = (args, cb) -> | ||
| proc = spawn 'node', ['bin/coffee'].concat(args) | ||
| @@ -57,11 +63,7 @@ task 'install', 'install CoffeeScript into /usr/local (or --prefix)', (options) | ||
| ) | ||
| -task 'build', 'build the CoffeeScript language from source', build = (cb) -> | ||
| - files = fs.readdirSync 'src' | ||
| - files = ('src/' + file for file in files when file.match(/\.(lit)?coffee$/)) | ||
| - run ['-c', '-o', 'lib/coffee-script'].concat(files), cb | ||
| - | ||
| +task 'build', 'build the CoffeeScript language from source', build | ||
| task 'build:full', 'rebuild the source twice, and run the tests', -> | ||
| build -> | ||
| @@ -77,7 +79,7 @@ task 'build:full', 'rebuild the source twice, and run the tests', -> | ||
| task 'build:parser', 'rebuild the Jison parser (run build first)', -> | ||
| - extend global, require('util') | ||
| + helpers.extend global, require('util') | ||
| require 'jison' | ||
| parser = require('./lib/coffee-script/grammar').parser | ||
| fs.writeFile 'lib/coffee-script/parser.js', parser.generate() | ||
| @@ -91,7 +93,7 @@ task 'build:ultraviolet', 'build and install the Ultraviolet syntax highlighter' | ||
| task 'build:browser', 'rebuild the merged script for inclusion in the browser', -> | ||
| code = '' | ||
| - for name in ['helpers', 'rewriter', 'lexer', 'parser', 'scope', 'nodes', 'coffee-script', 'browser'] | ||
| + for name in ['helpers', 'rewriter', 'lexer', 'parser', 'scope', 'nodes', 'sourcemap', 'coffee-script', 'browser'] | ||
| code += """ | ||
| require['./#{name}'] = new function() { | ||
| var exports = this; | ||
| @@ -223,7 +225,7 @@ runTests = (CoffeeScript) -> | ||
| # Run every test in the `test` folder, recording failures. | ||
| files = fs.readdirSync 'test' | ||
| for file in files when file.match /\.(lit)?coffee$/i | ||
| - literate = path.extname(file) is '.litcoffee' | ||
| + literate = helpers.isLiterate file | ||
| currentFile = filename = path.join 'test', file | ||
| code = fs.readFileSync filename | ||
| try | ||
| @@ -1,5 +1,5 @@ | ||
| ### | ||
| -CoffeeScript Compiler v1.5.0 | ||
| +CoffeeScript Compiler v1.6.1 | ||
| Released under the MIT License | ||
| ### | ||
| @@ -147,11 +147,13 @@ div.code { | ||
| } | ||
| #logo { | ||
| display: block; | ||
| - width: 225px; height: 50px; | ||
| - background: url('../images/logo.png'); | ||
| + outline: none; | ||
| position: absolute; | ||
| top: 0px; left: 10px; | ||
| } | ||
| + #logo img { | ||
| + margin: 5px 0 0 3px; | ||
| + } | ||
| #error { | ||
| position: absolute; | ||
| -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; | ||
| @@ -380,4 +382,4 @@ div.code { | ||
| box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none; | ||
| background-image: url(../images/button_bg_dark.gif); | ||
| text-shadow: none; | ||
| - } | ||
| + } | ||
| @@ -1,4 +1,4 @@ | ||
| -<!DOCTYPE html> <html> <head> <title>cake.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> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> cake.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><code>cake</code> is a simplified version of <a href="http://www.gnu.org/software/make/">Make</a> | ||
| +<!DOCTYPE html> <html> <head> <title>cake.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="sourcemap.html"> sourcemap.coffee </a> </div> </div> </div> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="docs"> <h1> cake.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><code>cake</code> is a simplified version of <a href="http://www.gnu.org/software/make/">Make</a> | ||
| (<a href="http://rake.rubyforge.org/">Rake</a>, <a href="http://github.com/280north/jake">Jake</a>) | ||
| for CoffeeScript. You define tasks with names and descriptions in a Cakefile, | ||
| and can call them from the command line, or invoke them from other tasks.</p> | ||
Showing you all comments on commits in this comparison.
|
|
@epidemian's I think |
|
LOL. Yep, the issue number referenced in this commit, #2721, is actually a PR with the same change xD In that PR i also noted that, while it fixed the error message for |
|
Simply reversing the compilation order revisits the issue in reverse:
|
|
Yep, this is a bad fix. The condition should always be evaluated first. But it should ideally be aware of hoisting of declarations within its body. |
|
We only add two lines if we're adding a header and adding the sourceMapURL line. These are both added conditionally, so we should probably set this to 0, 1, or 2 conditionally, as well. |
|
And one more if the file is starting with a whitespace |
|
Or, actually, what would be even better would be to make it so if header is false, or if -m wasn't provided, we add a blank line for each. That way a "-c", a "-m", and a "-c -m" would all produce the same output. |
|
But then we have nasty blank lines ;) Really what we need is a nice test case ensuring that the line numbers match up in a relatively complex file, compiled with different options. 10 points to whoever wants to whip one up. |
|
The problem is, as things stand, you can generate just a map without a js file by just providing "-m". So, if you make just a map file, should it assume that the sourceMapURL is going to be there or not? Actually... According to the v3 specs:
So, really, we should put the sourceMappingURL at the bottom of the file, which fixes all of these problems. :) |
Hiya! I just skimmed the latest CS changelog and was curious about this change. The example in your above comment is a bit abstract, and I was hoping if you could help me understand. In your example, is the intended flow of the last line of code (
Also, how are these method calls scoped? (Instance-level? “Class” level? …Something else?) |
|
Sweet. Is there a vector version of the coffeescript logo somewhere yet? If not, I'll probably end up crafting one based on the above, one of these days. |
|
Should this be |