From 31940a4d5f6c7372ffbfac1d5146e9bd47e51114 Mon Sep 17 00:00:00 2001
From: Geoffrey Booth Fixes for block comment formatting, Fixes for block comment formatting, Bugfix release for classes with external constructor functions, see issue #1182. Bugfix release for classes with external constructor functions, see issue #1182. When running via the When running via the Fixed a lexer bug with Unicode identifiers. Updated REPL for compatibility with Node.js 0.3.7. Fixed requiring relative paths in the REPL. Trailing Fixed a lexer bug with Unicode identifiers. Updated REPL for compatibility with Node.js 0.3.7. Fixed requiring relative paths in the REPL. Trailing CoffeeScript loops no longer try to preserve block scope when functions are being generated within the loop body. Instead, you can use the CoffeeScript loops no longer try to preserve block scope when functions are being generated within the loop body. Instead, you can use the The REPL now properly formats stacktraces, and stays alive through asynchronous exceptions. Using The REPL now properly formats stacktraces, and stays alive through asynchronous exceptions. Using 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. 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. CoffeeScript now uses appropriately-named temporary variables, and recycles their references after use. Added CoffeeScript now uses appropriately-named temporary variables, and recycles their references after use. Added CoffeeScript CoffeeScript Specifying the start and end of a range literal is now optional, eg. Specifying the start and end of a range literal is now optional, eg. Bugfix release for 0.9.1. Greatly improves the handling of mixed implicit objects, implicit function calls, and implicit indentation. String and regex interpolation is now strictly Bugfix release for 0.9.1. Greatly improves the handling of mixed implicit objects, implicit function calls, and implicit indentation. String and regex interpolation is now strictly The CoffeeScript 0.9 series is considered to be a release candidate for 1.0; let’s give her a shakedown cruise. 0.9.0 introduces a massive backwards-incompatible change: Assignment now uses The CoffeeScript 0.9 series is considered to be a release candidate for 1.0; let’s give her a shakedown cruise. 0.9.0 introduces a massive backwards-incompatible change: Assignment now uses Quick bugfix (right after 0.7.1) for a problem that prevented Quick bugfix (right after 0.7.1) for a problem that prevented Block-style comments are now passed through and printed as JavaScript block comments – making them useful for licenses and copyright headers. Better support for running coffee scripts standalone via hashbangs. Improved syntax errors for tokens that are not in the grammar. Block-style comments are now passed through and printed as JavaScript block comments – making them useful for licenses and copyright headers. Better support for running coffee scripts standalone via hashbangs. Improved syntax errors for tokens that are not in the grammar. Official CoffeeScript variable style is now camelCase, as in JavaScript. Reserved words are now allowed as object keys, and will be quoted for you. Range comprehensions now generate cleaner code, but you have to specify Official CoffeeScript variable style is now camelCase, as in JavaScript. Reserved words are now allowed as object keys, and will be quoted for you. Range comprehensions now generate cleaner code, but you have to specify The The Upgraded CoffeeScript for compatibility with the new Node.js v0.1.90 series. Upgraded CoffeeScript for compatibility with the new Node.js v0.1.90 series. Trailing commas are now allowed, a-la Python. Static properties may be assigned directly within class definitions, using Trailing commas are now allowed, a-la Python. Static properties may be assigned directly within class definitions, using Interpolation can now be used within regular expressions and heredocs, as well as strings. Added the Interpolation can now be used within regular expressions and heredocs, as well as strings. Added the String interpolation, contributed by Stan Angeloff. Since String interpolation, contributed by Stan Angeloff. Since Bugfix that corrects the Node.js global constants Bugfix that corrects the Node.js global constants CoffeeScript now has a syntax for defining classes. Many of the core components (Nodes, Lexer, Rewriter, Scope, Optparse) are using them. Cakefiles can use CoffeeScript now has a syntax for defining classes. Many of the core components (Nodes, Lexer, Rewriter, Scope, Optparse) are using them. Cakefiles can use Added a compressed version of the compiler for inclusion in web pages as
+ Added a compressed version of the compiler for inclusion in web pages as
Improvements to null soaking with the existential operator, including soaks on indexed properties. Added conditions to Improvements to null soaking with the existential operator, including soaks on indexed properties. Added conditions to CoffeeScript 0.5.0 is a major release, While there are no language changes, the Ruby compiler has been removed in favor of a self-hosting compiler written in pure CoffeeScript. CoffeeScript 0.5.0 is a major release, While there are no language changes, the Ruby compiler has been removed in favor of a self-hosting compiler written in pure CoffeeScript. CoffeeScript 0.3 includes major syntax changes:
+ CoffeeScript 0.3 includes major syntax changes:
The function symbol was changed to Added Python-style chained comparisons, the conditional existence operator Added Python-style chained comparisons, the conditional existence operator The conditions in switch statements can now take multiple values at once — If any of them are true, the case will run. Added the long arrow The conditions in switch statements can now take multiple values at once — If any of them are true, the case will run. Added the long arrow Added ECMAScript Harmony style destructuring assignment, for dealing with extracting values from nested arrays and objects. Added indentation-sensitive heredocs for nicely formatted strings or chunks of code. Added ECMAScript Harmony style destructuring assignment, for dealing with extracting values from nested arrays and objects. Added indentation-sensitive heredocs for nicely formatted strings or chunks of code. Axed the unsatisfactory Axed the unsatisfactory When performing a comprehension over an object, use When performing a comprehension over an object, use Arguments objects are now converted into real arrays when referenced. Arguments objects are now converted into real arrays when referenced. 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. Bugfix for running Bugfix for running Array slice literals and array comprehensions can now both take Ruby-style ranges to specify the start and end. JavaScript variable declaration is now pushed up to the top of the scope, making all assignment statements into expressions. You can use Array slice literals and array comprehensions can now both take Ruby-style ranges to specify the start and end. JavaScript variable declaration is now pushed up to the top of the scope, making all assignment statements into expressions. You can use The official CoffeeScript extension is now The official CoffeeScript extension is now The The Fixed a bug with calling Fixed a bug with calling Added Added Initial CoffeeScript release. Initial CoffeeScript release. Fixes for block comment formatting, Bugfix release for classes with external constructor functions, see issue #1182. When running via the Fixed a lexer bug with Unicode identifiers. Updated REPL for compatibility with Node.js 0.3.7. Fixed requiring relative paths in the REPL. Trailing CoffeeScript loops no longer try to preserve block scope when functions are being generated within the loop body. Instead, you can use the The REPL now properly formats stacktraces, and stays alive through asynchronous exceptions. Using 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. CoffeeScript now uses appropriately-named temporary variables, and recycles their references after use. Added CoffeeScript Specifying the start and end of a range literal is now optional, eg. Bugfix release for 0.9.1. Greatly improves the handling of mixed implicit objects, implicit function calls, and implicit indentation. String and regex interpolation is now strictly The CoffeeScript 0.9 series is considered to be a release candidate for 1.0; let’s give her a shakedown cruise. 0.9.0 introduces a massive backwards-incompatible change: Assignment now uses Quick bugfix (right after 0.7.1) for a problem that prevented Block-style comments are now passed through and printed as JavaScript block comments – making them useful for licenses and copyright headers. Better support for running coffee scripts standalone via hashbangs. Improved syntax errors for tokens that are not in the grammar. Official CoffeeScript variable style is now camelCase, as in JavaScript. Reserved words are now allowed as object keys, and will be quoted for you. Range comprehensions now generate cleaner code, but you have to specify The Upgraded CoffeeScript for compatibility with the new Node.js v0.1.90 series. Trailing commas are now allowed, a-la Python. Static properties may be assigned directly within class definitions, using Interpolation can now be used within regular expressions and heredocs, as well as strings. Added the String interpolation, contributed by Stan Angeloff. Since Bugfix that corrects the Node.js global constants CoffeeScript now has a syntax for defining classes. Many of the core components (Nodes, Lexer, Rewriter, Scope, Optparse) are using them. Cakefiles can use Added a compressed version of the compiler for inclusion in web pages as
Improvements to null soaking with the existential operator, including soaks on indexed properties. Added conditions to CoffeeScript 0.5.0 is a major release, While there are no language changes, the Ruby compiler has been removed in favor of a self-hosting compiler written in pure CoffeeScript. CoffeeScript 0.3 includes major syntax changes:
The function symbol was changed to
+
+
"""
codeFor = require "./documentation/site/code.coffee"
diff --git a/docs/v2/index.html b/docs/v2/index.html
index 688a7770c3..548ada16bc 100644
--- a/docs/v2/index.html
+++ b/docs/v2/index.html
@@ -5519,54 +5519,48 @@
#{prevVersion and "#{version}" or version}
-
Argument parsing and shebang (
#!) linesChangelog
-
-
+
2.3.0
-
+
-
-yield an await call, e.g. do -> until file.EOF then yield await file.readLine().{a, b, rest...} = obj now outputs more or less just like it appears, rather than being converted into an Object.assign call. Note that there are some subtle differences between the Object.assign polyfill and the native implementation.**, and exponentiation assignment operator **= are new to JavaScript in ES2018. Now code like a ** 3 is output as it appears, rather than being converted into Math.pow(a, 3) as it was before.s (dotAll) flag is now supported in regular expressions.
+
2.2.4
-
+
-
-by value in a for loop is a literal number, e.g. for x in [2..1] by -1, fewer checks are necessary to determine if the loop is in range.(fn(); break) while condition, was compiling. Pure statements like break or return cannot turn a parenthesized block into an expression, and should throw an error.
+
2.2.3
-
+
-
-{ key: [] } = obj.this: [ @most... , @penultimate, @last ] = arr.
+
2.2.2
-
+
-
-by (step) value that increments or decrements in the opposite direction as the range was returning an array containing the first value of the range, whereas it should be returning an empty array. In other words, x for x in [2..1] by 1 should equal [], not [2] (because the step value is positive 1, counting up, whereas the range goes from 2 to 1, counting down).import and export statements and lines that trigger the start of an indented block, like an if statement.
+
2.2.1
-
+
-
-
+
2.2.0
-
+
-
-if or switch statement with an ambiguous else, such as if no then if yes then alert 1 else alert 2, now compiles where the else always corresponds to the closest open then. Previously the behavior of an ambiguous else was unpredictable. If your code has any if … then or switch … then statements with multiple thens (and one or more elses) the compiled output might be different now, unless you had resolved ambiguity via parentheses. We made this change because the previous behavior was inconsistent and basically a bug: depending on what grammar was where, for example if there was an inline function or something that implied a block, the else might bind to an earlier then rather than a later then. Now an else essentially closes a block opened by a then, similar to closing an open parenthesis.then is missing, the error more accurately points out the location of the mistake.
a[!b in c..].\) at any point in a for line.
+
2.1.1
-
+
-
-class @B extends @A then @property = 1, the @ in @property now refers to the class, not the global object.
+
2.1.0
-
+
-
-obj = { ['key' + i]: 42 }, or obj = [Symbol.iterator]: -> yield i++.arr = [a, , b], or [, protocol] = url.match /^(.*):\/\//./// within a # line comment inside a /// block regex was erroneously closing the regex, rather than being treated as part of the comment.
+
2.0.3
-
+
-
-export default followed by an implicit object that contains an explicit object, for example exportedMember: { obj... }.key, val of obj after an implicit object member, e.g. foo: bar for key, val of obj.[ ..., {a, b} ] = arr.
--transpile with --map for multiple input files.coffee --interactive).
+
2.0.2
-
+
-
---transpile now also applies to required or imported CoffeeScript files.--transpile can be used with the REPL: coffee --interactive --transpile.### comments near variable initial assignments are now output in the variable declaration statement, and ### comments near a class and method names are now output where Flow expects them.
? operation, e.g. @a ? b.
+
2.0.1
-
+
-
-babel-core is no longer listed in package.json, even as an optionalDependency, to avoid it being automatically installed for most users. If you wish to use --transpile, simply install babel-core manually. See Transpilation.--transpile now relies on Babel to find its options, i.e. the .babelrc file in the path of the file(s) being compiled. (Previously the CoffeeScript compiler was duplicating this logic, so nothing has changed from a user’s perspective.) This provides automatic support for additional ways to pass options to Babel in future versions, such as the .babelrc.js file coming in Babel 7.
+
2.0.0
-
+
-
---transpile flag or transpile Node API option to tell the CoffeeScript compiler to pipe its output through Babel before saving or returning it; see Transpilation. Also changed the -t short flag to refer to --transpile instead of --tokens.sourcesContent property.
+
2.0.0-beta5
-
+
-
-coffee command or Node API. Older versions of Node, or non-evergreen browsers, can compile via the browser compiler.--output flag now allows you to specify an output filename, not just an output folder.--require flag now properly handles filenames or module names that are invalid identifiers (like an NPM module with a hyphen in the name).
= and other “mid-expression” tokens; spaces after ::; and scripts that begin with : or *..coffee file.
+
2.0.0-beta4
-
+
-
-#) are now output in the generated JavaScript.###) are now allowed anywhere, including inline where they previously weren’t possible. This provides support for static type annotations using Flow’s comments-based syntax.
+
1.12.7
-
+
-
-return and throw arguments._.
+
2.0.0-beta3
-
+
-
-_.
+
2.0.0-beta2
-
+
-
-super() if the class is extending a parent class. See breaking changes for classes.indexOf and bind.
@get or @set no longer throws an error about required parentheses. (Bare get or set, not attached to an object or @, still intentionally throws a compiler error.)$XDG_CACHE_HOME is set, the REPL .coffee_history file is saved there.
+
1.12.6
-
+
-
-return and export keywords can now accept implicit objects (defined by indentation, without needing braces).\u{1F4A9}).coffee command now first looks to see if CoffeeScript is installed under node_modules in the current folder, and executes the coffee binary there if so; or otherwise it runs the globally installed one. This allows you to have one version of CoffeeScript installed globally and a different one installed locally for a particular project. (Likewise for the cake command.)
? operator within a termary if statement.
+
2.0.0-beta1
-
+
-
-get or set now requires parentheses, to disambiguate from the get or set keywords (which are disallowed).
+
1.12.5
-
+
-
-default, from, as and * within import and export statements. You can now import or export a member named default and the compiler won’t interpret it as the default keyword.
+
2.0.0-alpha1
-
+
-
-class and extends keywords.async/await.
+
1.12.4
-
+
-
-cake commands have been updated, with new watch options for most tasks. Clone the CoffeeScript repo and run cake at the root of the repo to see the options.exporting a referenced variable was preventing the variable from being declared.coffee command wasn’t working for a .litcoffee file.
+
1.12.3
-
+
-
-@ values can now be used as indices in for expressions. This loosens the compilation of for expressions to allow the index variable to be an @ value, e.g. do @visit for @node, @index in nodes. Within @visit, the index of the current node (@node) would be available as @index.Error.prepareStackTrace has been restored, with some revisions that should prevent the erroneous exceptions that were making life difficult for some downstream projects. This fixes the incorrect line numbers in stack traces since 1.12.2.//= operator’s output now wraps parentheses around the right operand, like the other assignment operators.
+
1.12.2
-
+
-
-MINIFY=false cake build:browser.Error.prepareStackTrace has been removed.
+
1.12.1
-
+
-
-default, e.g. import { default } from 'lib'. Though like in ES2015, you cannot import an entire module and name it default (so import default from 'lib' is not allowed).from as a variable name was breaking for loop declarations. For the record, from is not a reserved word in CoffeeScript; you may use it for variable names. from behaves like a keyword within the context of import and export statements, and in the declaration of a for loop; though you should also be able to use variables named from in those contexts, and the compiler should be able to tell the difference.
+
1.12.0
-
+
-
-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.```) 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.
+
1.11.1
-
+
-
-""" strings.2e308 (just like all other large number literals do).
+
1.11.0
-
+
-
-
import and export syntax.-M, --inline-map flag to the compiler, allowing you embed the source map directly into the output JavaScript, rather than as a separate file.yield:
@@ -5869,11 +5841,10 @@
+
1.10.0
-
+
-
-
(offsetHeight: height) -> no longer compiles. That syntax was accidental and partly broken. Use ({offsetHeight: height}) -> instead. Object destructuring always requires braces.
+
1.9.3
-
+
-
---bare option. This has the nice side effect of generating smaller source maps.on, off, yes and no.
+
1.9.2
-
+
-
-yield around expressions containing this.-r option to the REPL, which allows requiring a module before execution with --eval or --interactive.<script type="text/coffeescript"> tags, to avoid possible duplicate browser requests for .coffee files, you can now use the data-src attribute instead of src.
+
1.9.1
-
+
-
-yield-related edge cases with yield return and yield throw.
+
1.9.0
-
+
-
-yields.@example function parameters are no longer available as naked example variables within the function body.
+
1.8.0
-
+
-
---join option of the CLI is now deprecated..js.map as file extension, instead of just .map.
require 'coffeescript/repl'.
+
1.7.1
-
+
-
-coffee binary.
+
1.7.0
-
+
-
-require 'coffeescript/register' or CoffeeScript.register(). Also for configuration such as Mocha’s, use coffeescript/register.//# syntax.. now closes all open calls, allowing for simpler chaining syntax.
-p folders on Windows.options object passed to CoffeeScript is no longer mutated.
+
1.6.3
-
+
-
-require in Node to load .coffee.md Literate CoffeeScript files. In the browser, text/literate-coffeescript script tags.coffee --lint command has been removed. It was useful while originally working on the compiler, but has been surpassed by JSHint. You may now use -l to pass literate files in over stdio.catch without naming the error, and executable-class-bodies-with- prototypal-property-attachment.
+
1.6.2
-
+
-
-coffee command, and for automatic line-mapping when running CoffeeScript directly in the browser. Also, to provide better error messages for semantic errors thrown by the compiler — with colors, even.coffee command can now correctly fork() both .coffee and .js files. (Requires Node.js 0.9+)
+
1.6.1
-
+
-
---map flag to the compiler, and off you go. Direct all your thanks over to Jason Walton..coffee.md is now also supported as a Literate CoffeeScript file extension, for existing tooling. .litcoffee remains the canonical one.super in class declarations.
+
1.5.0
-
+
-
-for item in list by -1
+
1.4.0
-
+
-
-registerExtension, and moving from path.exists to fs.exists.
+
1.3.3
-
+
-
-super more reliably (walks recursively up).
+
1.3.1
-
+
-
-eval or arguments, and more. See a full discussion at #1547.Ctrl-V. You may also now pipe input directly into the REPL.Generated by CoffeeScript VERSION header at the top of each compiled file.
coffee --watch under Node’s “new” file watching API. Watch will now beep by default if you introduce a syntax error into a watched script. We also now ignore hidden directories by default when watching recursively.
+
1.2.0
-
+
-
-coffee --watch and --join. You may now use both together, as well as add and remove files and directories within a --watch’d folder.throw statement can now be used as part of an expression.this.
+
1.1.3
-
+
-
-super in class level methods in class bodies, and bound class methods now preserve their correct context.010 is 8, and hexadecimal numbers 0xf is 15, but CoffeeScript now also supports binary numbers: 0b10 is 2.
coffee --watch feature now only works on Node.js 0.6.0 and higher, but now also works properly on Windows.
+
1.1.2
-
?= compilation, implicit calls against control structures, implicit invocation of a try/catch block, variadic arguments leaking from local scope, line numbers in syntax errors following heregexes, property access on parenthesized number literals, bound class methods and super with reserved names, a REPL overhaul, consecutive compiled semicolons, block comments in implicitly called objects, and a Chrome bug.
+
?= compilation, implicit calls against control structures, implicit invocation of a try/catch block, variadic arguments leaking from local scope, line numbers in syntax errors following heregexes, property access on parenthesized number literals, bound class methods and super with reserved names, a REPL overhaul, consecutive compiled semicolons, block comments in implicitly called objects, and a Chrome bug.
1.1.1
-
+
1.1.0
-
coffee executable, process.argv and friends now report coffee instead of node. Better compatibility with Node.js 0.4.x module lookup changes. The output in the REPL is now colorized, like Node’s is. Giving your concatenated CoffeeScripts a name when using --join is now mandatory. Fix for lexing compound division /= as a regex accidentally. All text/coffeescript tags should now execute in the order they’re included. Fixed an issue with extended subclasses using external constructor functions. Fixed an edge-case infinite loop in addImplicitParentheses. Fixed exponential slowdown with long chains of function calls. Globals no longer leak into the CoffeeScript REPL. Splatted parameters are declared local to the function.
+
coffee executable, process.argv and friends now report coffee instead of node. Better compatibility with Node.js 0.4.x module lookup changes. The output in the REPL is now colorized, like Node’s is. Giving your concatenated CoffeeScripts a name when using --join is now mandatory. Fix for lexing compound division /= as a regex accidentally. All text/coffeescript tags should now execute in the order they’re included. Fixed an issue with extended subclasses using external constructor functions. Fixed an edge-case infinite loop in addImplicitParentheses. Fixed exponential slowdown with long chains of function calls. Globals no longer leak into the CoffeeScript REPL. Splatted parameters are declared local to the function.
1.0.1
-
return and return undefined are now optimized away. Stopped requiring the core Node.js util module for back-compatibility with Node.js 0.2.5. Fixed a case where a conditional return would cause fallthrough in a switch statement. Optimized empty objects in destructuring assignment.
+
return and return undefined are now optimized away. Stopped requiring the core Node.js util module for back-compatibility with Node.js 0.2.5. Fixed a case where a conditional return would cause fallthrough in a switch statement. Optimized empty objects in destructuring assignment.
1.0.0
-
do keyword to create a convenient closure wrapper. Added a --nodejs flag for passing through options directly to the node executable. Better behavior around the use of pure statements within expressions. Fixed inclusive slicing through -1, for all browsers, and splicing with arbitrary expressions as endpoints.
+
do keyword to create a convenient closure wrapper. Added a --nodejs flag for passing through options directly to the node executable. Better behavior around the use of pure statements within expressions. Fixed inclusive slicing through -1, for all browsers, and splicing with arbitrary expressions as endpoints.
0.9.6
-
--watch now prints timestamps as files are compiled. Fixed some accidentally-leaking variables within plucked closure-loops. Constructors now maintain their declaration location within a class body. Dynamic object keys were removed. Nested classes are now supported. Fixes execution context for naked splatted functions. Bugfix for inversion of chained comparisons. Chained class instantiation now works properly with splats.
+
--watch now prints timestamps as files are compiled. Fixed some accidentally-leaking variables within plucked closure-loops. Constructors now maintain their declaration location within a class body. Dynamic object keys were removed. Nested classes are now supported. Fixes execution context for naked splatted functions. Bugfix for inversion of chained comparisons. Chained class instantiation now works properly with splats.
0.9.5
-
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
+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.
+
0.9.4
-
require.extensions support for Node.js 0.3. Loading CoffeeScript in the browser now adds just a single CoffeeScript object to global scope. Fixes for implicit object and block comment edge cases.
+
require.extensions support for Node.js 0.3. Loading CoffeeScript in the browser now adds just a single CoffeeScript object to global scope. Fixes for implicit object and block comment edge cases.
0.9.3
-
switch statements now compile into JS switch statements — they previously compiled into if/else chains for JavaScript 1.3 compatibility. Soaking a function invocation is now supported. Users of the RubyMine editor should now be able to use --watch mode.
+
switch statements now compile into JS switch statements — they previously compiled into if/else chains for JavaScript 1.3 compatibility. Soaking a function invocation is now supported. Users of the RubyMine editor should now be able to use --watch mode.
0.9.2
-
array[3..]. You can now say a not instanceof b. Fixed important bugs with nested significant and non-significant indentation (Issue #637). Added a --require flag that allows you to hook into the coffee command. Added a custom jsl.conf file for our preferred JavaScriptLint setup. Sped up Jison grammar compilation time by flattening rules for operations. Block comments can now be used with JavaScript-minifier-friendly syntax. Added JavaScript’s compound assignment bitwise operators. Bugfixes to implicit object literals with leading number and string keys, as the subject of implicit calls, and as part of compound assignment.
+
array[3..]. You can now say a not instanceof b. Fixed important bugs with nested significant and non-significant indentation (Issue #637). Added a --require flag that allows you to hook into the coffee command. Added a custom jsl.conf file for our preferred JavaScriptLint setup. Sped up Jison grammar compilation time by flattening rules for operations. Block comments can now be used with JavaScript-minifier-friendly syntax. Added JavaScript’s compound assignment bitwise operators. Bugfixes to implicit object literals with leading number and string keys, as the subject of implicit calls, and as part of compound assignment.
0.9.1
-
#{ … } (Ruby style). The compiler now takes a --require flag, which specifies scripts to run before compilation.
+
#{ … } (Ruby style). The compiler now takes a --require flag, which specifies scripts to run before compilation.
0.9.0
-
=, and object literals use :, as in JavaScript. This allows us to have implicit object literals, and YAML-style object definitions. Half assignments are removed, in favor of +=, or=, and friends. Interpolation now uses a hash mark # instead of the dollar sign $ — because dollar signs may be part of a valid JS identifier. Downwards range comprehensions are now safe again, and are optimized to straight for loops when created with integer endpoints. A fast, unguarded form of object comprehension was added: for all key, value of object. Mentioning the super keyword with no arguments now forwards all arguments passed to the function, as in Ruby. If you extend class B from parent class A, if A has an extended method defined, it will be called, passing in B — this enables static inheritance, among other things. Cleaner output for functions bound with the fat arrow. @variables can now be used in parameter lists, with the parameter being automatically set as a property on the object — useful in constructors and setter functions. Constructor functions can now take splats.
+
=, and object literals use :, as in JavaScript. This allows us to have implicit object literals, and YAML-style object definitions. Half assignments are removed, in favor of +=, or=, and friends. Interpolation now uses a hash mark # instead of the dollar sign $ — because dollar signs may be part of a valid JS identifier. Downwards range comprehensions are now safe again, and are optimized to straight for loops when created with integer endpoints. A fast, unguarded form of object comprehension was added: for all key, value of object. Mentioning the super keyword with no arguments now forwards all arguments passed to the function, as in Ruby. If you extend class B from parent class A, if A has an extended method defined, it will be called, passing in B — this enables static inheritance, among other things. Cleaner output for functions bound with the fat arrow. @variables can now be used in parameter lists, with the parameter being automatically set as a property on the object — useful in constructors and setter functions. Constructor functions can now take splats.
0.7.2
-
coffee command-line options from being parsed in some circumstances.
+
coffee command-line options from being parsed in some circumstances.
0.7.1
-
+
0.7.0
-
by -1 if you’d like to iterate downward. Reporting of syntax errors is greatly improved from the previous release. Running coffee with no arguments now launches the REPL, with Readline support. The <- bind operator has been removed from CoffeeScript. The loop keyword was added, which is equivalent to a while true loop. Comprehensions that contain closures will now close over their variables, like the semantics of a forEach. You can now use bound function in class definitions (bound to the instance). For consistency, a in b is now an array presence check, and a of b is an object-key check. Comments are no longer passed through to the generated JavaScript.
+
by -1 if you’d like to iterate downward. Reporting of syntax errors is greatly improved from the previous release. Running coffee with no arguments now launches the REPL, with Readline support. The <- bind operator has been removed from CoffeeScript. The loop keyword was added, which is equivalent to a while true loop. Comprehensions that contain closures will now close over their variables, like the semantics of a forEach. You can now use bound function in class definitions (bound to the instance). For consistency, a in b is now an array presence check, and a of b is an object-key check. Comments are no longer passed through to the generated JavaScript.
0.6.2
-
coffee command will now preserve directory structure when compiling a directory full of scripts. Fixed two omissions that were preventing the CoffeeScript compiler from running live within Internet Explorer. There’s now a syntax for block comments, similar in spirit to CoffeeScript’s heredocs. ECMA Harmony DRY-style pattern matching is now supported, where the name of the property is the same as the name of the value: {name, length}: func. Pattern matching is now allowed within comprehension variables. unless is now allowed in block form. until loops were added, as the inverse of while loops. switch statements are now allowed without switch object clauses. Compatible with Node.js v0.1.95.
+
coffee command will now preserve directory structure when compiling a directory full of scripts. Fixed two omissions that were preventing the CoffeeScript compiler from running live within Internet Explorer. There’s now a syntax for block comments, similar in spirit to CoffeeScript’s heredocs. ECMA Harmony DRY-style pattern matching is now supported, where the name of the property is the same as the name of the value: {name, length}: func. Pattern matching is now allowed within comprehension variables. unless is now allowed in block form. until loops were added, as the inverse of while loops. switch statements are now allowed without switch object clauses. Compatible with Node.js v0.1.95.
0.6.1
-
+
0.6.0
-
@property notation.
+
@property notation.
0.5.6
-
<- bind operator. Allowing assignment to half-expressions instead of special ||=-style operators. The arguments object is no longer automatically converted into an array. After requiring coffeescript, Node.js can now directly load .coffee files, thanks to registerExtension. Multiple splats can now be used in function calls, arrays, and pattern matching.
+
<- bind operator. Allowing assignment to half-expressions instead of special ||=-style operators. The arguments object is no longer automatically converted into an array. After requiring coffeescript, Node.js can now directly load .coffee files, thanks to registerExtension. Multiple splats can now be used in function calls, arrays, and pattern matching.
0.5.5
-
--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.
+
--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
-
__filename and __dirname. Tweaks for more flexible parsing of nested function literals and improperly-indented comments. Updates for the latest Node.js API.
+
__filename and __dirname. Tweaks for more flexible parsing of nested function literals and improperly-indented comments. Updates for the latest Node.js API.
0.5.3
-
optparse.coffee to define options for tasks. --run is now the default flag for the coffee command, use --compile to save JavaScripts. Bugfix for an ambiguity between RegExp literals and chained divisions.
+
optparse.coffee to define options for tasks. --run is now the default flag for the coffee command, use --compile to save JavaScripts. Bugfix for an ambiguity between RegExp literals and chained divisions.
0.5.2
-
/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
-
while loops, so you can use them as filters with when, in the same manner as comprehensions.
+
while loops, so you can use them as filters with when, in the same manner as comprehensions.
0.5.0
-
+
0.3.2
-
@property is now a shorthand for this.property.
+@property is now a shorthand for this.property.
Switched the default JavaScript engine from Narwhal to Node.js. Pass the --narwhal flag if you’d like to continue using it.
+
0.3.0
-
->, and the bound function symbol is now =>.
Parameter lists in function definitions must now be wrapped in parentheses.
Added property soaking, with the ?. operator.
Made parentheses optional, when invoking functions with arguments.
Removed the obsolete block literal syntax.
+
0.2.6
-
?=, and some examples from Beautiful Code. Bugfixes relating to statement-to-expression conversion, arguments-to-array conversion, and the TextMate syntax highlighter.
+
?=, and some examples from Beautiful Code. Bugfixes relating to statement-to-expression conversion, arguments-to-array conversion, and the TextMate syntax highlighter.
0.2.5
-
==>, which defines and immediately binds a function to this. While loops can now be used as expressions, in the same way that comprehensions can. Splats can be used within pattern matches to soak up the rest of an array.
+
==>, which defines and immediately binds a function to this. While loops can now be used as expressions, in the same way that comprehensions can. Splats can be used within pattern matches to soak up the rest of an array.
0.2.4
-
+
0.2.3
-
ino keyword, replacing it with of for object comprehensions. They now look like: for prop, value of object.
+
ino keyword, replacing it with of for object comprehensions. They now look like: for prop, value of object.
0.2.2
-
ino, instead of in, which helps us generate smaller, more efficient code at compile time.
+ino, instead of in, which helps us generate smaller, more efficient code at compile time.
Added :: as a shorthand for saying .prototype.
The “splat” symbol has been changed from a prefix asterisk *, to a postfix ellipsis ...
Added JavaScript’s in operator, empty return statements, and empty while loops.
Constructor functions that start with capital letters now include a safety check to make sure that the new instance of the object is returned.
The extends keyword now functions identically to goog.inherits in Google’s Closure Library.
+
0.2.1
-
+
0.2.0
-
+
0.1.6
-
coffee --interactive and --run from outside of the CoffeeScript directory. Bugfix for nested function/if-statements.
+
coffee --interactive and --run from outside of the CoffeeScript directory. Bugfix for nested function/if-statements.
0.1.5
-
\ to escape newlines. The coffeescript command is now called coffee.
+
\ to escape newlines. The coffeescript command is now called coffee.
0.1.4
-
.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.
+
.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
-
coffee command now includes --interactive, which launches an interactive CoffeeScript session, and --run, which directly compiles and executes a script. Both options depend on a working installation of Narwhal. The aint keyword has been replaced by isnt, which goes together a little smoother with is. Quoted strings are now allowed as identifiers within object literals: eg. {"5+5": 10}. All assignment operators now use a colon: +:, -:, *:, etc.
+
coffee command now includes --interactive, which launches an interactive CoffeeScript session, and --run, which directly compiles and executes a script. Both options depend on a working installation of Narwhal. The aint keyword has been replaced by isnt, which goes together a little smoother with is. Quoted strings are now allowed as identifiers within object literals: eg. {"5+5": 10}. All assignment operators now use a colon: +:, -:, *:, etc.
0.1.2
-
super() through more than one level of inheritance, with the re-addition of the extends keyword. Added experimental Narwhal support (as a Tusk package), contributed by Tom Robinson, including bin/cs as a CoffeeScript REPL and interpreter. New --no-wrap option to suppress the safety function wrapper.
+
super() through more than one level of inheritance, with the re-addition of the extends keyword. Added experimental Narwhal support (as a Tusk package), contributed by Tom Robinson, including bin/cs as a CoffeeScript REPL and interpreter. New --no-wrap option to suppress the safety function wrapper.
0.1.1
-
instanceof and typeof as operators.
+
instanceof and typeof as operators.
0.1.0
-
#{prevVersion and "#{version}" or version}
-
+
"""
diff --git a/docs/v2/index.html b/docs/v2/index.html
index 548ada16bc..0d478a7a6f 100644
--- a/docs/v2/index.html
+++ b/docs/v2/index.html
@@ -5521,7 +5521,7 @@ Argument parsing and shebang (
#!) linesChangelog
2.3.0
-
+
yield an await call, e.g. do -> until file.EOF then yield await file.readLine().
2.2.4
-
+
by value in a for loop is a literal number, e.g. for x in [2..1] by -1, fewer checks are necessary to determine if the loop is in range.(fn(); break) while condition, was compiling. Pure statements like break or return cannot turn a parenthesized block into an expression, and should throw an error.
2.2.3
-
+
{ key: [] } = obj.this: [ @most... , @penultimate, @last ] = arr.
2.2.2
-
+
by (step) value that increments or decrements in the opposite direction as the range was returning an array containing the first value of the range, whereas it should be returning an empty array. In other words, x for x in [2..1] by 1 should equal [], not [2] (because the step value is positive 1, counting up, whereas the range goes from 2 to 1, counting down).import and export statements and lines that trigger the start of an indented block, like an if statement.
2.2.1
-
+
2.2.0
-
+
if or switch statement with an ambiguous else, such as if no then if yes then alert 1 else alert 2, now compiles where the else always corresponds to the closest open then. Previously the behavior of an ambiguous else was unpredictable. If your code has any if … then or switch … then statements with multiple thens (and one or more elses) the compiled output might be different now, unless you had resolved ambiguity via parentheses. We made this change because the previous behavior was inconsistent and basically a bug: depending on what grammar was where, for example if there was an inline function or something that implied a block, the else might bind to an earlier then rather than a later then. Now an else essentially closes a block opened by a then, similar to closing an open parenthesis.
2.1.1
-
+
class @B extends @A then @property = 1, the @ in @property now refers to the class, not the global object.
2.1.0
-
+
obj = { ['key' + i]: 42 }, or obj = [Symbol.iterator]: -> yield i++.arr = [a, , b], or [, protocol] = url.match /^(.*):\/\//.
2.0.3
-
+
export default followed by an implicit object that contains an explicit object, for example exportedMember: { obj... }.key, val of obj after an implicit object member, e.g. foo: bar for key, val of obj.
2.0.2
-
+
--transpile now also applies to required or imported CoffeeScript files.--transpile can be used with the REPL: coffee --interactive --transpile.
2.0.1
-
+
babel-core is no longer listed in package.json, even as an optionalDependency, to avoid it being automatically installed for most users. If you wish to use --transpile, simply install babel-core manually. See Transpilation.--transpile now relies on Babel to find its options, i.e. the .babelrc file in the path of the file(s) being compiled. (Previously the CoffeeScript compiler was duplicating this logic, so nothing has changed from a user’s perspective.) This provides automatic support for additional ways to pass options to Babel in future versions, such as the .babelrc.js file coming in Babel 7.
2.0.0
-
+
--transpile flag or transpile Node API option to tell the CoffeeScript compiler to pipe its output through Babel before saving or returning it; see Transpilation. Also changed the -t short flag to refer to --transpile instead of --tokens.sourcesContent property.
2.0.0-beta5
-
+
coffee command or Node API. Older versions of Node, or non-evergreen browsers, can compile via the browser compiler.--output flag now allows you to specify an output filename, not just an output folder.
2.0.0-beta4
-
+
#) are now output in the generated JavaScript.
1.12.7
-
+
return and throw arguments._.
2.0.0-beta3
-
+
2.0.0-beta2
-
+
super() if the class is extending a parent class. See breaking changes for classes.
1.12.6
-
+
return and export keywords can now accept implicit objects (defined by indentation, without needing braces).\u{1F4A9}).
2.0.0-beta1
-
+
1.12.5
-
+
default, from, as and * within import and export statements. You can now import or export a member named default and the compiler won’t interpret it as the default keyword.
2.0.0-alpha1
-
+
class and extends keywords.
1.12.4
-
+
cake commands have been updated, with new watch options for most tasks. Clone the CoffeeScript repo and run cake at the root of the repo to see the options.exporting a referenced variable was preventing the variable from being declared.
1.12.3
-
+
@ values can now be used as indices in for expressions. This loosens the compilation of for expressions to allow the index variable to be an @ value, e.g. do @visit for @node, @index in nodes. Within @visit, the index of the current node (@node) would be available as @index.Error.prepareStackTrace has been restored, with some revisions that should prevent the erroneous exceptions that were making life difficult for some downstream projects. This fixes the incorrect line numbers in stack traces since 1.12.2.
1.12.2
-
+
MINIFY=false cake build:browser.Error.prepareStackTrace has been removed.
1.12.1
-
+
default, e.g. import { default } from 'lib'. Though like in ES2015, you cannot import an entire module and name it default (so import default from 'lib' is not allowed).from as a variable name was breaking for loop declarations. For the record, from is not a reserved word in CoffeeScript; you may use it for variable names. from behaves like a keyword within the context of import and export statements, and in the declaration of a for loop; though you should also be able to use variables named from in those contexts, and the compiler should be able to tell the difference.
1.12.0
-
+
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.
1.11.1
-
+
""" strings.
1.11.0
-
+
import and export syntax.-M, --inline-map flag to the compiler, allowing you embed the source map directly into the output JavaScript, rather than as a separate file.
1.10.0
-
+
(offsetHeight: height) -> no longer compiles. That syntax was accidental and partly broken. Use ({offsetHeight: height}) -> instead. Object destructuring always requires braces.
1.9.3
-
+
1.9.2
-
+
yield around expressions containing this.
1.9.1
-
+
1.9.0
-
+
yields.
1.8.0
-
+
--join option of the CLI is now deprecated..js.map as file extension, instead of just .map.
1.7.1
-
+
coffee binary.
1.7.0
-
+
require 'coffeescript/register' or CoffeeScript.register(). Also for configuration such as Mocha’s, use coffeescript/register.//# syntax.
1.6.3
-
+
require in Node to load .coffee.md Literate CoffeeScript files. In the browser, text/literate-coffeescript script tags.
1.6.2
-
+
coffee command, and for automatic line-mapping when running CoffeeScript directly in the browser. Also, to provide better error messages for semantic errors thrown by the compiler — with colors, even.
1.6.1
-
+
--map flag to the compiler, and off you go. Direct all your thanks over to Jason Walton.
1.5.0
-
+
1.4.0
-
+
registerExtension, and moving from path.exists to fs.exists.
1.3.3
-
+
super more reliably (walks recursively up).
1.3.1
-
+
eval or arguments, and more. See a full discussion at #1547.Ctrl-V. You may also now pipe input directly into the REPL.
1.2.0
-
+
coffee --watch and --join. You may now use both together, as well as add and remove files and directories within a --watch’d folder.throw statement can now be used as part of an expression.
1.1.3
-
+
super in class level methods in class bodies, and bound class methods now preserve their correct context.
1.1.2
-
+
?= compilation, implicit calls against control structures, implicit invocation of a try/catch block, variadic arguments leaking from local scope, line numbers in syntax errors following heregexes, property access on parenthesized number literals, bound class methods and super with reserved names, a REPL overhaul, consecutive compiled semicolons, block comments in implicitly called objects, and a Chrome bug.
1.1.1
-
+
1.1.0
-
+
coffee executable, process.argv and friends now report coffee instead of node. Better compatibility with Node.js 0.4.x module lookup changes. The output in the REPL is now colorized, like Node’s is. Giving your concatenated CoffeeScripts a name when using --join is now mandatory. Fix for lexing compound division /= as a regex accidentally. All text/coffeescript tags should now execute in the order they’re included. Fixed an issue with extended subclasses using external constructor functions. Fixed an edge-case infinite loop in addImplicitParentheses. Fixed exponential slowdown with long chains of function calls. Globals no longer leak into the CoffeeScript REPL. Splatted parameters are declared local to the function.
1.0.1
-
+
return and return undefined are now optimized away. Stopped requiring the core Node.js util module for back-compatibility with Node.js 0.2.5. Fixed a case where a conditional return would cause fallthrough in a switch statement. Optimized empty objects in destructuring assignment.
1.0.0
-
+
do keyword to create a convenient closure wrapper. Added a --nodejs flag for passing through options directly to the node executable. Better behavior around the use of pure statements within expressions. Fixed inclusive slicing through -1, for all browsers, and splicing with arbitrary expressions as endpoints.
0.9.6
-
+
--watch now prints timestamps as files are compiled. Fixed some accidentally-leaking variables within plucked closure-loops. Constructors now maintain their declaration location within a class body. Dynamic object keys were removed. Nested classes are now supported. Fixes execution context for naked splatted functions. Bugfix for inversion of chained comparisons. Chained class instantiation now works properly with splats.
0.9.5
-
+
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.
0.9.4
-
+
require.extensions support for Node.js 0.3. Loading CoffeeScript in the browser now adds just a single CoffeeScript object to global scope. Fixes for implicit object and block comment edge cases.
0.9.3
-
+
switch statements now compile into JS switch statements — they previously compiled into if/else chains for JavaScript 1.3 compatibility. Soaking a function invocation is now supported. Users of the RubyMine editor should now be able to use --watch mode.
0.9.2
-
+
array[3..]. You can now say a not instanceof b. Fixed important bugs with nested significant and non-significant indentation (Issue #637). Added a --require flag that allows you to hook into the coffee command. Added a custom jsl.conf file for our preferred JavaScriptLint setup. Sped up Jison grammar compilation time by flattening rules for operations. Block comments can now be used with JavaScript-minifier-friendly syntax. Added JavaScript’s compound assignment bitwise operators. Bugfixes to implicit object literals with leading number and string keys, as the subject of implicit calls, and as part of compound assignment.
0.9.1
-
+
#{ … } (Ruby style). The compiler now takes a --require flag, which specifies scripts to run before compilation.
0.9.0
-
+
=, and object literals use :, as in JavaScript. This allows us to have implicit object literals, and YAML-style object definitions. Half assignments are removed, in favor of +=, or=, and friends. Interpolation now uses a hash mark # instead of the dollar sign $ — because dollar signs may be part of a valid JS identifier. Downwards range comprehensions are now safe again, and are optimized to straight for loops when created with integer endpoints. A fast, unguarded form of object comprehension was added: for all key, value of object. Mentioning the super keyword with no arguments now forwards all arguments passed to the function, as in Ruby. If you extend class B from parent class A, if A has an extended method defined, it will be called, passing in B — this enables static inheritance, among other things. Cleaner output for functions bound with the fat arrow. @variables can now be used in parameter lists, with the parameter being automatically set as a property on the object — useful in constructors and setter functions. Constructor functions can now take splats.
0.7.2
-
+
coffee command-line options from being parsed in some circumstances.
0.7.1
-
+
0.7.0
-
+
by -1 if you’d like to iterate downward. Reporting of syntax errors is greatly improved from the previous release. Running coffee with no arguments now launches the REPL, with Readline support. The <- bind operator has been removed from CoffeeScript. The loop keyword was added, which is equivalent to a while true loop. Comprehensions that contain closures will now close over their variables, like the semantics of a forEach. You can now use bound function in class definitions (bound to the instance). For consistency, a in b is now an array presence check, and a of b is an object-key check. Comments are no longer passed through to the generated JavaScript.
0.6.2
-
+
coffee command will now preserve directory structure when compiling a directory full of scripts. Fixed two omissions that were preventing the CoffeeScript compiler from running live within Internet Explorer. There’s now a syntax for block comments, similar in spirit to CoffeeScript’s heredocs. ECMA Harmony DRY-style pattern matching is now supported, where the name of the property is the same as the name of the value: {name, length}: func. Pattern matching is now allowed within comprehension variables. unless is now allowed in block form. until loops were added, as the inverse of while loops. switch statements are now allowed without switch object clauses. Compatible with Node.js v0.1.95.
0.6.1
-
+
0.6.0
-
+
@property notation.
0.5.6
-
+
<- bind operator. Allowing assignment to half-expressions instead of special ||=-style operators. The arguments object is no longer automatically converted into an array. After requiring coffeescript, Node.js can now directly load .coffee files, thanks to registerExtension. Multiple splats can now be used in function calls, arrays, and pattern matching.
0.5.5
-
+
--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
-
+
__filename and __dirname. Tweaks for more flexible parsing of nested function literals and improperly-indented comments. Updates for the latest Node.js API.
0.5.3
-
+
optparse.coffee to define options for tasks. --run is now the default flag for the coffee command, use --compile to save JavaScripts. Bugfix for an ambiguity between RegExp literals and chained divisions.
0.5.2
-
+
/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
-
+
while loops, so you can use them as filters with when, in the same manner as comprehensions.
0.5.0
-
+
0.3.2
-
+
@property is now a shorthand for this.property.
Switched the default JavaScript engine from Narwhal to Node.js. Pass the --narwhal flag if you’d like to continue using it.
0.3.0
-
+
->, and the bound function symbol is now =>.
Parameter lists in function definitions must now be wrapped in parentheses.
@@ -6140,23 +6140,23 @@
Removed the obsolete block literal syntax.
Added Python-style chained comparisons, the conditional existence operator ?=, and some examples from Beautiful Code. Bugfixes relating to statement-to-expression conversion, arguments-to-array conversion, and the TextMate syntax highlighter.
The conditions in switch statements can now take multiple values at once — If any of them are true, the case will run. Added the long arrow ==>, which defines and immediately binds a function to this. While loops can now be used as expressions, in the same way that comprehensions can. Splats can be used within pattern matches to soak up the rest of an array.
Added ECMAScript Harmony style destructuring assignment, for dealing with extracting values from nested arrays and objects. Added indentation-sensitive heredocs for nicely formatted strings or chunks of code.
Axed the unsatisfactory ino keyword, replacing it with of for object comprehensions. They now look like: for prop, value of object.
When performing a comprehension over an object, use ino, instead of in, which helps us generate smaller, more efficient code at compile time.
Added :: as a shorthand for saying .prototype.
The “splat” symbol has been changed from a prefix asterisk *, to a postfix ellipsis ...
@@ -6165,39 +6165,39 @@
extends keyword now functions identically to goog.inherits in Google’s Closure Library.
Arguments objects are now converted into real arrays when referenced.
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.
Bugfix for running coffee --interactive and --run from outside of the CoffeeScript directory. Bugfix for nested function/if-statements.
Array slice literals and array comprehensions can now both take Ruby-style ranges to specify the start and end. JavaScript variable declaration is now pushed up to the top of the scope, making all assignment statements into expressions. You can use \ to escape newlines. The coffeescript command is now called coffee.
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 coffee command now includes --interactive, which launches an interactive CoffeeScript session, and --run, which directly compiles and executes a script. Both options depend on a working installation of Narwhal. The aint keyword has been replaced by isnt, which goes together a little smoother with is. Quoted strings are now allowed as identifiers within object literals: eg. {"5+5": 10}. All assignment operators now use a colon: +:, -:, *:, etc.
Fixed a bug with calling super() through more than one level of inheritance, with the re-addition of the extends keyword. Added experimental Narwhal support (as a Tusk package), contributed by Tom Robinson, including bin/cs as a CoffeeScript REPL and interpreter. New --no-wrap option to suppress the safety function wrapper.
Added instanceof and typeof as operators.
Initial CoffeeScript release.
@@ -6212,7 +6212,7 @@