diff --git a/docs/v1/index.html b/docs/v1/index.html index 440014b2..b6824515 100644 --- a/docs/v1/index.html +++ b/docs/v1/index.html @@ -594,18 +594,18 @@ pre .xml .cdata { Annotated Source
@@ -615,10 +615,10 @@ pre .xml .cdata {CoffeeScript is a little language that compiles into JavaScript. Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.
The golden rule of CoffeeScript is: “It’s just JavaScript”. The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable, pretty-printed, and tends to run as fast or faster than the equivalent handwritten JavaScript.
The CoffeeScript compiler goes to great lengths to generate output JavaScript that runs in every JavaScript runtime, but there are exceptions. Use generator functions, for…from, or tagged template literals only if you know that your target runtimes can support them. If you use modules, you will need to use an additional tool to resolve them.
Latest Version: 1.12.7
+Latest 1.x Version: 1.12.7
-npm install -g coffeescript
CoffeeScript 2 is coming! It adds support for ES2015 classes, async/await, JSX, object rest/spread syntax, and JavaScript generated using ES2015+ syntax. Learn more.
Upgrade to CoffeeScript 2! It adds support for ES2015 classes, async/await, JSX, object rest/spread syntax, and JavaScript generated using modern syntax. Learn more.
CoffeeScript on the left, compiled JavaScript output on the right.
@@ -741,7 +741,7 @@ cubes = (function() { ;alert(cubes);">run: cubesThe command-line version of coffee is available as a Node.js utility. The core compiler however, does not depend on Node, and can be run in any JavaScript environment, or in the browser (see Try CoffeeScript).
The command-line version of coffee is available as a Node.js utility. The core compiler however, does not depend on Node, and can be run in any JavaScript environment, or in the browser (see Try CoffeeScript).
To install, first make sure you have a working copy of the latest stable version of Node.js. You can then install CoffeeScript globally with npm:
@@ -2441,7 +2441,7 @@ task('build:parser', 'rebuild t dir = options.output || 'lib'; return fs.writeFile(dir + "/parser.js", code); }); -npm install --global coffeescriptIf you need to invoke one task before another — for example, running
+buildbeforetest, you can use theinvokefunction:invoke 'build'. Cake tasks are a minimal way to expose your CoffeeScript functions to the command line, so don’t expect any fanciness built-in. If you need dependencies, or async callbacks, it’s best to put them in your code itself — not the cake task.If you need to invoke one task before another — for example, running
buildbeforetest, you can use theinvokefunction:invoke 'build'. Cake tasks are a minimal way to expose your CoffeeScript functions to the command line, so don’t expect any fanciness built-in. If you need dependencies, or async callbacks, it’s best to put them in your code itself — not the cake task.Source Maps
@@ -2450,7 +2450,7 @@ task('build:parser', 'rebuild t“text/coffeescript” Script Tags
-While it’s not recommended for serious use, CoffeeScripts may be included directly within the browser using
+<script type="text/coffeescript">tags. The source includes a compressed and minified version of the compiler (Download current version here, 51k when gzipped) asv1/browser-compiler/coffee-script.js. Include this file on a page with inline CoffeeScript tags, and it will compile and evaluate them in order.While it’s not recommended for serious use, CoffeeScripts may be included directly within the browser using
<script type="text/coffeescript">tags. The source includes a compressed and minified version of the compiler (Download current version here, 51k when gzipped) asdocs/v1/browser-compiler/coffee-script.js. Include this file on a page with inline CoffeeScript tags, and it will compile and evaluate them in order.In fact, the little bit of glue script that runs “Try CoffeeScript” above, as well as the jQuery for the menu, is implemented in just this way. View source and look at the bottom of the page to see the example. Including the script also gives you access to
CoffeeScript.compile()so you can pop open Firebug and try compiling some strings.The usual caveats about CoffeeScript apply — your inline scripts will run within a closure wrapper, so if you want to expose global variables or functions, attach them to the
@@ -2501,7 +2501,7 @@ Usewindowobject.bin/coffeeto test your changes,
git checkout lib && bin/cake build:fullis a good command to run when you’re working on the core language. It’ll refresh thelibfolder (in case you broke something), build your altered compiler, use that to rebuild itself (a good sanity test) and then run all of the tests. If they pass, there’s a good chance you’ve made a successful change.- Browser Tests
Run CoffeeScript’s test suite in your current browser.@@ -2592,7 +2592,7 @@ The CoffeeScript logo is available in SVG for use in presentations. The browser compiler can once again be built unminified via MINIFY=false cake build:browser.The error-prone patched version of Error.prepareStackTracehas been removed.Command completion in the REPL (pressing tab to get suggestions) has been fixed for Node 6.9.1+. -The browser-based tests now include all the tests as the Node-based version. +The browser-based tests now include all the tests as the Node-based version. @@ -2611,7 +2611,7 @@ The CoffeeScript logo is available in SVG for use in presentations.
CoffeeScript now provides a for…fromsyntax for outputting ES2015for…of. (Sorry they couldn’t match, but we came up withfor…offirst for something else.) This allows iterating over generators or any other iterable object. Note that usingfor…fromin your code makes you responsible for ensuring that either your runtime supportsfor…ofor that you transpile the output JavaScript further to a version your target runtime(s) support.Triple backticks ( ```) allow the creation of embedded JavaScript blocks where escaping single backticks is not required, which should improve interoperability with ES2015 template literals and with Markdown.Within single-backtick embedded JavaScript, backticks can now be escaped via -\`.The browser tests now run in the browser again, and are accessible here if you would like to test your browser. +The browser tests now run in the browser again, and are accessible here if you would like to test your browser. CoffeeScript-only keywords in ES2015 imports andexports are now ignored.The compiler now throws an error on trying to export an anonymous class. Bugfixes related to tokens and location data, for better source maps and improved compatibility with downstream tools. @@ -3016,7 +3016,7 @@ used to parse asresult = (i for i in list)by default … it now p 0.5.2Added a compressed version of the compiler for inclusion in web pages as -
+/v1/browser-compiler/coffee-script.js. It’ll automatically run any script tags with typetext/coffeescriptfor you. Added a--stdiooption to thecoffeecommand, for piped-in compiles.browser-compiler/coffee-script.js. It’ll automatically run any script tags with typetext/coffeescriptfor you. Added a--stdiooption to thecoffeecommand, for piped-in compiles.0.5.1 @@ -3222,7 +3222,7 @@ compileSource() - +