1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00
Unfancy JavaScript
Find a file
Geoffrey Booth b192e215a5 [CS2] Destructuring (#4478)
* Output simple array destructuring assignments to ES2015

* Output simple object destructured assignments to ES2015

* Compile shorthand object properties to ES2015 shorthand properties

This dramatically improves the appearance of destructured imports.

* Compile default values in destructured assignment to ES2015

* Rename `wrapInBraces` to `wrapInParentheses`, and `compilePatternMatch` to `compileDestructuring`, for clarity; style improvements (no `==` or `!=`, etc.)

* Don’t confuse the syntax highlighter

* Comment Assign::compilePatternMatch a bit

* Assignment expressions in conditionals are a bad practice

* Optional check for existence that only checks `!== undefined`, not `!= null`, to follow ES convention that default values only apply when a variable is undefined, not falsy

* Add comments; remove unnecessary array splats in function tests

* The fallback destructuring code should apply default values only if `undefined`, not falsy, to follow ES spec

* Support destructuring in function parameters (first pass); catch destructured reserved words

* Destructured variables in function parameter lists shouldn’t be added to the function body with `var` declarations; treat splat array function parameters the legacy way to avoid rethinking #4005

* Remove redundancy in undefined-only check for existence; fix passing option to check

* Fix undefined redundancy

* Simplify getting the variable name

* Reimplement “check for existence if not undefined” without creating a new operator

* `Obj::isAssignable` should not mutate; pass `lhs` property in from `Assign` or `Code` to child arrays and objects so that those child nodes are set as allowable for destructuring

* Revert changes to tests

* Restore revised test for empty destructuring assignment
2017-04-06 10:06:45 -07:00
bin Remove hyphen in coffee-script 2017-02-12 17:00:05 -08:00
docs Merge branch '2' into 2-docs 2017-04-02 22:55:31 -07:00
documentation Merge branch '2' into 2-docs 2017-04-02 22:55:31 -07:00
lib/coffeescript [CS2] Destructuring (#4478) 2017-04-06 10:06:45 -07:00
src [CS2] Destructuring (#4478) 2017-04-06 10:06:45 -07:00
test [CS2] Destructuring (#4478) 2017-04-06 10:06:45 -07:00
.gitignore Fix stack trace (#4428) 2017-01-22 13:20:18 -08:00
.nojekyll Move v1 documentation under docs/v1, with docs/index.html symlinking to docs/v1/index.html (with .nojekyll file to hopefully make the symlink work) 2016-11-15 20:54:30 -08:00
bower.json Remove hyphen in coffee-script 2017-02-12 17:00:05 -08:00
Cakefile Bump minimum Node version to 7.6, which has non-harmony support for async/await; make async tests always enabled, not just for harmony mode 2017-04-02 22:05:09 -07:00
CONTRIBUTING.md Remove hyphen in coffee-script 2017-02-12 17:00:05 -08:00
LICENSE Update copyright range to 2017 2017-01-04 00:34:28 -08:00
package.json [CS2] Fix handling of tabbed code blocks in .litcoffee files (#4485) 2017-04-06 09:59:11 -07:00
README.md Update NPM installation instructions 2017-02-21 21:12:40 -08:00
register.js Remove hyphen in coffee-script 2017-02-12 17:00:05 -08:00
repl.js Remove hyphen in coffee-script 2017-02-12 17:00:05 -08:00

        {
     }   }   {
    {   {  }  }
     }   }{  {
    {  }{  }  }                    _____       __  __
   { }{ }{  { }                   / ____|     / _|/ _|
 .- { { }  { }} -.               | |     ___ | |_| |_ ___  ___
(  { } { } { } }  )              | |    / _ \|  _|  _/ _ \/ _ \
|`-..________ ..-'|              | |___| (_) | | | ||  __/  __/
|                 |               \_____\___/|_| |_| \___|\___|
|                 ;--.
|                (__  \            _____           _       _
|                 | )  )          / ____|         (_)     | |
|                 |/  /          | (___   ___ _ __ _ _ __ | |_
|                 (  /            \___ \ / __| '__| | '_ \| __|
|                 |/              ____) | (__| |  | | |_) | |_
|                 |              |_____/ \___|_|  |_| .__/ \__|
 `-.._________..-'                                  | |
                                                    |_|

CoffeeScript is a little language that compiles into JavaScript.

Installation

If you have the node package manager, npm, installed:

npm install --global coffeescript

Leave off the --global if you dont wish to install globally.

Getting Started

Execute a script:

coffee /path/to/script.coffee

Compile a script:

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

If youd like to chat, drop by #coffeescript on Freenode IRC.

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