1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00
Commit graph

17 commits

Author SHA1 Message Date
Geoffrey Booth
07ae1edb44 [CS2] Remove unnecessary utility helper functions (#4526)
* Uncomment module test that was waiting for classes to be supported

* Rely on native indexOf

* Replace `bind` helper with native `bind` (no shortcut necessary)

* Update output

* Update modules class tests

* Remove helper for prototype extends

* Update docs to reflect removed extends operator

* Add shortcut for splice, like we have for slice
2017-04-25 07:10:42 -07:00
Geoffrey Booth
7e35c2c3da We no longer need to wrap in quotes JavaScript reserved words used as properties (#4527) 2017-04-24 09:23:42 -07:00
Geoffrey Booth
5651b8b14b [CS2] Fix non-bare get set when called with @ argument (#4525)
* Fixes #4524: `get` and `set` should be usable without parentheses when accessed via a period

* More get/set tests
2017-04-23 11:23:36 -07:00
Julian Rosse
89db842c3d merge master 2017-04-20 14:41:28 -05:00
Geoffrey Booth
0e8feb7ee9 [CS2] Literate CoffeeScript without dependencies (#4509)
* Reimplement `invertLiterate` without any dependency, tracking indentation levels (including inside lists); update literate test files to also check that no tests are skipped

* Drop Literate CoffeeScript’s support for executable code blocks inside list items (and also for second paragraphs or blockquotes in list items)

* Update Literate CoffeeScript docs to reflect current supported syntax
2017-04-17 23:30:40 -07:00
Geoffrey Booth
ae096a331a Merge branch 'master' into 2
# Conflicts:
#	Cakefile
#	documentation/sections/changelog.md
#	documentation/sections/classes.md
#	documentation/sections/fat_arrow.md
#	documentation/sections/installation.md
#	documentation/sections/introduction.md
#	documentation/sections/resources.md
#	documentation/sections/scripts.md
#	lib/coffeescript/repl.js
#	src/lexer.coffee
2017-04-17 19:52:34 -07:00
Geoffrey Booth
db216ec384 [CS2] 2.0.0-beta1 (#4499)
* Fix browser build to incorporate Markdown-It, not Marked

* Update Google Closure Compiler; recompile browser build but with MINIFY=false, because Closure Compiler throws an error on our current code; see https://github.com/google/closure-compiler-js/issues/59

* Bump version to 2.0.0-beta1; do release build, with updated docs and annotated source
2017-04-13 10:42:32 -07:00
Geoffrey Booth
9b77371ea8 Merge commit '72cf485dce' into 2
# Conflicts:
#	Cakefile
#	docs/v1/index.html
#	documentation/sections/changelog.md
#	documentation/sections/installation.md
#	documentation/sections/introduction.md
#	lib/coffee-script/nodes.js
#	lib/coffee-script/rewriter.js
#	lib/coffee-script/sourcemap.js
#	lib/coffeescript/browser.js
#	lib/coffeescript/cake.js
#	lib/coffeescript/coffeescript.js
#	lib/coffeescript/command.js
#	lib/coffeescript/grammar.js
#	lib/coffeescript/helpers.js
#	lib/coffeescript/index.js
#	lib/coffeescript/lexer.js
#	lib/coffeescript/optparse.js
#	lib/coffeescript/register.js
#	lib/coffeescript/repl.js
#	lib/coffeescript/scope.js
#	package.json
2017-04-12 20:27:57 -07:00
Geoffrey Booth
d20f54967e [CS2] 2.0.0-beta1 docs (#4494)
* Update package versions; remove marked

* Revise docs to use Markdown-It: tables are now GitHub-Flavored Markdown tables, avoid hack of blockquoted code blocks

* Add anchors for sub-sections

* Add syntax highlighting to uneducable code blocks; fix missing italics variant for comments font

* Update docs about breaking changes in Literate CoffeeScript, move Breaking Changes section below Literate CoffeeScript section

* Update docs regarding destructuring default values breaking change

* Update changelog, with spitball release date for beta1

* Fix highlight function return statement
2017-04-09 23:07:58 -07:00
Geoffrey Booth
8292d25d29 [CS2] Throw an error for ambiguous get or set keywords or function calls (#4484)
* Throw an error for ambiguous `get` or `set` function calls or ES5 getter/setter keywords, to warn the user to use parentheses if they intend a function call (or to inform them that `get` or `set` cannot be used as a keyword)

* Code golf

* Catch get or set keyword before static method

* DRY up getting the previous token

* Throw an error if get or set are used as keywords before what looks like a function or method with an interpolated/dynamic name

* Allow `get` or `set` parentheses-less function calls when first argument is a string without a colon (so a plain string, not a property accessor)

* Revert "Allow `get` or `set` parentheses-less function calls when first argument is a string without a colon (so a plain string, not a property accessor)"

This reverts commit 2d1addf5a4.

* Optimization

* No longer throw an error on `get` or `set` function calls to objects with dynamic property names (introduces a way to circumvent our check for trying to avoid the `get` or `set` keywords, but not worth the complications for this tiny edge case)
2017-04-08 21:59:09 -07:00
Julian Rosse
76945ab458 Fix #4487: Outdentation bug (#4488) 2017-04-08 13:12:55 -07:00
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
Geoffrey Booth
5e1d978946 [CS2] Fix handling of tabbed code blocks in .litcoffee files (#4485)
* Add tabbed literate test; modernize Markdown title heading

* Better parsing of Literate CoffeeScript files, including now correct parsing of tabbed .litcoffee files; and more accurate stack traces (assuming you don’t do your own word wrapping within list items)

* Swap Marked for MarkdownIt for parsing the Markdown of Literate CoffeeScript files; use MarkdownIt’s `map` property to preserve correct line numbers

* Literate CoffeeScript tests: remove trailing whitespace, fix spelling

* Literate CoffeeScript tests: add block quote test

* Literate CoffeeScript (tabbed, at least) seems to need a consistent starting indentation

* Restore test

* Reference links work now in MarkdownIt

* Breaking change in Literate CoffeeScript: code blocks within HTML tags must be unindented

* Breaking change in Literate CoffeeScript: code blocks within lists need a blank line separating them from the list item text
2017-04-06 09:59:11 -07:00
Geoffrey Booth
cfdec64958 Merge branch 'master' of github.com:jashkenas/coffeescript into 2
# Conflicts:
#	lib/coffee-script/parser.js
#	lib/coffeescript/lexer.js
2017-04-02 23:10:31 -07:00
Geoffrey Booth
7de06c3dcb Ensure unique source maps’ sourceURL; closes #4126 2017-02-20 15:46:48 -08:00
Geoffrey Booth
221a8720fe Merge branch '2' into 2.0.0-alpha1
# Conflicts:
#	Cakefile
#	README.md
#	documentation/sections/changelog.md
2017-02-18 18:36:15 -05:00
Geoffrey
4cc701a9da Remove hyphen in coffee-script 2017-02-12 17:00:05 -08:00