From d7e096aeee82323f96d61a6d7c4e8c1c176660c6 Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Mon, 17 Apr 2017 19:43:22 -0700 Subject: [PATCH] [CS2] Fix links in v2 docs (#4506) * Update 2.0.0-beta1 docs * Fix broken links, update redirected links * Rebuild v2 docs with updated links * A few more fixed links --- README.md | 4 +- docs/v1/annotated-source/cake.html | 2 +- docs/v1/annotated-source/grammar.html | 10 +-- docs/v1/annotated-source/lexer.html | 2 +- docs/v1/annotated-source/nodes.html | 2 +- docs/v1/annotated-source/sourcemap.html | 2 +- docs/v1/index.html | 97 +++++++++++++------------ docs/v2/annotated-source/cake.html | 2 +- docs/v2/annotated-source/grammar.html | 10 +-- docs/v2/annotated-source/lexer.html | 2 +- docs/v2/annotated-source/nodes.html | 2 +- docs/v2/annotated-source/sourcemap.html | 2 +- docs/v2/index.html | 61 ++++++++-------- documentation/sections/books.md | 12 +-- documentation/sections/changelog.md | 12 +-- documentation/sections/comparisons.md | 2 +- documentation/sections/examples.md | 3 +- documentation/sections/fat_arrow.md | 5 ++ documentation/sections/installation.md | 4 +- documentation/sections/introduction.md | 2 +- documentation/sections/literate.md | 2 +- documentation/sections/modules.md | 2 + documentation/sections/operators.md | 2 +- documentation/sections/resources.md | 10 +-- documentation/sections/screencasts.md | 4 +- documentation/sections/scripts.md | 2 +- documentation/sections/source_maps.md | 2 +- documentation/v1/body.html | 24 +++--- src/cake.coffee | 2 +- src/grammar.coffee | 10 +-- src/lexer.coffee | 2 +- src/nodes.coffee | 2 +- src/sourcemap.litcoffee | 2 +- 33 files changed, 157 insertions(+), 147 deletions(-) diff --git a/README.md b/README.md index e4b71cee..4b85bc6d 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ coffee -c /path/to/script.coffee For documentation, usage, and examples, see: http://coffeescript.org/ -To suggest a feature or report a bug: http://github.com/jashkenas/coffeescript/issues +To suggest a feature or report a bug: https://github.com/jashkenas/coffeescript/issues If you’d like to chat, drop by #coffeescript on Freenode IRC. @@ -54,4 +54,4 @@ The source repository: https://github.com/jashkenas/coffeescript.git Changelog: http://coffeescript.org/#changelog -Our lovely and talented contributors are listed here: http://github.com/jashkenas/coffeescript/contributors +Our lovely and talented contributors are listed here: https://github.com/jashkenas/coffeescript/contributors diff --git a/docs/v1/annotated-source/cake.html b/docs/v1/annotated-source/cake.html index 98f29fb1..c085fcaf 100644 --- a/docs/v1/annotated-source/cake.html +++ b/docs/v1/annotated-source/cake.html @@ -116,7 +116,7 @@

cake is a simplified version of Make -(Rake, Jake) +(Rake, Jake) 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.

Running cake with no arguments will print out a list of all the tasks in the diff --git a/docs/v1/annotated-source/grammar.html b/docs/v1/annotated-source/grammar.html index eb724d82..ab1f3ad1 100644 --- a/docs/v1/annotated-source/grammar.html +++ b/docs/v1/annotated-source/grammar.html @@ -115,17 +115,17 @@

-

The CoffeeScript parser is generated by Jison +

The CoffeeScript parser is generated by Jison from this grammar file. Jison is a bottom-up parser generator, similar in style to Bison, implemented in JavaScript. -It can recognize LALR(1), LR(0), SLR(1), and LR(1) +It can recognize LALR(1), LR(0), SLR(1), and LR(1) type grammars. To create the Jison parser, we list the pattern to match on the left-hand side, and the action to take (usually the creation of syntax tree nodes) on the right. As the parser runs, it shifts tokens from our token stream, from left to right, and -attempts to match +attempts to match the token sequence against the rules below. When a match can be made, it -reduces into the nonterminal +reduces into the nonterminal (the enclosing name at the top), and we proceed from there.

If you run the cake build:parser command, Jison constructs a parse table from our rules and saves it into lib/parser.js.

@@ -199,7 +199,7 @@ wrapper and just returning the value directly.

Our handy DSL for Jison grammar generation, thanks to -Tim Caswell. For every rule in the grammar, +Tim Caswell. For every rule in the grammar, we pass the pattern-defining string, the action to run, and extra options, optionally. If no action is specified, we simply pass the value of the previous nonterminal.

diff --git a/docs/v1/annotated-source/lexer.html b/docs/v1/annotated-source/lexer.html index 6ae28040..bd843b65 100644 --- a/docs/v1/annotated-source/lexer.html +++ b/docs/v1/annotated-source/lexer.html @@ -121,7 +121,7 @@ a token is produced, we consume the match, and start again. Tokens are in the form:

[tag, value, locationData]
 

where locationData is {first_line, first_column, last_line, last_column}, which is a -format that can be fed directly into Jison. These +format that can be fed directly into Jison. These are read by jison in the parser.lexer function defined in coffee-script.coffee.

diff --git a/docs/v1/annotated-source/nodes.html b/docs/v1/annotated-source/nodes.html index 22f350c2..f980a12c 100644 --- a/docs/v1/annotated-source/nodes.html +++ b/docs/v1/annotated-source/nodes.html @@ -3941,7 +3941,7 @@ CoffeeScript operations into their JavaScript equivalents.

Am I capable of -Python-style comparison chaining?

+Python-style comparison chaining?

diff --git a/docs/v1/annotated-source/sourcemap.html b/docs/v1/annotated-source/sourcemap.html index 67525c1b..4b9ac673 100644 --- a/docs/v1/annotated-source/sourcemap.html +++ b/docs/v1/annotated-source/sourcemap.html @@ -406,7 +406,7 @@ column for the current line:

Note that SourceMap VLQ encoding is “backwards”. MIDI-style VLQ encoding puts the most-significant-bit (MSB) from the original value into the MSB of the VLQ -encoded value (see Wikipedia). +encoded value (see Wikipedia). SourceMap VLQ does things the other way around, with the least significat four bits of the original value encoded into the first byte of the VLQ encoded value.

diff --git a/docs/v1/index.html b/docs/v1/index.html index 22c352bd..de27322e 100644 --- a/docs/v1/index.html +++ b/docs/v1/index.html @@ -591,18 +591,18 @@ pre .xml .cdata { Annotated Source @@ -612,7 +612,7 @@ 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.5

+

Latest Version: 1.12.5

npm install -g coffee-script
 

CoffeeScript 2 is coming! It adds support for ES2015 classes, async/await, and generates JavaScript using ES2015+ syntax. Learn more.

@@ -738,8 +738,8 @@ cubes = (function() { ;alert(cubes);">run: cubes

Installation

-

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:

+

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:

npm install --global coffee-script
 

When you need CoffeeScript as a dependency of a project, within that project’s folder you can install it locally:

@@ -842,8 +842,7 @@ cubes = (function() {

Literate CoffeeScript

Besides being used as an ordinary programming language, CoffeeScript may also be written in “literate” mode. If you name your file with a .litcoffee extension, you can write it as a Markdown document — a document that also happens to be executable CoffeeScript code. The compiler will treat any indented blocks (Markdown’s way of indicating source code) as code, and ignore the rest as comments.

-

Just for kicks, a little bit of the compiler is currently implemented in this fashion: See it as a document, raw, and properly highlighted in a text editor.

-

I’m fairly excited about this direction for the language, and am looking forward to writing (and more importantly, reading) more programs in this style. More information about Literate CoffeeScript, including an example program, are available in this blog post.

+

Just for kicks, a little bit of the compiler is currently implemented in this fashion: See it as a document, raw, and properly highlighted in a text editor.

Language Reference

@@ -1470,7 +1469,7 @@ alert((function() {

unless can be used as the inverse of if.

As a shortcut for this.property, you can use @property.

You can use in to test for array presence, and of to test for JavaScript object-key presence.

-

To simplify math expressions, ** can be used for exponentiation and // performs integer division. % works just like in JavaScript, while %% provides “dividend dependent modulo”:

+

To simplify math expressions, ** can be used for exponentiation and // performs integer division. % works just like in JavaScript, while %% provides “dividend dependent modulo”:

-7 % 5 == -2 # The remainder of 7 / 5
 -7 %% 5 == 3 # n %% 5 is always between 0 and 4
 
@@ -1625,7 +1624,7 @@ zip = typeof lottery.drawWinner === 
       

Classes, Inheritance, and Super

-

JavaScript’s prototypal inheritance has always been a bit of a brain-bender, with a whole family tree of libraries that provide a cleaner syntax for classical inheritance on top of JavaScript’s prototypes: Base2, Prototype.js, JS.Class, etc. The libraries provide syntactic sugar, but the built-in inheritance would be completely usable if it weren’t for a couple of small exceptions: it’s awkward to call super (the prototype object’s implementation of the current function), and it’s awkward to correctly set the prototype chain.

+

JavaScript’s prototypal inheritance has always been a bit of a brain-bender, with a whole family tree of libraries that provide a cleaner syntax for classical inheritance on top of JavaScript’s prototypes: Base2, Prototype.js, JS.Class, etc. The libraries provide syntactic sugar, but the built-in inheritance would be completely usable if it weren’t for a couple of small exceptions: it’s awkward to call super (the prototype object’s implementation of the current function), and it’s awkward to correctly set the prototype chain.

Instead of repetitively attaching functions to a prototype, CoffeeScript provides a basic class structure that allows you to name your class, set the superclass, assign prototypal properties, and define the constructor, in a single assignable expression.

Constructor functions are named, to better support helpful stack traces. In the first class in the example below, this.constructor.name is "Animal".

class Animal
@@ -1950,6 +1949,7 @@ Account = function(
load

If we had used -> in the callback above, @customer would have referred to the undefined “customer” property of the DOM element, and trying to call purchase() on it would have raised an exception.

When used in a class definition, methods declared with the fat arrow will be automatically bound to each instance of the class when the instance is constructed.

+

CoffeeScript functions also support ES2015 generator functions through the yield keyword. There’s no function*(){} nonsense — a generator in CoffeeScript is simply a function that yields.

perfectSquares = ->
   num = 0
@@ -1984,6 +1984,7 @@ perfectSquares = function*() {
 
 window.ps || (window.ps = perfectSquares());
 ;alert(ps.next().value);">run: ps.next().value

yield* is called yield from, and yield return may be used if you need to force a generator that doesn’t yield.

+

You can iterate over a generator function using for…from.

fibonacci = ->
   [previous, current] = [1, 1]
@@ -2184,7 +2185,7 @@ grade = (function(
load

Chained Comparisons

-

CoffeeScript borrows chained comparisons from Python — making it easy to test if a value falls within a certain range.

+

CoffeeScript borrows chained comparisons from Python — making it easy to test if a value falls within a certain range.

cholesterol = 127
 
 healthy = 200 > cholesterol > 60
@@ -2405,7 +2406,8 @@ OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>&g
   max,
   min
 } from 'underscore';
-
load

Note that the CoffeeScript compiler does not resolve modules; writing an import or export statement in CoffeeScript will produce an import or export statement in the resulting output. It is your responsibility attach another transpiler, such as Traceur Compiler, Babel or Rollup, to convert this ES2015 syntax into code that will work in your target runtimes.

+
load

+

Note that the CoffeeScript compiler does not resolve modules; writing an import or export statement in CoffeeScript will produce an import or export statement in the resulting output. It is your responsibility attach another transpiler, such as Traceur Compiler, Babel or Rollup, to convert this ES2015 syntax into code that will work in your target runtimes.

Also note that any file with an import or export statement will be output without a top-level function safety wrapper; in other words, importing or exporting modules will automatically trigger bare mode for that file. This is because per the ES2015 spec, import or export statements must occur at the topmost scope.

@@ -2434,16 +2436,16 @@ task('build:parser', 'rebuild t dir = options.output || 'lib'; return fs.writeFile(dir + "/parser.js", code); }); -
load

If you need to invoke one task before another — for example, running build before test, you can use the invoke function: 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.

+
load

If you need to invoke one task before another — for example, running build before test, you can use the invoke function: 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

CoffeeScript 1.6.1 and above include support for generating source maps, a way to tell your JavaScript engine what part of your CoffeeScript program matches up with the code being evaluated. Browsers that support it can automatically use source maps to show your original source code in the debugger. To generate source maps alongside your JavaScript files, pass the --map or -m flag to the compiler.

-

For a full introduction to source maps, how they work, and how to hook them up in your browser, read the HTML5 Tutorial.

+

For a full introduction to source maps, how they work, and how to hook them up in your browser, read the HTML5 Tutorial.

“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) as 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.

+

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) as 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 window object.

@@ -2451,22 +2453,22 @@ task('build:parser', 'rebuild t

Books

There are a number of excellent resources to help you get started with CoffeeScript, some of which are freely available online.

Screencasts

@@ -2474,10 +2476,9 @@ task('build:parser', 'rebuild t

Examples

The best list of open-source CoffeeScript examples can be found on GitHub. But just to throw out a few more:

    -
  • GitHub’s Hubot, a friendly IRC robot that can perform any number of useful and useless tasks.
  • +
  • GitHub’s Hubot, a friendly IRC robot that can perform any number of useful and useless tasks.
  • sstephenson’s Pow, a zero-configuration Rack server, with comprehensive annotated source.
  • technoweenie’s Coffee-Resque, a port of Resque for Node.js.
  • -
  • assaf’s Zombie.js, a headless, full-stack, faux-browser testing library for Node.js.
  • stephank’s Orona, a remake of the Bolo tank game for modern browsers.
  • GitHub’s Atom, a hackable text editor built on web technologies.
  • Basecamp’s Trix, a rich text editor for web apps.
  • @@ -2487,7 +2488,7 @@ task('build:parser', 'rebuild t

    Resources

    • -

      Source Code
      +

      Source Code
      Use bin/coffee to test your changes,
      bin/cake test to run the test suite,
      bin/cake build to rebuild the full CoffeeScript compiler, and
      @@ -2495,11 +2496,11 @@ Use bin/coffee to test your changes,

      git checkout lib && bin/cake build:full is a good command to run when you’re working on the core language. It’ll refresh the lib folder (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
      +

      Browser Tests
      Run CoffeeScript’s test suite in your current browser.

    • -

      CoffeeScript Issues
      +

      CoffeeScript Issues
      Bug reports, feature proposals, and ideas for changes to the language belong here.

    • @@ -2507,11 +2508,11 @@ Bug reports, feature proposals, and ideas for changes to the language belong her If you’d like to ask a question, the mailing list is a good place to get help.

    • -

      The CoffeeScript Wiki
      -If you’ve ever learned a neat CoffeeScript tip or trick, or ran into a gotcha — share it on the wiki. The wiki also serves as a directory of handy text editor extensions, web framework plugins, and general CoffeeScript build tools.

      +

      The CoffeeScript Wiki
      +If you’ve ever learned a neat CoffeeScript tip or trick, or ran into a gotcha — share it on the wiki. The wiki also serves as a directory of handy text editor extensions, web framework plugins, and general CoffeeScript build tools.

    • -

      The FAQ
      +

      The FAQ
      Perhaps your CoffeeScript-related question has been asked before. Check the FAQ first.

    • @@ -2566,7 +2567,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.prepareStackTrace has 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.

    @@ -2585,7 +2586,7 @@ The CoffeeScript logo is available in SVG for use in presentations.

  • CoffeeScript now provides a for…from syntax for outputting ES2015 for…of. (Sorry they couldn’t match, but we came up with for…of first for something else.) This allows iterating over generators or any other iterable object. Note that using for…from in your code makes you responsible for ensuring that either your runtime supports for…of or 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 and exports 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.
  • @@ -2800,7 +2801,7 @@ six = -> 1.6.1

      -
    • First release of source maps. Pass the --map flag to the compiler, and off you go. Direct all your thanks over to Jason Walton.
    • +
    • First release of source maps. Pass the --map flag to the compiler, and off you go. Direct all your thanks over to Jason Walton.
    • Fixed a 1.5.0 regression with multiple implicit calls against an indented implicit object. Combinations of implicit function calls and implicit objects should generally be parsed better now — but it still isn’t good style to nest them too heavily.
    • .coffee.md is now also supported as a Literate CoffeeScript file extension, for existing tooling. .litcoffee remains the canonical one.
    • Several minor fixes surrounding member properties, bound methods and super in class declarations.
    • @@ -2907,7 +2908,7 @@ six = ->

      0.9.5 -

      0.9.5 should be considered the first release candidate for CoffeeScript 1.0. There have been a large number of internal changes since the previous release, many contributed from satyr’s Coco dialect of CoffeeScript. Heregexes (extended regexes) were added. Functions can now have default arguments. Class bodies are now executable code. Improved syntax errors for invalid CoffeeScript. undefined now works like null, and cannot be assigned a new value. There was a precedence change with respect to single-line comprehensions: result = i for i in list +

      0.9.5 should be considered the first release candidate for CoffeeScript 1.0. There have been a large number of internal changes since the previous release, many contributed from satyr’s Coco dialect of CoffeeScript. Heregexes (extended regexes) were added. Functions can now have default arguments. Class bodies are now executable code. Improved syntax errors for invalid CoffeeScript. undefined now works like null, and cannot be assigned a new value. There was a precedence change with respect to single-line comprehensions: result = i for i in list used to parse as result = (i for i in list) by default … it now parses as (result = i) for i in list.

      @@ -2974,7 +2975,7 @@ used to parse as result = (i for i in list) by default … it now p

      0.5.5 -

      String interpolation, contributed by Stan Angeloff. Since --run has been the default since 0.5.3, updating --stdio and --eval to run by default, pass --compile as well if you’d like to print the result.

      +

      String interpolation, contributed by Stan Angeloff. Since --run has been the default since 0.5.3, updating --stdio and --eval to run by default, pass --compile as well if you’d like to print the result.

      0.5.4 @@ -2990,7 +2991,7 @@ used to parse as result = (i for i in list) by default … it now p 0.5.2

      Added 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 type text/coffeescript for you. Added a --stdio option to the coffee command, for piped-in compiles.

      +/v1/browser-compiler/coffee-script.js. It’ll automatically run any script tags with type text/coffeescript for you. Added a --stdio option to the coffee command, for piped-in compiles.

      0.5.1 @@ -3056,7 +3057,7 @@ The extends keyword now functions identically to goog.inherit

      0.2.0 -

      Major release. Significant whitespace. Better statement-to-expression conversion. Splats. Splice literals. Object comprehensions. Blocks. The existential operator. Many thanks to all the folks who posted issues, with special thanks to Liam O’Connor-Davis for whitespace and expression help.

      +

      Major release. Significant whitespace. Better statement-to-expression conversion. Splats. Splice literals. Object comprehensions. Blocks. The existential operator. Many thanks to all the folks who posted issues, with special thanks to Liam O’Connor-Davis for whitespace and expression help.

      0.1.6 @@ -3071,7 +3072,7 @@ The extends keyword now functions identically to goog.inherit

      0.1.4 -

      The official CoffeeScript extension is now .coffee instead of .cs, which properly belongs to C#. Due to popular demand, you can now also use = to assign. Unlike JavaScript, = can also be used within object literals, interchangeably with :. Made a grammatical fix for chained function calls like func(1)(2)(3)(4). Inheritance and super no longer use __proto__, so they should be IE-compatible now.

      +

      The official CoffeeScript extension is now .coffee instead of .cs, which properly belongs to C#. Due to popular demand, you can now also use = to assign. Unlike JavaScript, = can also be used within object literals, interchangeably with :. Made a grammatical fix for chained function calls like func(1)(2)(3)(4). Inheritance and super no longer use __proto__, so they should be IE-compatible now.

      0.1.3 diff --git a/docs/v2/annotated-source/cake.html b/docs/v2/annotated-source/cake.html index ced79af3..5c5c7161 100644 --- a/docs/v2/annotated-source/cake.html +++ b/docs/v2/annotated-source/cake.html @@ -116,7 +116,7 @@

      cake is a simplified version of Make -(Rake, Jake) +(Rake, Jake) 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.

      Running cake with no arguments will print out a list of all the tasks in the diff --git a/docs/v2/annotated-source/grammar.html b/docs/v2/annotated-source/grammar.html index fe08fb27..b04b9034 100644 --- a/docs/v2/annotated-source/grammar.html +++ b/docs/v2/annotated-source/grammar.html @@ -115,17 +115,17 @@

      -

      The CoffeeScript parser is generated by Jison +

      The CoffeeScript parser is generated by Jison from this grammar file. Jison is a bottom-up parser generator, similar in style to Bison, implemented in JavaScript. -It can recognize LALR(1), LR(0), SLR(1), and LR(1) +It can recognize LALR(1), LR(0), SLR(1), and LR(1) type grammars. To create the Jison parser, we list the pattern to match on the left-hand side, and the action to take (usually the creation of syntax tree nodes) on the right. As the parser runs, it shifts tokens from our token stream, from left to right, and -attempts to match +attempts to match the token sequence against the rules below. When a match can be made, it -reduces into the nonterminal +reduces into the nonterminal (the enclosing name at the top), and we proceed from there.

      If you run the cake build:parser command, Jison constructs a parse table from our rules and saves it into lib/parser.js.

      @@ -199,7 +199,7 @@ wrapper and just returning the value directly.

      Our handy DSL for Jison grammar generation, thanks to -Tim Caswell. For every rule in the grammar, +Tim Caswell. For every rule in the grammar, we pass the pattern-defining string, the action to run, and extra options, optionally. If no action is specified, we simply pass the value of the previous nonterminal.

      diff --git a/docs/v2/annotated-source/lexer.html b/docs/v2/annotated-source/lexer.html index e16bee93..b843c25f 100644 --- a/docs/v2/annotated-source/lexer.html +++ b/docs/v2/annotated-source/lexer.html @@ -121,7 +121,7 @@ a token is produced, we consume the match, and start again. Tokens are in the form:

      [tag, value, locationData]
       

      where locationData is {first_line, first_column, last_line, last_column}, which is a -format that can be fed directly into Jison. These +format that can be fed directly into Jison. These are read by jison in the parser.lexer function defined in coffeescript.coffee.

      diff --git a/docs/v2/annotated-source/nodes.html b/docs/v2/annotated-source/nodes.html index 7a2ee572..2bfbf5d1 100644 --- a/docs/v2/annotated-source/nodes.html +++ b/docs/v2/annotated-source/nodes.html @@ -4985,7 +4985,7 @@ CoffeeScript operations into their JavaScript equivalents.

      Am I capable of -Python-style comparison chaining?

      +Python-style comparison chaining?

      diff --git a/docs/v2/annotated-source/sourcemap.html b/docs/v2/annotated-source/sourcemap.html index 7ca78df9..3a51418f 100644 --- a/docs/v2/annotated-source/sourcemap.html +++ b/docs/v2/annotated-source/sourcemap.html @@ -406,7 +406,7 @@ column for the current line:

      Note that SourceMap VLQ encoding is “backwards”. MIDI-style VLQ encoding puts the most-significant-bit (MSB) from the original value into the MSB of the VLQ -encoded value (see Wikipedia). +encoded value (see Wikipedia). SourceMap VLQ does things the other way around, with the least significat four bits of the original value encoded into the first byte of the VLQ encoded value.

      diff --git a/docs/v2/index.html b/docs/v2/index.html index e40aa11c..5fdd742a 100644 --- a/docs/v2/index.html +++ b/docs/v2/index.html @@ -714,7 +714,7 @@ textarea {

      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.

      -

      Latest Version: 2.0.0-beta1

      +

      Latest Version: 2.0.0-beta1

      npm install -g coffeescript@next
       
      @@ -825,8 +825,8 @@ coffee -p *.coffee | babel --presets env > app.js

      Installation

      -

      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:

      +

      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:

      npm install --global coffeescript@next
       

      When you need CoffeeScript as a dependency of a project, within that project’s folder you can install it locally:

      @@ -1798,7 +1798,7 @@ alert((function() {

      unless can be used as the inverse of if.

      As a shortcut for this.property, you can use @property.

      You can use in to test for array presence, and of to test for JavaScript object-key presence.

      -

      To simplify math expressions, ** can be used for exponentiation and // performs integer division. % works just like in JavaScript, while %% provides “dividend dependent modulo”:

      +

      To simplify math expressions, ** can be used for exponentiation and // performs integer division. % works just like in JavaScript, while %% provides “dividend dependent modulo”:

      If we had used -> in the callback above, @customer would have referred to the undefined “customer” property of the DOM element, and trying to call purchase() on it would have raised an exception.

      When used in a class definition, methods declared with the fat arrow will be automatically bound to each instance of the class when the instance is constructed.

      +
      +

      CoffeeScript also supports generator functions and async functions through the yield and await keywords respectively. There’s no function*(){} or async function(){} nonsense — a generator in CoffeeScript is simply a function that yields, and an async function in CoffeeScript is simply a function that awaits.

      yield* is called yield from, and yield return may be used if you need to force a generator that doesn’t yield.

      +

      You can iterate over a generator function using for…from.

      Chained Comparisons

      -

      CoffeeScript borrows chained comparisons from Python — making it easy to test if a value falls within a certain range.

      +

      CoffeeScript borrows chained comparisons from Python — making it easy to test if a value falls within a certain range.

      +

      Note that the CoffeeScript compiler does not resolve modules; writing an import or export statement in CoffeeScript will produce an import or export statement in the resulting output. It is your responsibility attach another transpiler, such as Traceur Compiler, Babel or Rollup, to convert this ES2015 syntax into code that will work in your target runtimes.

      Also note that any file with an import or export statement will be output without a top-level function safety wrapper; in other words, importing or exporting modules will automatically trigger bare mode for that file. This is because per the ES2015 spec, import or export statements must occur at the topmost scope.

      @@ -3006,13 +3010,13 @@ Object.defineProperty(screen, 'height', {

      Literate CoffeeScript

      Besides being used as an ordinary programming language, CoffeeScript may also be written in “literate” mode. If you name your file with a .litcoffee extension, you can write it as a Markdown document — a document that also happens to be executable CoffeeScript code. The compiler will treat any indented blocks (Markdown’s way of indicating source code) as code, and ignore the rest as comments.

      -

      Just for kicks, a little bit of the compiler is currently implemented in this fashion: See it as a document, raw, and properly highlighted in a text editor.

      +

      Just for kicks, a little bit of the compiler is currently implemented in this fashion: See it as a document, raw, and properly highlighted in a text editor.

      Source Maps

      CoffeeScript includes support for generating source maps, a way to tell your JavaScript engine what part of your CoffeeScript program matches up with the code being evaluated. Browsers that support it can automatically use source maps to show your original source code in the debugger. To generate source maps alongside your JavaScript files, pass the --map or -m flag to the compiler.

      -

      For a full introduction to source maps, how they work, and how to hook them up in your browser, read the HTML5 Tutorial.

      +

      For a full introduction to source maps, how they work, and how to hook them up in your browser, read the HTML5 Tutorial.

      @@ -3057,7 +3061,7 @@ task('build:parser', 'rebuild the Jison parser', function(options) {

      "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) as v2/browser-compiler/coffeescript.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) as docs/v2/browser-compiler/coffeescript.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, as well as the code examples and other interactive parts of this site, 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 your JavaScript console 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 window object.

      @@ -3065,14 +3069,14 @@ task('build:parser', 'rebuild the Jison parser', function(options) {

      Resources

      Screencasts

        -
      • A Sip of CoffeeScript is a Code School Course which combines 6 screencasts with in-browser coding to make learning fun. The first level is free to try out.
      • -
      • Meet CoffeeScript is a 75-minute long screencast by PeepCode. Highly memorable for its animations which demonstrate transforming CoffeeScript into the equivalent JS.
      • +
      • A Sip of CoffeeScript is a Code School Course which combines 6 screencasts with in-browser coding to make learning fun. The first level is free to try out.
      • +
      • Meet CoffeeScript is a 75-minute long screencast by PeepCode, now PluralSight. Highly memorable for its animations which demonstrate transforming CoffeeScript into the equivalent JS.
      • If you’re looking for less of a time commitment, RailsCasts’ CoffeeScript Basics should have you covered, hitting all of the important notes about CoffeeScript in 11 minutes.
      @@ -3109,10 +3113,9 @@ The CoffeeScript logo is available in SVG for use in presentations.

      Examples

      The best list of open-source CoffeeScript examples can be found on GitHub. But just to throw out a few more:

        -
      • GitHub’s Hubot, a friendly IRC robot that can perform any number of useful and useless tasks.
      • +
      • GitHub’s Hubot, a friendly IRC robot that can perform any number of useful and useless tasks.
      • sstephenson’s Pow, a zero-configuration Rack server, with comprehensive annotated source.
      • technoweenie’s Coffee-Resque, a port of Resque for Node.js.
      • -
      • assaf’s Zombie.js, a headless, full-stack, faux-browser testing library for Node.js.
      • stephank’s Orona, a remake of the Bolo tank game for modern browsers.
      • GitHub’s Atom, a hackable text editor built on web technologies.
      • Basecamp’s Trix, a rich text editor for web apps.
      • @@ -3709,7 +3712,7 @@ six = -> 1.6.1

        -
      • First release of source maps. Pass the --map flag to the compiler, and off you go. Direct all your thanks over to Jason Walton.
      • +
      • First release of source maps. Pass the --map flag to the compiler, and off you go. Direct all your thanks over to Jason Walton.
      • Fixed a 1.5.0 regression with multiple implicit calls against an indented implicit object. Combinations of implicit function calls and implicit objects should generally be parsed better now — but it still isn’t good style to nest them too heavily.
      • .coffee.md is now also supported as a Literate CoffeeScript file extension, for existing tooling. .litcoffee remains the canonical one.
      • Several minor fixes surrounding member properties, bound methods and super in class declarations.
      • @@ -3816,7 +3819,7 @@ six = ->

        0.9.5 -

        0.9.5 should be considered the first release candidate for CoffeeScript 1.0. There have been a large number of internal changes since the previous release, many contributed from satyr’s Coco dialect of CoffeeScript. Heregexes (extended regexes) were added. Functions can now have default arguments. Class bodies are now executable code. Improved syntax errors for invalid CoffeeScript. undefined now works like null, and cannot be assigned a new value. There was a precedence change with respect to single-line comprehensions: result = i for i in list +

        0.9.5 should be considered the first release candidate for CoffeeScript 1.0. There have been a large number of internal changes since the previous release, many contributed from satyr’s Coco dialect of CoffeeScript. Heregexes (extended regexes) were added. Functions can now have default arguments. Class bodies are now executable code. Improved syntax errors for invalid CoffeeScript. undefined now works like null, and cannot be assigned a new value. There was a precedence change with respect to single-line comprehensions: result = i for i in list used to parse as result = (i for i in list) by default … it now parses as (result = i) for i in list.

        @@ -3883,7 +3886,7 @@ used to parse as result = (i for i in list) by default … it now p

        0.5.5 -

        String interpolation, contributed by Stan Angeloff. Since --run has been the default since 0.5.3, updating --stdio and --eval to run by default, pass --compile as well if you’d like to print the result.

        +

        String interpolation, contributed by Stan Angeloff. Since --run has been the default since 0.5.3, updating --stdio and --eval to run by default, pass --compile as well if you’d like to print the result.

        0.5.4 @@ -3899,7 +3902,7 @@ used to parse as result = (i for i in list) by default … it now p 0.5.2

        Added a compressed version of the compiler for inclusion in web pages as -v2/browser-compiler/coffeescript.js. It’ll automatically run any script tags with type text/coffeescript for you. Added a --stdio option to the coffee command, for piped-in compiles.

        +/v2/browser-compiler/coffeescript.js. It’ll automatically run any script tags with type text/coffeescript for you. Added a --stdio option to the coffee command, for piped-in compiles.

        0.5.1 @@ -3965,7 +3968,7 @@ The extends keyword now functions identically to goog.inherit

        0.2.0 -

        Major release. Significant whitespace. Better statement-to-expression conversion. Splats. Splice literals. Object comprehensions. Blocks. The existential operator. Many thanks to all the folks who posted issues, with special thanks to Liam O’Connor-Davis for whitespace and expression help.

        +

        Major release. Significant whitespace. Better statement-to-expression conversion. Splats. Splice literals. Object comprehensions. Blocks. The existential operator. Many thanks to all the folks who posted issues, with special thanks to Liam O’Connor-Davis for whitespace and expression help.

        0.1.6 @@ -3980,7 +3983,7 @@ The extends keyword now functions identically to goog.inherit

        0.1.4 -

        The official CoffeeScript extension is now .coffee instead of .cs, which properly belongs to C#. Due to popular demand, you can now also use = to assign. Unlike JavaScript, = can also be used within object literals, interchangeably with :. Made a grammatical fix for chained function calls like func(1)(2)(3)(4). Inheritance and super no longer use __proto__, so they should be IE-compatible now.

        +

        The official CoffeeScript extension is now .coffee instead of .cs, which properly belongs to C#. Due to popular demand, you can now also use = to assign. Unlike JavaScript, = can also be used within object literals, interchangeably with :. Made a grammatical fix for chained function calls like func(1)(2)(3)(4). Inheritance and super no longer use __proto__, so they should be IE-compatible now.

        0.1.3 diff --git a/documentation/sections/books.md b/documentation/sections/books.md index 22abdb9d..c415dffa 100644 --- a/documentation/sections/books.md +++ b/documentation/sections/books.md @@ -2,12 +2,12 @@ There are a number of excellent resources to help you get started with CoffeeScript, some of which are freely available online. -* [The Little Book on CoffeeScript](http://arcturo.github.com/library/coffeescript/) is a brief 5-chapter introduction to CoffeeScript, written with great clarity and precision by [Alex MacCaw](http://alexmaccaw.co.uk/). -* [Smooth CoffeeScript](http://autotelicum.github.com/Smooth-CoffeeScript/) is a reimagination of the excellent book [Eloquent JavaScript](http://eloquentjavascript.net/), as if it had been written in CoffeeScript instead. Covers language features as well as the functional and object oriented programming styles. By [E. Hoigaard](https://github.com/autotelicum). +* [The Little Book on CoffeeScript](http://arcturo.github.io/library/coffeescript/) is a brief 5-chapter introduction to CoffeeScript, written with great clarity and precision by [Alex MacCaw](http://alexmaccaw.co.uk/). +* [Smooth CoffeeScript](http://autotelicum.github.io/Smooth-CoffeeScript/) is a reimagination of the excellent book [Eloquent JavaScript](http://eloquentjavascript.net/), as if it had been written in CoffeeScript instead. Covers language features as well as the functional and object oriented programming styles. By [E. Hoigaard](https://github.com/autotelicum). * [CoffeeScript: Accelerated JavaScript Development](http://pragprog.com/book/tbcoffee/coffeescript) is [Trevor Burnham](http://trevorburnham.com/)’s thorough introduction to the language. By the end of the book, you’ll have built a fast-paced multiplayer word game, writing both the client-side and Node.js portions in CoffeeScript. -* [CoffeeScript Programming with jQuery, Rails, and Node.js](http://www.packtpub.com/coffeescript-programming-with-jquery-rails-nodejs/book) is a new book by Michael Erasmus that covers CoffeeScript with an eye towards real-world usage both in the browser (jQuery) and on the server-side (Rails, Node). +* [CoffeeScript Programming with jQuery, Rails, and Node.js](https://www.packtpub.com/web-development/coffeescript-programming-jquery-rails-and-nodejs) is a new book by Michael Erasmus that covers CoffeeScript with an eye towards real-world usage both in the browser (jQuery) and on the server-side (Rails, Node). * [CoffeeScript Ristretto](https://leanpub.com/coffeescript-ristretto/read) is a deep dive into CoffeeScript’s semantics from simple functions up through closures, higher-order functions, objects, classes, combinators, and decorators. By [Reg Braithwaite](http://braythwayt.com/). * [Testing with CoffeeScript](https://efendibooks.com/minibooks/testing-with-coffeescript) is a succinct and freely downloadable guide to building testable applications with CoffeeScript and Jasmine. -* [CoffeeScript Application Development](http://www.packtpub.com/coffeescript-application-development/book) from Packt, introduces CoffeeScript while walking through the process of building a demonstration web application. A [CoffeeScript Application Development Coookbook](https://www.packtpub.com/web-development/coffeescript-application-development-cookbook) with over 90 “recipes” is also available. -* [CoffeeScript in Action](http://www.manning.com/lee/) from Manning Publications, covers CoffeeScript syntax, composition techniques and application development. -* [CoffeeScript: Die Alternative zu JavaScript](http://www.dpunkt.de/buecher/4021/coffeescript.html) from dpunkt.verlag, is the first CoffeeScript book in Deutsch. +* [CoffeeScript Application Development](https://www.packtpub.com/web-development/coffeescript-application-development) from Packt, introduces CoffeeScript while walking through the process of building a demonstration web application. A [CoffeeScript Application Development Coookbook](https://www.packtpub.com/web-development/coffeescript-application-development-cookbook) with over 90 “recipes” is also available. +* [CoffeeScript in Action](https://www.manning.com/books/coffeescript-in-action) from Manning Publications, covers CoffeeScript syntax, composition techniques and application development. +* [CoffeeScript: Die Alternative zu JavaScript](https://www.dpunkt.de/buecher/4021/coffeescript.html) from dpunkt.verlag, is the first CoffeeScript book in Deutsch. diff --git a/documentation/sections/changelog.md b/documentation/sections/changelog.md index dc51417a..83ee1189 100644 --- a/documentation/sections/changelog.md +++ b/documentation/sections/changelog.md @@ -241,7 +241,7 @@ releaseHeader('2013-03-18', '1.6.2', '1.6.1') releaseHeader('2013-03-05', '1.6.1', '1.5.0') ``` -* First release of [source maps](#source-maps). Pass the `--map` flag to the compiler, and off you go. Direct all your thanks over to [Jason Walton](http://github.com/jwalton). +* First release of [source maps](#source-maps). Pass the `--map` flag to the compiler, and off you go. Direct all your thanks over to [Jason Walton](https://github.com/jwalton). * Fixed a 1.5.0 regression with multiple implicit calls against an indented implicit object. Combinations of implicit function calls and implicit objects should generally be parsed better now — but it still isn’t good _style_ to nest them too heavily. * `.coffee.md` is now also supported as a Literate CoffeeScript file extension, for existing tooling. `.litcoffee` remains the canonical one. * Several minor fixes surrounding member properties, bound methods and `super` in class declarations. @@ -348,7 +348,7 @@ The REPL now properly formats stacktraces, and stays alive through asynchronous releaseHeader('2010-11-21', '0.9.5', '0.9.4') ``` -0.9.5 should be considered the first release candidate for CoffeeScript 1.0. There have been a large number of internal changes since the previous release, many contributed from **satyr**’s [Coco](http://github.com/satyr/coco) dialect of CoffeeScript. Heregexes (extended regexes) were added. Functions can now have default arguments. Class bodies are now executable code. Improved syntax errors for invalid CoffeeScript. `undefined` now works like `null`, and cannot be assigned a new value. There was a precedence change with respect to single-line comprehensions: `result = i for i in list` +0.9.5 should be considered the first release candidate for CoffeeScript 1.0. There have been a large number of internal changes since the previous release, many contributed from **satyr**’s [Coco](https://github.com/satyr/coco) dialect of CoffeeScript. Heregexes (extended regexes) were added. Functions can now have default arguments. Class bodies are now executable code. Improved syntax errors for invalid CoffeeScript. `undefined` now works like `null`, and cannot be assigned a new value. There was a precedence change with respect to single-line comprehensions: `result = i for i in list` used to parse as `result = (i for i in list)` by default … it now parses as `(result = i) for i in list`. @@ -428,7 +428,7 @@ Interpolation can now be used within regular expressions and heredocs, as well a releaseHeader('2010-03-08', '0.5.5', '0.5.4') ``` -String interpolation, contributed by [Stan Angeloff](http://github.com/StanAngeloff). Since `--run` has been the default since **0.5.3**, updating `--stdio` and `--eval` to run by default, pass `--compile` as well if you’d like to print the result. +String interpolation, contributed by [Stan Angeloff](https://github.com/StanAngeloff). Since `--run` has been the default since **0.5.3**, updating `--stdio` and `--eval` to run by default, pass `--compile` as well if you’d like to print the result. ``` releaseHeader('2010-03-03', '0.5.4', '0.5.3') @@ -447,7 +447,7 @@ releaseHeader('2010-02-25', '0.5.2', '0.5.1') ``` Added a compressed version of the compiler for inclusion in web pages as -`v<%= majorVersion %>/browser-compiler/coffeescript.js`. It’ll automatically run any script tags with type `text/coffeescript` for you. Added a `--stdio` option to the `coffee` command, for piped-in compiles. +`/v<%= majorVersion %>/browser-compiler/coffeescript.js`. It’ll automatically run any script tags with type `text/coffeescript` for you. Added a `--stdio` option to the `coffee` command, for piped-in compiles. ``` releaseHeader('2010-02-24', '0.5.1', '0.5.0') @@ -524,7 +524,7 @@ Arguments objects are now converted into real arrays when referenced. releaseHeader('2010-01-05', '0.2.0', '0.1.6') ``` -Major release. Significant whitespace. Better statement-to-expression conversion. Splats. Splice literals. Object comprehensions. Blocks. The existential operator. Many thanks to all the folks who posted issues, with special thanks to [Liam O’Connor-Davis](http://github.com/liamoc) for whitespace and expression help. +Major release. Significant whitespace. Better statement-to-expression conversion. Splats. Splice literals. Object comprehensions. Blocks. The existential operator. Many thanks to all the folks who posted issues, with special thanks to [Liam O’Connor-Davis](https://github.com/liamoc) for whitespace and expression help. ``` releaseHeader('2009-12-27', '0.1.6', '0.1.5') @@ -542,7 +542,7 @@ Array slice literals and array comprehensions can now both take Ruby-style range releaseHeader('2009-12-25', '0.1.4', '0.1.3') ``` -The official CoffeeScript extension is now `.coffee` instead of `.cs`, which properly belongs to [C#](http://en.wikipedia.org/wiki/C_Sharp_(programming_language)). Due to popular demand, you can now also use `=` to assign. Unlike JavaScript, `=` can also be used within object literals, interchangeably with `:`. Made a grammatical fix for chained function calls like `func(1)(2)(3)(4)`. Inheritance and super no longer use `__proto__`, so they should be IE-compatible now. +The official CoffeeScript extension is now `.coffee` instead of `.cs`, which properly belongs to [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)). Due to popular demand, you can now also use `=` to assign. Unlike JavaScript, `=` can also be used within object literals, interchangeably with `:`. Made a grammatical fix for chained function calls like `func(1)(2)(3)(4)`. Inheritance and super no longer use `__proto__`, so they should be IE-compatible now. ``` releaseHeader('2009-12-25', '0.1.3', '0.1.2') diff --git a/documentation/sections/comparisons.md b/documentation/sections/comparisons.md index c7c81142..80df70c6 100644 --- a/documentation/sections/comparisons.md +++ b/documentation/sections/comparisons.md @@ -1,6 +1,6 @@ ## Chained Comparisons -CoffeeScript borrows [chained comparisons](http://docs.python.org/reference/expressions.html#notin) from Python — making it easy to test if a value falls within a certain range. +CoffeeScript borrows [chained comparisons](https://docs.python.org/3/reference/expressions.html#not-in) from Python — making it easy to test if a value falls within a certain range. ``` codeFor('comparisons', 'healthy') diff --git a/documentation/sections/examples.md b/documentation/sections/examples.md index 47e33ba2..19f02b81 100644 --- a/documentation/sections/examples.md +++ b/documentation/sections/examples.md @@ -2,10 +2,9 @@ The [best list of open-source CoffeeScript examples](https://github.com/trending?l=coffeescript&since=monthly) can be found on GitHub. But just to throw out a few more: -* **GitHub**’s [Hubot](http://hubot.github.com/), a friendly IRC robot that can perform any number of useful and useless tasks. +* **GitHub**’s [Hubot](https://hubot.github.com/), a friendly IRC robot that can perform any number of useful and useless tasks. * **sstephenson**’s [Pow](http://pow.cx/), a zero-configuration Rack server, with comprehensive annotated source. * **technoweenie**’s [Coffee-Resque](https://github.com/technoweenie/coffee-resque), a port of [Resque](https://github.com/defunkt/resque) for Node.js. -* **assaf**’s [Zombie.js](http://zombie.labnotes.org/), a headless, full-stack, faux-browser testing library for Node.js. * **stephank**’s [Orona](https://github.com/stephank/orona), a remake of the Bolo tank game for modern browsers. * **GitHub**’s [Atom](https://atom.io/), a hackable text editor built on web technologies. * **Basecamp**’s [Trix](https://trix-editor.org/), a rich text editor for web apps. diff --git a/documentation/sections/fat_arrow.md b/documentation/sections/fat_arrow.md index 39382a00..c2badc43 100644 --- a/documentation/sections/fat_arrow.md +++ b/documentation/sections/fat_arrow.md @@ -12,6 +12,9 @@ If we had used `->` in the callback above, `@customer` would have referred to th When used in a class definition, methods declared with the fat arrow will be automatically bound to each instance of the class when the instance is constructed. +
        +
        + CoffeeScript also supports [generator functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*) and [async functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) through the `yield` and `await` keywords respectively. There's no `function*(){}` or `async function(){}` nonsense — a generator in CoffeeScript is simply a function that yields, and an async function in CoffeeScript is simply a function that awaits. ``` @@ -20,6 +23,8 @@ codeFor('generators', 'ps.next().value') `yield*` is called `yield from`, and `yield return` may be used if you need to force a generator that doesn’t yield. +
        + You can iterate over a generator function using `for…from`. ``` diff --git a/documentation/sections/installation.md b/documentation/sections/installation.md index 2247465b..2755e6fa 100644 --- a/documentation/sections/installation.md +++ b/documentation/sections/installation.md @@ -1,8 +1,8 @@ ## Installation -The command-line version of `coffee` is available as a [Node.js](http://nodejs.org/) utility. The [core compiler](/v<%= majorVersion %>/browser-compiler/coffeescript.js) however, does not depend on Node, and can be run in any JavaScript environment, or in the browser (see [Try CoffeeScript](#try)). +The command-line version of `coffee` is available as a [Node.js](https://nodejs.org/) utility. The [core compiler](/v<%= majorVersion %>/browser-compiler/coffeescript.js) however, does not depend on Node, and can be run in any JavaScript environment, or in the browser (see [Try CoffeeScript](#try)). -To install, first make sure you have a working copy of the latest stable version of [Node.js](http://nodejs.org/). You can then install CoffeeScript globally with [npm](http://npmjs.org): +To install, first make sure you have a working copy of the latest stable version of [Node.js](https://nodejs.org/). You can then install CoffeeScript globally with [npm](https://www.npmjs.com/): ```bash npm install --global coffeescript@next diff --git a/documentation/sections/introduction.md b/documentation/sections/introduction.md index de401a73..85b8e94d 100644 --- a/documentation/sections/introduction.md +++ b/documentation/sections/introduction.md @@ -2,7 +2,7 @@ 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. -**Latest Version:** [<%= fullVersion %>](http://github.com/jashkenas/coffeescript/tarball/<%= fullVersion %>) +**Latest Version:** [<%= fullVersion %>](https://github.com/jashkenas/coffeescript/tarball/<%= fullVersion %>) ```bash npm install -g coffeescript@next diff --git a/documentation/sections/literate.md b/documentation/sections/literate.md index 1fb12885..2eb5781b 100644 --- a/documentation/sections/literate.md +++ b/documentation/sections/literate.md @@ -2,4 +2,4 @@ Besides being used as an ordinary programming language, CoffeeScript may also be written in “literate” mode. If you name your file with a `.litcoffee` extension, you can write it as a Markdown document — a document that also happens to be executable CoffeeScript code. The compiler will treat any indented blocks (Markdown’s way of indicating source code) as code, and ignore the rest as comments. -Just for kicks, a little bit of the compiler is currently implemented in this fashion: See it [as a document](https://gist.github.com/jashkenas/3fc3c1a8b1009c00d9df), [raw](https://raw.github.com/jashkenas/coffeescript/master/src/scope.litcoffee), and [properly highlighted in a text editor](http://cl.ly/LxEu). +Just for kicks, a little bit of the compiler is currently implemented in this fashion: See it [as a document](https://gist.github.com/jashkenas/3fc3c1a8b1009c00d9df), [raw](https://raw.githubusercontent.com/jashkenas/coffeescript/master/src/scope.litcoffee), and [properly highlighted in a text editor](http://cl.ly/LxEu). diff --git a/documentation/sections/modules.md b/documentation/sections/modules.md index ee41c164..73a50803 100644 --- a/documentation/sections/modules.md +++ b/documentation/sections/modules.md @@ -6,6 +6,8 @@ ES2015 modules are supported in CoffeeScript, with very similar `import` and `ex codeFor('modules') ``` +
        + Note that the CoffeeScript compiler **does not resolve modules**; writing an `import` or `export` statement in CoffeeScript will produce an `import` or `export` statement in the resulting output. It is your responsibility attach another transpiler, such as [Traceur Compiler](https://github.com/google/traceur-compiler), [Babel](http://babeljs.io/) or [Rollup](https://github.com/rollup/rollup), to convert this ES2015 syntax into code that will work in your target runtimes. Also note that any file with an `import` or `export` statement will be output without a [top-level function safety wrapper](#lexical-scope); in other words, importing or exporting modules will automatically trigger [bare](#usage) mode for that file. This is because per the ES2015 spec, `import` or `export` statements must occur at the topmost scope. diff --git a/documentation/sections/operators.md b/documentation/sections/operators.md index b5f9a4d4..6e412a9c 100644 --- a/documentation/sections/operators.md +++ b/documentation/sections/operators.md @@ -16,7 +16,7 @@ As a shortcut for `this.property`, you can use `@property`. You can use `in` to test for array presence, and `of` to test for JavaScript object-key presence. -To simplify math expressions, `**` can be used for exponentiation and `//` performs integer division. `%` works just like in JavaScript, while `%%` provides [“dividend dependent modulo”](http://en.wikipedia.org/wiki/Modulo_operation): +To simplify math expressions, `**` can be used for exponentiation and `//` performs integer division. `%` works just like in JavaScript, while `%%` provides [“dividend dependent modulo”](https://en.wikipedia.org/wiki/Modulo_operation): ``` codeFor('modulo') diff --git a/documentation/sections/resources.md b/documentation/sections/resources.md index c958b332..dbe6d865 100644 --- a/documentation/sections/resources.md +++ b/documentation/sections/resources.md @@ -1,13 +1,13 @@ ## Resources -* [CoffeeScript on GitHub](http://github.com/jashkenas/coffeescript/) -* [CoffeeScript Issues](http://github.com/jashkenas/coffeescript/issues)
        +* [CoffeeScript on GitHub](https://github.com/jashkenas/coffeescript/) +* [CoffeeScript Issues](https://github.com/jashkenas/coffeescript/issues)
        Bug reports, feature proposals, and ideas for changes to the language belong here. * [CoffeeScript Google Group](https://groups.google.com/forum/#!forum/coffeescript)
        If you’d like to ask a question, the mailing list is a good place to get help. -* [The CoffeeScript Wiki](http://github.com/jashkenas/coffeescript/wiki)
        - If you’ve ever learned a neat CoffeeScript tip or trick, or ran into a gotcha — share it on the wiki. The wiki also serves as a directory of handy [text editor extensions](http://github.com/jashkenas/coffeescript/wiki/Text-editor-plugins), [web framework plugins](http://github.com/jashkenas/coffeescript/wiki/Web-framework-plugins), and general [CoffeeScript build tools](http://github.com/jashkenas/coffeescript/wiki/Build-tools). -* [The FAQ](http://github.com/jashkenas/coffeescript/wiki/FAQ)
        +* [The CoffeeScript Wiki](https://github.com/jashkenas/coffeescript/wiki)
        + If you’ve ever learned a neat CoffeeScript tip or trick, or ran into a gotcha — share it on the wiki. The wiki also serves as a directory of handy [text editor extensions](https://github.com/jashkenas/coffeescript/wiki/Text-editor-plugins), [web framework plugins](https://github.com/jashkenas/coffeescript/wiki/Web-framework-plugins), and general [CoffeeScript build tools](https://github.com/jashkenas/coffeescript/wiki/Build-tools). +* [The FAQ](https://github.com/jashkenas/coffeescript/wiki/FAQ)
        Perhaps your CoffeeScript-related question has been asked before. Check the FAQ first. * [JS2Coffee](http://js2.coffee/)
        Is a very well done reverse JavaScript-to-CoffeeScript compiler. It’s not going to be perfect (infer what your JavaScript classes are, when you need bound functions, and so on…) — but it’s a great starting point for converting simple scripts. diff --git a/documentation/sections/screencasts.md b/documentation/sections/screencasts.md index 7d6db315..aae849a0 100644 --- a/documentation/sections/screencasts.md +++ b/documentation/sections/screencasts.md @@ -1,5 +1,5 @@ ## Screencasts -* [A Sip of CoffeeScript](http://coffeescript.codeschool.com) is a [Code School Course](http://www.codeschool.com) which combines 6 screencasts with in-browser coding to make learning fun. The first level is free to try out. -* [Meet CoffeeScript](http://peepcode.com/products/coffeescript) is a 75-minute long screencast by [PeepCode](http://peepcode.com/). Highly memorable for its animations which demonstrate transforming CoffeeScript into the equivalent JS. +* [A Sip of CoffeeScript](http://coffeescript.codeschool.com/) is a [Code School Course](https://www.codeschool.com) which combines 6 screencasts with in-browser coding to make learning fun. The first level is free to try out. +* [Meet CoffeeScript](https://www.pluralsight.com/courses/meet-coffeescript) is a 75-minute long screencast by PeepCode, now [PluralSight](https://www.pluralsight.com/). Highly memorable for its animations which demonstrate transforming CoffeeScript into the equivalent JS. * If you’re looking for less of a time commitment, RailsCasts’ [CoffeeScript Basics](http://railscasts.com/episodes/267-coffeescript-basics) should have you covered, hitting all of the important notes about CoffeeScript in 11 minutes. diff --git a/documentation/sections/scripts.md b/documentation/sections/scripts.md index d1bb9315..7fc4e1ad 100644 --- a/documentation/sections/scripts.md +++ b/documentation/sections/scripts.md @@ -1,6 +1,6 @@ ## `"text/coffeescript"` Script Tags -While it’s not recommended for serious use, CoffeeScripts may be included directly within the browser using `