")+" ("+r+")":o?o+" ("+r+")":r},g={},c=function(t){var n,i;if(g[t])return g[t];if(i=null!=f?f.extname(t):void 0,!(0>k.call(e.FILE_EXTENSIONS,i)))return n=e._compileFile(t,!0),g[t]=n.sourceMap},Error.prepareStackTrace=function(t,n){var i,r,s;return s=function(e,t,n){var i,r;return r=c(e),r&&(i=r.sourceLocation([t-1,n-1])),i?[i[0]+1,i[1]+1]:null},r=function(){var t,r,a;for(a=[],t=0,r=n.length;r>t&&(i=n[t],i.getFunction()!==e.run);t++)a.push(" at "+o(i,s));return a}(),""+t+"\n"+r.join("\n")+"\n"}}.call(this),t.exports}(),require["./browser"]=function(){var exports={},module={exports:exports};return function(){var CoffeeScript,compile,runScripts,indexOf=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1};CoffeeScript=require("./coffee-script"),CoffeeScript.require=require,compile=CoffeeScript.compile,CoffeeScript.eval=function(code,options){return null==options&&(options={}),null==options.bare&&(options.bare=!0),eval(compile(code,options))},CoffeeScript.run=function(e,t){return null==t&&(t={}),t.bare=!0,t.shiftLine=!0,Function(compile(e,t))()},"undefined"!=typeof window&&null!==window&&("undefined"!=typeof btoa&&null!==btoa&&"undefined"!=typeof JSON&&null!==JSON&&"undefined"!=typeof unescape&&null!==unescape&&"undefined"!=typeof encodeURIComponent&&null!==encodeURIComponent&&(compile=function(e,t){var n,i,r;return null==t&&(t={}),t.sourceMap=!0,t.inline=!0,i=CoffeeScript.compile(e,t),n=i.js,r=i.v3SourceMap,n+"\n//# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(r)))+"\n//# sourceURL=coffeescript"}),CoffeeScript.load=function(e,t,n,i){var r;return null==n&&(n={}),null==i&&(i=!1),n.sourceFiles=[e],r=window.ActiveXObject?new window.ActiveXObject("Microsoft.XMLHTTP"):new window.XMLHttpRequest,r.open("GET",e,!0),"overrideMimeType"in r&&r.overrideMimeType("text/plain"),r.onreadystatechange=function(){var s,o;if(4===r.readyState){if(0!==(o=r.status)&&200!==o)throw Error("Could not load "+e);if(s=[r.responseText,n],i||CoffeeScript.run.apply(CoffeeScript,s),t)return t(s)}},r.send(null)},runScripts=function(){var e,t,n,i,r,s,o,a,c,l,h;for(h=window.document.getElementsByTagName("script"),t=["text/coffeescript","text/literate-coffeescript"],e=function(){var e,n,i,r;for(r=[],e=0,n=h.length;n>e;e++)c=h[e],i=c.type,indexOf.call(t,i)>=0&&r.push(c);return r}(),s=0,n=function(){var t;return t=e[s],t instanceof Array?(CoffeeScript.run.apply(CoffeeScript,t),s++,n()):void 0},i=function(i,r){var s,o;return s={literate:i.type===t[1]},o=i.src||i.getAttribute("data-src"),o?CoffeeScript.load(o,function(t){return e[r]=t,n()},s,!0):(s.sourceFiles=["embedded"],e[r]=[i.innerHTML,s])},r=o=0,a=e.length;a>o;r=++o)l=e[r],i(l,r);return n()},window.addEventListener?window.addEventListener("DOMContentLoaded",runScripts,!1):window.attachEvent("onload",runScripts))}.call(this),module.exports}(),require["./coffee-script"]}();"function"==typeof define&&define.amd?define(function(){return CoffeeScript}):root.CoffeeScript=CoffeeScript})(this);
\ No newline at end of file
diff --git a/index.html b/index.html
index 6a6a93d5..9582fac5 100644
--- a/index.html
+++ b/index.html
@@ -110,7 +110,7 @@
Latest Version:
- 1.9.1
+ 1.9.2
npm install -g coffee-script
@@ -1845,26 +1845,26 @@ tim = new Person({
it to the current value of this, right on the spot. This is helpful
when using callback-based libraries like Prototype or jQuery, for creating
iterator functions to pass to each, or event-handler functions
- to use with bind. Functions created with the fat arrow are able to access
+ to use with on. Functions created with the fat arrow are able to access
properties of the this where they're defined.
Account = (customer, cart) ->
@customer = customer
@cart = cart
- $('.shopping_cart').bind 'click', (event) =>
+ $('.shopping_cart').on 'click', (event) =>
@customer.purchase @cart
var Account;
Account = function(customer, cart) {
this.customer = customer;
this.cart = cart;
- return $('.shopping_cart').bind('click', (function(_this) {
+ return $('.shopping_cart').on('click', (function(_this) {
return function(event) {
return _this.customer.purchase(_this.cart);
};
})(this));
};
-
load
+load
If we had used -> in the callback above, @customer would
have referred to the undefined "customer" property of the DOM element,
@@ -1876,9 +1876,9 @@ Account = function
- CoffeeScript functions also support
+ CoffeeScript functions also support
ES6 generator functions
- through the yield keyword. There's no function*(){}
+ through the yield keyword. There's no function*(){}
nonsense — a generator in CoffeeScript is simply a function that yields.
perfectSquares = ->
@@ -2491,6 +2491,36 @@ task('build:parser', 'rebuild t
Change Log
+
+
+
+
+ -
+ Fixed the watch mode error
+ The two following source files have the same output file.
+
+ -
+ yield now behaves as expected around expressions containing
+ this.
+
+ -
+ Added a Ruby-style -r option to the cli, which allows
+ requiring a module before execution with --eval or
+ --interactive.
+
+ -
+ To avoid dublicate browser requests for .coffee files, you can now
+ use script tags with the data-src attribute.
+
+ -
+ Minor bug fixes for IE8, strict ES5 regexp and browserify support.
+
+
+
+
-
- Interpolation now works in object literal keys (again). You can use this to
+ Interpolation now works in object literal keys (again). You can use this to
dynamically name properties.
-
@@ -2527,10 +2557,10 @@ task('build:parser', 'rebuild t
-
CoffeeScript now supports ES6 generators. A generator is simply a function
- that yields.
+ that yields.
-
- More robust parsing and improved error messages for strings and regexes —
+ More robust parsing and improved error messages for strings and regexes —
especially with respect to interpolation.
-
diff --git a/lib/coffee-script/browser.js b/lib/coffee-script/browser.js
index 029ff34f..2bc615ac 100644
--- a/lib/coffee-script/browser.js
+++ b/lib/coffee-script/browser.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var CoffeeScript, compile, runScripts,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
diff --git a/lib/coffee-script/cake.js b/lib/coffee-script/cake.js
index 7f347c6a..3550fe45 100644
--- a/lib/coffee-script/cake.js
+++ b/lib/coffee-script/cake.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var CoffeeScript, cakefileDirectory, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks;
diff --git a/lib/coffee-script/coffee-script.js b/lib/coffee-script/coffee-script.js
index c62a5d98..18133b34 100644
--- a/lib/coffee-script/coffee-script.js
+++ b/lib/coffee-script/coffee-script.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var Lexer, SourceMap, base, compile, ext, formatSourcePosition, fs, getSourceMap, helpers, i, len, lexer, parser, path, ref, sourceMaps, vm, withPrettyErrors,
hasProp = {}.hasOwnProperty,
@@ -18,7 +18,7 @@
SourceMap = require('./sourcemap');
- exports.VERSION = '1.9.1';
+ exports.VERSION = '1.9.2';
exports.FILE_EXTENSIONS = ['.coffee', '.litcoffee', '.coffee.md'];
diff --git a/lib/coffee-script/command.js b/lib/coffee-script/command.js
index f504b169..6d8d59b8 100644
--- a/lib/coffee-script/command.js
+++ b/lib/coffee-script/command.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, findDirectoryIndex, forkNode, fs, helpers, hidden, joinTimeout, makePrelude, mkdirp, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, ref, removeSource, removeSourceDir, silentUnlink, sourceCode, sources, spawn, timeLog, usage, useWinPathSep, version, wait, watch, watchDir, watchedDirs, writeJs,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
diff --git a/lib/coffee-script/grammar.js b/lib/coffee-script/grammar.js
index 98540016..da31dcb1 100644
--- a/lib/coffee-script/grammar.js
+++ b/lib/coffee-script/grammar.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap;
diff --git a/lib/coffee-script/helpers.js b/lib/coffee-script/helpers.js
index b5e25d1a..70bfa0b1 100644
--- a/lib/coffee-script/helpers.js
+++ b/lib/coffee-script/helpers.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var buildLocationData, extend, flatten, ref, repeat, syntaxErrorToString;
diff --git a/lib/coffee-script/index.js b/lib/coffee-script/index.js
index 9b811a2d..17bd27d2 100644
--- a/lib/coffee-script/index.js
+++ b/lib/coffee-script/index.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var key, ref, val;
diff --git a/lib/coffee-script/lexer.js b/lib/coffee-script/lexer.js
index 90f39089..2903c66e 100644
--- a/lib/coffee-script/lexer.js
+++ b/lib/coffee-script/lexer.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var BOM, BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HERECOMMENT_ILLEGAL, HEREDOC_DOUBLE, HEREDOC_INDENT, HEREDOC_SINGLE, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDENTABLE_CLOSERS, INDEXABLE, INVALID_ESCAPE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LEADING_BLANK_LINE, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTI_DENT, NOT_REGEX, NUMBER, OPERATOR, POSSIBLY_DIVISION, REGEX, REGEX_FLAGS, REGEX_ILLEGAL, RELATION, RESERVED, Rewriter, SHIFT, SIMPLE_STRING_OMIT, STRICT_PROSCRIBED, STRING_DOUBLE, STRING_OMIT, STRING_SINGLE, STRING_START, TRAILING_BLANK_LINE, TRAILING_SPACES, UNARY, UNARY_MATH, VALID_FLAGS, WHITESPACE, compact, count, invertLiterate, key, locationDataToString, ref, ref1, repeat, starts, throwSyntaxError,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
diff --git a/lib/coffee-script/nodes.js b/lib/coffee-script/nodes.js
index 28b6907e..f5eb7656 100644
--- a/lib/coffee-script/nodes.js
+++ b/lib/coffee-script/nodes.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var Access, Arr, Assign, Base, Block, Call, Class, Code, CodeFragment, Comment, Existence, Expansion, Extends, For, HEXNUM, IDENTIFIER, IS_REGEX, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, NEGATE, NO, NUMBER, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, addLocationDataFn, compact, del, ends, extend, flatten, fragmentsToText, isComplexOrAssignable, isLiteralArguments, isLiteralThis, locationDataToString, merge, multident, parseNum, ref1, ref2, some, starts, throwSyntaxError, unfoldSoak, utility,
extend1 = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
diff --git a/lib/coffee-script/optparse.js b/lib/coffee-script/optparse.js
index b72af772..1a118200 100644
--- a/lib/coffee-script/optparse.js
+++ b/lib/coffee-script/optparse.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments, repeat;
diff --git a/lib/coffee-script/register.js b/lib/coffee-script/register.js
index a798bfc7..85765d75 100644
--- a/lib/coffee-script/register.js
+++ b/lib/coffee-script/register.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var CoffeeScript, Module, binary, child_process, ext, findExtension, fork, helpers, i, len, loadFile, path, ref;
diff --git a/lib/coffee-script/repl.js b/lib/coffee-script/repl.js
index e0663310..14e5ab6d 100644
--- a/lib/coffee-script/repl.js
+++ b/lib/coffee-script/repl.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var CoffeeScript, addHistory, addMultilineHandler, fs, getCommandId, merge, nodeREPL, path, ref, replDefaults, runInContext, updateSyntaxError, vm;
diff --git a/lib/coffee-script/rewriter.js b/lib/coffee-script/rewriter.js
index 3b00a1b8..0511e15b 100644
--- a/lib/coffee-script/rewriter.js
+++ b/lib/coffee-script/rewriter.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var BALANCED_PAIRS, CALL_CLOSERS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, generate, k, left, len, ref, rite,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
diff --git a/lib/coffee-script/scope.js b/lib/coffee-script/scope.js
index 91c8c9dc..b6418ad7 100644
--- a/lib/coffee-script/scope.js
+++ b/lib/coffee-script/scope.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var Scope,
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
diff --git a/lib/coffee-script/sourcemap.js b/lib/coffee-script/sourcemap.js
index d10bc371..5566b95e 100644
--- a/lib/coffee-script/sourcemap.js
+++ b/lib/coffee-script/sourcemap.js
@@ -1,4 +1,4 @@
-// Generated by CoffeeScript 1.9.1
+// Generated by CoffeeScript 1.9.2
(function() {
var LineMap, SourceMap;