Compare commits

...

29 Commits

Author SHA1 Message Date
Jeremy Ashkenas
f26d33d418 Merge pull request #4079 from lydell/v1.10.0
CoffeeScript 1.10.0
2015-09-03 15:45:13 -04:00
Simon Lydell
cea773ec81 CoffeeScript 1.10.0 2015-09-03 20:10:18 +02:00
Jeremy Ashkenas
98dd1bf8e8 Merge pull request #4073 from lydell/issue-3926
Fix #3926: Disallow implicit objects as parameter destructuring
2015-09-01 15:03:29 -04:00
Jeremy Ashkenas
56d75baac7 Merge pull request #4075 from lydell/documentation-improvements
Documentation improvements
2015-09-01 13:16:55 -04:00
Simon Lydell
0872c3d13d Git rid of the deprecated <tt> tag in the docs
Replaced with `<code>` tags.
2015-08-30 12:41:47 +02:00
Simon Lydell
5095e02b62 Remove unnecessary blank lines at EOF in examples
On less wide screens, where the CoffeeScript is above the JavaScript, those
lines resulted in an unnecessarily high box of CoffeeScript code.
2015-08-30 12:41:47 +02:00
Simon Lydell
874628b1d0 Improve the documentation site on smaller screens
"Smaller screens" means screens smaller than 820px wide. That's the smallest
width that the current design looks good at.

I tried to not change the current design in any way and to make as few changes
as possible.

This is what happens on smaller screens:

- The navigation bar is no longer fixed to the viewport, but always at the top
  of the page.
- The navigation bar is vertical rather than horizontal.
- CoffeeScript code is above the compiled JavaScript rather than having them
  side by side.

This allows for a larger text size, which is more compfortable to read, and no
horizontal scrolling, which many find difficult to use.
2015-08-30 12:41:36 +02:00
Michael Ficarra
ff9d5117f9 Merge pull request #4074 from lydell/destructuring-defaults-docs
Document destructuring defaults
2015-08-29 10:33:44 -07:00
Simon Lydell
10aca2a38e Document destructuring defaults 2015-08-29 19:18:44 +02:00
Simon Lydell
2c4d437e98 Fix #3926: Disallow implicit objects as parameter destructuring 2015-08-28 23:11:47 +02:00
Jeremy Ashkenas
c0c13c1977 Merge pull request #4069 from lydell/destructuring-defaults
Implement ES2015-like destructuring defaults
2015-08-27 17:50:33 -04:00
Simon Lydell
6d9553a016 Implement ES2015-like destructuring defaults
This let's you do things like:

    fullName = ({first = 'John', last = 'Doe'}) -> "#{first} #{last}"

Note: CoffeeScrits treats `undefined` and `null` the same, and that's true in
the case of destructuring defaults as well, as opposed to ES2015 which only uses
the default value if the target is `undefined`. A similar ES2015 difference
already exists for function parameter defaults. It is important for CoffeeScript
to be consistent with itself.

    fullName2 = (first = 'John', last = 'Doe') -> "#{first} #{last}"
    assert fullName('Bob', null) is fullName2(first: 'Bob', last: null)

Fixes #1558, #3288 and #4005.
2015-08-27 22:16:13 +02:00
Jeremy Ashkenas
66716cd730 Merge pull request #4071 from lydell/lone-expansion
Fix #4070: Improve error message for lone expansion
2015-08-27 13:09:54 -04:00
Simon Lydell
f588ecb288 Fix #4070: Improve error message for lone expansion 2015-08-26 22:30:55 +02:00
Michael Ficarra
dc3e177811 Merge pull request #4068 from lydell/issue-1192
Fix #1192: Assignment starting with object literals
2015-08-22 07:24:23 -07:00
Simon Lydell
2eef667916 Fix #1192: Assignment starting with object literals 2015-08-22 16:21:35 +02:00
Jeremy Ashkenas
617a932e89 Merge pull request #4059 from BrunoBernardino/hotfix/4036-try-variable-improvement
Closes #4036: "Try catch" optimisation
2015-08-19 14:33:11 -04:00
Bruno Bernardino
beac56d4d5 Updated compile 2015-08-16 21:34:22 +01:00
Bruno Bernardino
cc98e99070 Removing unnecessary assignment 2015-08-16 21:33:58 +01:00
Bruno Bernardino
93e4eeafed Removing the unnecessary underscore now :) 2015-08-16 21:32:16 +01:00
Bruno Bernardino
efdc67241a Improved the tests and removed the hardcoded variable, according to suggestions. 2015-08-16 21:27:28 +01:00
Bruno Bernardino
24e8f1c98f Closes #4036: "Try catch" optimisation
Let me know if there's something I should be doing differently as this is my first contribution to coffeescript.
I fixed the reported issue where a generated variable could clash with a user-defined one in a try/catch block.
I added a test for a few scenarios with different variable names for a try/catch, to confirm the fix and avoid regressions.
2015-08-16 20:47:04 +01:00
Michael Ficarra
2d1a6fa6ec Merge pull request #4029 from yjerem/reset-seenfor
Reset @seenFor in lexer before tokenizing
2015-07-07 21:31:23 -07:00
Jeremy Ruten
3d7d68a766 Reset @seenFor in lexer before tokenizing 2015-07-07 22:23:26 -06:00
Michael Ficarra
342b395b0a Merge pull request #4019 from rvagg/master
Don't copy arguments or caller from require
2015-06-22 06:33:07 -07:00
Rod Vagg
75ae45e2bb don't copy arguments or caller from require
causes an error in io.js where strict-mode is set on internal modules

Fixes: https://github.com/jashkenas/coffeescript/issues/3810
2015-06-22 22:51:39 +10:00
Michael Ficarra
1f197fcc1b Merge pull request #3985 from ide/array-check
Replace "instanceof Array" in transformer with "[object Array]" comparison
2015-06-05 09:40:02 -07:00
Jeremy Ashkenas
e339f5f2da correct release date 2015-05-27 13:04:12 -04:00
James Ide
2087923163 Replace "instanceof Array" in transformer with "[object Array]" comparison
Testing with `'[object Array]' is Object::toString.call element` allows arrays from another JS context to be properly handled. The specific use case here is to support jest, which sets up JS contexts using Node/io.js's "vm" module. This approach works in ES3 environments in contrast with ES5's `Array.isArray`.
2015-05-20 21:06:36 -07:00
154 changed files with 1775 additions and 1401 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "coffee-script",
"version": "1.9.3",
"version": "1.10.0",
"main": [
"lib/coffee-script/coffee-script.js"
],

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var volume, winner;
if (ignition === true) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var courses, dish, food, foods, i, j, k, l, len, len1, len2, ref;
ref = ['toast', 'cheese', 'wine'];

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
/*
SkinnyMochaHalfCaffScript Compiler v1.0

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var fs;
fs = require('fs');

View File

@@ -4,5 +4,3 @@ $ 'body'
.fadeIn 'fast'
.addClass '.active'
.css 'background', 'white'

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
$('body').click(function(e) {
return $('.box').fadeIn('fast').addClass('.active');
}).css('background', 'white');

View File

@@ -19,7 +19,3 @@ tom = new Horse "Tommy the Palomino"
sam.move()
tom.move()

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var Animal, Horse, Snake, sam, tom,
extend = 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; },
hasProp = {}.hasOwnProperty;

View File

@@ -1,5 +1,3 @@
cholesterol = 127
healthy = 200 > cholesterol > 60

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var cholesterol, healthy;
cholesterol = 127;

View File

@@ -7,6 +7,3 @@ else
showIt()
date = if friday then sue else jill

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var date, mood;
if (singing) {

View File

@@ -1,6 +1,5 @@
class Person
constructor: (options) ->
{@name, @age, @height} = options
tim = new Person age: 4
constructor: (options) ->
{@name, @age, @height = 'average'} = options
tim = new Person name: 'Tim', age: 4

View File

@@ -1,9 +1,10 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var Person, tim;
Person = (function() {
function Person(options) {
this.name = options.name, this.age = options.age, this.height = options.height;
var ref;
this.name = options.name, this.age = options.age, this.height = (ref = options.height) != null ? ref : 'average';
}
return Person;
@@ -11,5 +12,6 @@ Person = (function() {
})();
tim = new Person({
name: 'Tim',
age: 4
});

View File

@@ -1,8 +1,2 @@
fill = (container, liquid = "coffee") ->
"Filling the #{container} with #{liquid}..."

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var fill;
fill = function(container, liquid) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var filename, fn, i, len;
fn = function(filename) {

View File

@@ -1,6 +1,3 @@
hi = `function() {
return [document.title, "Hello JavaScript"].join(": ");
}`

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var hi;
hi = function() {

View File

@@ -4,10 +4,3 @@ speed = 0
speed ?= 15
footprints = yeti ? "bear"

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var footprints, solipsism, speed;
if ((typeof mind !== "undefined" && mind !== null) && (typeof world === "undefined" || world === null)) {

View File

@@ -2,6 +2,3 @@ text = "Every literary critic believes he will
outwit history and have the last word"
[first, ..., last] = text.split " "

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var first, last, ref, text;
text = "Every literary critic believes he will outwit history and have the last word";

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var eldest, grade;
grade = function(student) {

View File

@@ -1,3 +1 @@
six = (one = 1) + (two = 2) + (three = 3)

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var one, six, three, two;
six = (one = 1) + (two = 2) + (three = 3);

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var globals, name;
globals = ((function() {

View File

@@ -4,4 +4,3 @@ alert(
catch error
"And the error is ... #{error}"
)

View File

@@ -1,11 +1,12 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var error;
alert((function() {
var error1;
try {
return nonexistent / void 0;
} catch (_error) {
error = _error;
} catch (error1) {
error = error1;
return "And the error is ... " + error;
}
})());

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var Account;
Account = function(customer, cart) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var cube, square;
square = function(x) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var perfectSquares;
perfectSquares = function*() {

View File

@@ -3,4 +3,3 @@ html = """
cup of coffeescript
</strong>
"""

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var html;
html = "<strong>\n cup of coffeescript\n</strong>";

View File

@@ -7,5 +7,3 @@ OPERATOR = /// ^ (
| \?\. # soak access
| \.{2,3} # range or splat
) ///

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var OPERATOR;
OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/;

View File

@@ -2,7 +2,3 @@ author = "Wittgenstein"
quote = "A picture is a fact. -- #{ author }"
sentence = "#{ 22 / 7 } is a decent approximation of π"

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var author, quote, sentence;
author = "Wittgenstein";

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var modulo = function(a, b) { return (+a % (b = +b) + b) % b; };
-7 % 5 === -2;

View File

@@ -3,7 +3,3 @@ weatherReport = (location) ->
[location, 72, "Mostly Sunny"]
[city, temp, forecast] = weatherReport "Berkeley, CA"

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var city, forecast, ref, temp, weatherReport;
weatherReport = function(location) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var age, ages, child, yearsOld;
yearsOld = {

View File

@@ -9,6 +9,3 @@ futurists =
]
{poet: {name, address: [street, city]}} = futurists

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var city, futurists, name, ref, ref1, street;
futurists = {

View File

@@ -15,5 +15,3 @@ kids =
sister:
name: "Ida"
age: 9

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var bitlist, kids, singers, song;
song = ["do", "re", "mi", "fa", "so"];

View File

@@ -1,5 +1,3 @@
$('.account').attr class: 'active'
log object.class

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
$('.account').attr({
"class": 'active'
});

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var cubes, list, math, num, number, opposite, race, square,
slice = [].slice;

View File

@@ -2,8 +2,3 @@ theBait = 1000
theSwitch = 0
[theBait, theSwitch] = [theSwitch, theBait]

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var ref, theBait, theSwitch;
theBait = 1000;

View File

@@ -1,9 +1,3 @@
tag = "<impossible>"
[open, contents..., close] = tag.split("")

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var close, contents, i, open, ref, tag,
slice = [].slice;

View File

@@ -1,3 +1,2 @@
String::dasherize = ->
this.replace /_/g, "-"

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
String.prototype.dasherize = function() {
return this.replace(/_/g, "-");
};

View File

@@ -1,2 +1 @@
countdown = (num for num in [10..1])

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var countdown, num;
countdown = (function() {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var changeNumbers, inner, outer;
outer = 1;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var copy, end, middle, numbers, start;
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9];

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var ref, zip;
zip = typeof lottery.drawWinner === "function" ? (ref = lottery.drawWinner().address) != null ? ref.zipcode : void 0 : void 0;

View File

@@ -23,5 +23,3 @@ awardMedals contenders...
alert "Gold: " + gold
alert "Silver: " + silver
alert "The Field: " + rest

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var awardMedals, contenders, gold, rest, silver,
slice = [].slice;

View File

@@ -1,7 +1,3 @@
numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
numbers[3..6] = [-3, -4, -5, -6]

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var numbers, ref;
numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];

View File

@@ -4,5 +4,3 @@ mobyDick = "Call me Ishmael. Some years ago --
to interest me on shore, I thought I would sail
about a little and see the watery part of the
world..."

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var mobyDick;
mobyDick = "Call me Ishmael. Some years ago -- never mind how long precisely -- having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world...";

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
switch (day) {
case "Mon":
go(work);

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var grade, score;
score = 76;

View File

@@ -5,4 +5,3 @@ catch error
print error
finally
cleanUp()

View File

@@ -1,11 +1,11 @@
// Generated by CoffeeScript 1.9.3
var error;
// Generated by CoffeeScript 1.10.0
var error, error1;
try {
allHellBreaksLoose();
catsAndDogsLivingTogether();
} catch (_error) {
error = _error;
} catch (error1) {
error = error1;
print(error);
} finally {
cleanUp();

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var lyrics, num;
if (this.studyingEconomics) {

View File

@@ -9,6 +9,7 @@ body {
width: 950px;
margin: 0;
padding: 80px 0px 50px 50px;
clear: both;
}
p, li {
width: 625px;
@@ -56,7 +57,7 @@ table.definitions {
text-align: center;
padding: 5px 20px;
}
code, pre, tt, textarea {
code, pre, textarea {
font-family: Monaco, Consolas, "Lucida Console", monospace;
font-size: 12px;
line-height: 18px;
@@ -64,7 +65,7 @@ code, pre, tt, textarea {
white-space: pre-wrap;
word-wrap: break-word;
}
tt {
p > code, li > code {
display: inline-block;
background: #fff;
border: 1px solid #dedede;
@@ -111,9 +112,12 @@ div.code {
float: left;
width: 450px;
background: #fff;
border-left: 1px dotted #d0d0d0;
margin: 10px 0 15px 3px;
padding: 0 0 0 12px;
border: 1px dotted #d0d0d0;
border-top-width: 0;
border-bottom-width: 0;
border-right-width: 0;
margin: 0 3px 15px 3px;
padding: 10px 0 0 12px;
}
div.code pre:first-child {
border-left: 0;
@@ -134,7 +138,6 @@ div.code {
height: 50px;
min-width: 490px;
left: 40px; right: 40px; top: 25px;
padding-left: 252px;
background: #eee;
background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#dadada));
background: -moz-linear-gradient(top, #f8f8f8, #dadada);
@@ -149,8 +152,9 @@ div.code {
#logo {
display: block;
outline: none;
position: absolute;
top: 0px; left: 10px;
float: left;
width: 242px;
margin-left: 10px;
}
#logo img {
margin: 5px 0 0 3px;
@@ -221,6 +225,7 @@ div.code {
display: block;
}
.navigation .contents.menu {
z-index: 100;
border-top: 0;
-webkit-border-top-left-radius: 0; -moz-border-radius-topleft: 0; border-top-left-radius: 0;
-webkit-border-top-right-radius: 0; -moz-border-radius-topright: 0; border-top-right-radius: 0;
@@ -377,3 +382,36 @@ div.code {
cursor: not-allowed;
}
@media (max-width: 820px) {
.container {
width: auto;
padding: 1em;
}
p, li, table {
width: auto;
}
#fadeout {
display: none;
}
#flybar {
position: static;
height: auto;
min-width: 245px;
}
#logo {
float: none;
}
.navigation {
float: none;
border: none;
}
div.code pre, div.code textarea {
border-left: none;
border-top-width: 1px;
width: auto;
float: none;
}
div.code pre:first-child {
border-top: none;
}
}

View File

@@ -144,7 +144,7 @@ SourceMap = <span class="hljs-built_in">require</span> <span class="hljs-str
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.VERSION = <span class="hljs-string">'1.9.3'</span>
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.VERSION = <span class="hljs-string">'1.10.0'</span>
<span class="hljs-built_in">exports</span>.FILE_EXTENSIONS = [<span class="hljs-string">'.coffee'</span>, <span class="hljs-string">'.litcoffee'</span>, <span class="hljs-string">'.coffee.md'</span>]</pre></div></div>
@@ -482,7 +482,8 @@ The CoffeeScript REPL uses this to run the input.</p>
sandbox.<span class="hljs-built_in">module</span> = _module = <span class="hljs-keyword">new</span> Module(options.modulename || <span class="hljs-string">'eval'</span>)
sandbox.<span class="hljs-built_in">require</span> = <span class="hljs-function"><span class="hljs-title">_require</span> = <span class="hljs-params">(path)</span> -&gt;</span> Module._load path, _module, <span class="hljs-literal">true</span>
_module.filename = sandbox.__filename
_require[r] = <span class="hljs-built_in">require</span>[r] <span class="hljs-keyword">for</span> r <span class="hljs-keyword">in</span> Object.getOwnPropertyNames <span class="hljs-built_in">require</span> <span class="hljs-keyword">when</span> r <span class="hljs-keyword">isnt</span> <span class="hljs-string">'paths'</span></pre></div></div>
<span class="hljs-keyword">for</span> r <span class="hljs-keyword">in</span> Object.getOwnPropertyNames <span class="hljs-built_in">require</span> <span class="hljs-keyword">when</span> r <span class="hljs-keyword">not</span> <span class="hljs-keyword">in</span> [<span class="hljs-string">'paths'</span>, <span class="hljs-string">'arguments'</span>, <span class="hljs-string">'caller'</span>]
_require[r] = <span class="hljs-built_in">require</span>[r]</pre></div></div>
</li>

View File

@@ -532,16 +532,27 @@ the ordinary <strong>Assign</strong> is that these allow numbers and strings as
<div class="content"><div class='highlight'><pre> <span class="hljs-attribute">AssignObj</span>: [
o <span class="hljs-string">'ObjAssignable'</span>,<span class="hljs-function"> -&gt;</span> <span class="hljs-keyword">new</span> Value $<span class="hljs-number">1</span>
o <span class="hljs-string">'ObjAssignable : Expression'</span>,<span class="hljs-function"> -&gt;</span> <span class="hljs-keyword">new</span> Assign LOC(<span class="hljs-number">1</span>)(<span class="hljs-keyword">new</span> Value($<span class="hljs-number">1</span>)), $<span class="hljs-number">3</span>, <span class="hljs-string">'object'</span>
o <span class="hljs-string">'ObjAssignable : Expression'</span>,<span class="hljs-function"> -&gt;</span> <span class="hljs-keyword">new</span> Assign LOC(<span class="hljs-number">1</span>)(<span class="hljs-keyword">new</span> Value $<span class="hljs-number">1</span>), $<span class="hljs-number">3</span>, <span class="hljs-string">'object'</span>,
<span class="hljs-attribute">operatorToken</span>: LOC(<span class="hljs-number">2</span>)(<span class="hljs-keyword">new</span> Literal $<span class="hljs-number">2</span>)
o <span class="hljs-string">'ObjAssignable :
INDENT Expression OUTDENT'</span>,<span class="hljs-function"> -&gt;</span> <span class="hljs-keyword">new</span> Assign LOC(<span class="hljs-number">1</span>)(<span class="hljs-keyword">new</span> Value($<span class="hljs-number">1</span>)), $<span class="hljs-number">4</span>, <span class="hljs-string">'object'</span>
INDENT Expression OUTDENT'</span>,<span class="hljs-function"> -&gt;</span> <span class="hljs-keyword">new</span> Assign LOC(<span class="hljs-number">1</span>)(<span class="hljs-keyword">new</span> Value $<span class="hljs-number">1</span>), $<span class="hljs-number">4</span>, <span class="hljs-string">'object'</span>,
<span class="hljs-attribute">operatorToken</span>: LOC(<span class="hljs-number">2</span>)(<span class="hljs-keyword">new</span> Literal $<span class="hljs-number">2</span>)
o <span class="hljs-string">'SimpleObjAssignable = Expression'</span>,<span class="hljs-function"> -&gt;</span> <span class="hljs-keyword">new</span> Assign LOC(<span class="hljs-number">1</span>)(<span class="hljs-keyword">new</span> Value $<span class="hljs-number">1</span>), $<span class="hljs-number">3</span>, <span class="hljs-literal">null</span>,
<span class="hljs-attribute">operatorToken</span>: LOC(<span class="hljs-number">2</span>)(<span class="hljs-keyword">new</span> Literal $<span class="hljs-number">2</span>)
o <span class="hljs-string">'SimpleObjAssignable =
INDENT Expression OUTDENT'</span>,<span class="hljs-function"> -&gt;</span> <span class="hljs-keyword">new</span> Assign LOC(<span class="hljs-number">1</span>)(<span class="hljs-keyword">new</span> Value $<span class="hljs-number">1</span>), $<span class="hljs-number">4</span>, <span class="hljs-literal">null</span>,
<span class="hljs-attribute">operatorToken</span>: LOC(<span class="hljs-number">2</span>)(<span class="hljs-keyword">new</span> Literal $<span class="hljs-number">2</span>)
o <span class="hljs-string">'Comment'</span>
]
<span class="hljs-attribute">ObjAssignable</span>: [
<span class="hljs-attribute">SimpleObjAssignable</span>: [
o <span class="hljs-string">'Identifier'</span>
o <span class="hljs-string">'AlphaNumeric'</span>
o <span class="hljs-string">'ThisProperty'</span>
]
<span class="hljs-attribute">ObjAssignable</span>: [
o <span class="hljs-string">'SimpleObjAssignable'</span>
o <span class="hljs-string">'AlphaNumeric'</span>
]</pre></div></div>
</li>

View File

@@ -277,7 +277,7 @@ Handy for getting a list of <code>children</code> from the nodes.</p>
<div class="content"><div class='highlight'><pre><span class="hljs-built_in">exports</span>.flatten = <span class="hljs-function"><span class="hljs-title">flatten</span> = <span class="hljs-params">(array)</span> -&gt;</span>
flattened = []
<span class="hljs-keyword">for</span> element <span class="hljs-keyword">in</span> array
<span class="hljs-keyword">if</span> element <span class="hljs-keyword">instanceof</span> Array
<span class="hljs-keyword">if</span> <span class="hljs-string">'[object Array]'</span> <span class="hljs-keyword">is</span> <span class="hljs-attribute">Object</span>::toString.call element
flattened = flattened.concat flatten element
<span class="hljs-keyword">else</span>
flattened.push element

View File

@@ -216,6 +216,7 @@ it has consumed.</p>
<span class="hljs-property">@indents</span> = [] <span class="hljs-comment"># The stack of all current indentation levels.</span>
<span class="hljs-property">@ends</span> = [] <span class="hljs-comment"># The stack for pairing up tokens.</span>
<span class="hljs-property">@tokens</span> = [] <span class="hljs-comment"># Stream of parsed tokens in the form `['TYPE', value, location data]`.</span>
<span class="hljs-property">@seenFor</span> = <span class="hljs-literal">no</span> <span class="hljs-comment"># Used to recognize FORIN and FOROF tokens.</span>
<span class="hljs-property">@chunkLine</span> =
opts.line <span class="hljs-keyword">or</span> <span class="hljs-number">0</span> <span class="hljs-comment"># The start line for the current @chunk.</span>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var volume, winner;
if (ignition === true) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var courses, dish, food, foods, i, j, k, l, len, len1, len2, ref;
ref = ['toast', 'cheese', 'wine'];

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
/*
SkinnyMochaHalfCaffScript Compiler v1.0

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var fs;
fs = require('fs');

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
$('body').click(function(e) {
return $('.box').fadeIn('fast').addClass('.active');
}).css('background', 'white');

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var Animal, Horse, Snake, sam, tom,
extend = 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; },
hasProp = {}.hasOwnProperty;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var cholesterol, healthy;
cholesterol = 127;

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var date, mood;
if (singing) {

View File

@@ -1,9 +1,10 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var Person, tim;
Person = (function() {
function Person(options) {
this.name = options.name, this.age = options.age, this.height = options.height;
var ref;
this.name = options.name, this.age = options.age, this.height = (ref = options.height) != null ? ref : 'average';
}
return Person;
@@ -11,5 +12,6 @@ Person = (function() {
})();
tim = new Person({
name: 'Tim',
age: 4
});

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var fill;
fill = function(container, liquid) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var filename, fn, i, len;
fn = function(filename) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var hi;
hi = function() {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var footprints, solipsism, speed;
if ((typeof mind !== "undefined" && mind !== null) && (typeof world === "undefined" || world === null)) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var first, last, ref, text;
text = "Every literary critic believes he will outwit history and have the last word";

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var eldest, grade;
grade = function(student) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var one, six, three, two;
six = (one = 1) + (two = 2) + (three = 3);

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var globals, name;
globals = ((function() {

View File

@@ -1,11 +1,12 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var error;
alert((function() {
var error1;
try {
return nonexistent / void 0;
} catch (_error) {
error = _error;
} catch (error1) {
error = error1;
return "And the error is ... " + error;
}
})());

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var Account;
Account = function(customer, cart) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var cube, square;
square = function(x) {

View File

@@ -1,4 +1,4 @@
// Generated by CoffeeScript 1.9.3
// Generated by CoffeeScript 1.10.0
var perfectSquares;
perfectSquares = function*() {

Some files were not shown because too many files have changed in this diff Show More