Permalink
...
Comparing changes
Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
jashkenas/coffeescript
CDR2003/coffee-script-lua
CreamCoderz/coffee-script
Crylock/coffee-script
GeoffreyBooth/coffeescript
Gregg/coffee-script
JulianBirch/coffee-script-1
JustinTulloss/coffee-script
MichaelBlume/coffee-script
NightMigera/coffeescript
PandaWood/coffee-script
ProximaMonkey/coffee-script
Remcoman/coffee-script
RicardoSaracino/coffee-script
SE7ENSKY/matescript
STRd6/coffee-script
ShawnFumo/coffee-script
StanAngeloff/coffee-script
Xepo/coffee-script
abi/coffee-script
agnoster/coffee-script
ahjohannessen/coffee-script
akiellor/coffee-script
alanning/coffee-script
allanberger/coffee-script
almost/coffee-script
alubbe/coffee-script
andrehjr/coffee-script
andrewschaaf/coffee-script
andreypopp/coffee-script
apanda/coffee-script
baoshitang/coffee-script
barberboy/coffee-script
benatkin/coffee-script
benbria/coffee-script
benekastah/coffee-script
bjouhier/coffee-script
blahutka/coffee-script
blossom/coffee-script
bolinfest/coffee-script
breckinloggins/coffee-script
carmelyne/contracts.coffee
chajath/coffee-script
charles-cai/coffee-script
charliesome/coffee-script
chetan51/coffee-script
chip/coffee-script
codelahoma/coffee-script
coffee-js/coffee-script
coffee-void/coffeescript
collin/coffee-script
danemorgridge/coffee-script
daveclarke/coffee-script
daveyoon/coffee-script
dbrans/coffee-script
deadprogram/coffee-script
devongovett/coffee-script
dget/coffee-script
disnet/contracts.coffee
dmohl/coffee-script
dohse/coffee-script
dqminh/coffee-script
drewlesueur/coffee-script
eventualbuddha/coffee-script
evilpie/coffee-script
excellentdrums/coffee-script
fitzgen/coffee-script
fizx/coffee-script
geraldalewis/coffee-script
germanocaldeira/coffee-script
gfodor/coffee-script
ghuntley/coffee-script
goodwink/coffee-script
gxela/coffee-script
hayeah/coffee-script
hbt/coffee-script
helixbass/copheescript
hleumas/coffee-script
holtwick/moccacino
hugs/coffee-script
ianthehenry/protoscript
ich/caffeine
janlelis/angular-coffee-script
jaredwy/coffee-script
jasonyandell/coffee-script
jawj/coffee-script
jbca/coffeescript
jiangmiao/toffee-script
jlstr/coffee-script
joelturnbull/coffee-script
johnsang/coffee-script
joliss/coffee-script
jondistad/coffee-script
joshprice/coffee-script
jstrachan/coffee-script
jugglinmike/irene-script
juilyoon/coffee-script
keichii/coffee-script
keithnorm/coffee-script
kewinwang/coffee-script
khaled/coffee-script
leeight/coffee-script
level1/coffee-script
lfendy/coffee-script
loganfsmyth/coffee-script
loopinfinito/coffeescript.com.br
lorensr/coffee-script
loveencounterflow/coffy-script
lukhnos/doubleshot
lynaghk/coffee-script
martco/coffee-script
maxtaco/coffee-script
mbbx6spp/coffee-script
mblinn/coffee-script
mehmeta/coffee-script
melcher/coffee-script
mental/coffee-script
mhart/coffee-script
michaelficarra/coffee-script
misfo/coffee-script
mizchi/coffee-script
mlinderm/coffee-script
mrlauer/coffee-script-monads
muratmeran/coffee-script
myang/coffee-script
nanqiu/coffee-script
neobine/coffee-script
netconstructor/coffee-script
nickjs/coffee-script
nihar/coffee-script
onilabs/coffee-script
paiq/blackcoffee
parkerl/coffee-script
paulmars/coffee-script
peick/coffee-script
pjaspers/coffee-script
plambert/coffee-script
poutyface/coffee-script
pschyska/coffee-script
ptoomey3/coffee-script
quangv/coffee-script
revence27/coffee-script
rkJun/coffee-script
robarondaz/coffee-script
robotlolita/coffee-script
rolftimmermans/coffee-script
rpl/coffee-script
runeb/coffee-script
rwaldron/coffee-script
rymohr/coffee-script
ryszard/coffee-script
samcday/coffee-script
sarang25491/coffee-script
satyr/coffee-script
seedjs/coffee-script
sequoiar/coffee-script
sgraham/coffee-script
shariefsk/coffee-script
shesek/coffee-script
shimaore/cake
siefkenj/gjscoffee-script
smhanov/coffee-script
soutaro/coffee-script
spaghetticode/coffee-script
sparecycles/coffee-script
spencerelliott/coffee-script
sstephenson/coffee-script
stephank/coffee-script
strangemonad/coffee-script
swistak/coffee-script
syg/heap.coffee
taku0/coffee-script
tanob/coffee-script
tglines/coffee-script
thdtjsdn/coffee-script
theIntuitionist/coffee-script
thedeeno/coffee-script
thejh/coffee-script
timruffles/coffee-script
tkpage/coffee-script
tlrobinson/coffee-script
tmishra/coffee-script
tobee/coffee-script
tomelam/coffee-script
tosh/coffee-script
tswicegood/coffee-script
ttilley/coffee-script
twilson63/coffee-script
up2u0609/coffee-script
vanviegen/coffee-script
vjpr/coffee-script
vol4ok/coffee-script
walski/coffee-script
wearefractal/yerbascript
willmoffat/coffee-script
xixixao/coffee-script
yihuang/coffee-script
zaach/coffee-script
zmthy/coffee-script
zot/coffee-script
Nothing to show
Choose a base branch
Choose a Head Repository
jashkenas/coffeescript
CDR2003/coffee-script-lua
CreamCoderz/coffee-script
Crylock/coffee-script
GeoffreyBooth/coffeescript
Gregg/coffee-script
JulianBirch/coffee-script-1
JustinTulloss/coffee-script
MichaelBlume/coffee-script
NightMigera/coffeescript
PandaWood/coffee-script
ProximaMonkey/coffee-script
Remcoman/coffee-script
RicardoSaracino/coffee-script
SE7ENSKY/matescript
STRd6/coffee-script
ShawnFumo/coffee-script
StanAngeloff/coffee-script
Xepo/coffee-script
abi/coffee-script
agnoster/coffee-script
ahjohannessen/coffee-script
akiellor/coffee-script
alanning/coffee-script
allanberger/coffee-script
almost/coffee-script
alubbe/coffee-script
andrehjr/coffee-script
andrewschaaf/coffee-script
andreypopp/coffee-script
apanda/coffee-script
baoshitang/coffee-script
barberboy/coffee-script
benatkin/coffee-script
benbria/coffee-script
benekastah/coffee-script
bjouhier/coffee-script
blahutka/coffee-script
blossom/coffee-script
bolinfest/coffee-script
breckinloggins/coffee-script
carmelyne/contracts.coffee
chajath/coffee-script
charles-cai/coffee-script
charliesome/coffee-script
chetan51/coffee-script
chip/coffee-script
codelahoma/coffee-script
coffee-js/coffee-script
coffee-void/coffeescript
collin/coffee-script
danemorgridge/coffee-script
daveclarke/coffee-script
daveyoon/coffee-script
dbrans/coffee-script
deadprogram/coffee-script
devongovett/coffee-script
dget/coffee-script
disnet/contracts.coffee
dmohl/coffee-script
dohse/coffee-script
dqminh/coffee-script
drewlesueur/coffee-script
eventualbuddha/coffee-script
evilpie/coffee-script
excellentdrums/coffee-script
fitzgen/coffee-script
fizx/coffee-script
geraldalewis/coffee-script
germanocaldeira/coffee-script
gfodor/coffee-script
ghuntley/coffee-script
goodwink/coffee-script
gxela/coffee-script
hayeah/coffee-script
hbt/coffee-script
helixbass/copheescript
hleumas/coffee-script
holtwick/moccacino
hugs/coffee-script
ianthehenry/protoscript
ich/caffeine
janlelis/angular-coffee-script
jaredwy/coffee-script
jasonyandell/coffee-script
jawj/coffee-script
jbca/coffeescript
jiangmiao/toffee-script
jlstr/coffee-script
joelturnbull/coffee-script
johnsang/coffee-script
joliss/coffee-script
jondistad/coffee-script
joshprice/coffee-script
jstrachan/coffee-script
jugglinmike/irene-script
juilyoon/coffee-script
keichii/coffee-script
keithnorm/coffee-script
kewinwang/coffee-script
khaled/coffee-script
leeight/coffee-script
level1/coffee-script
lfendy/coffee-script
loganfsmyth/coffee-script
loopinfinito/coffeescript.com.br
lorensr/coffee-script
loveencounterflow/coffy-script
lukhnos/doubleshot
lynaghk/coffee-script
martco/coffee-script
maxtaco/coffee-script
mbbx6spp/coffee-script
mblinn/coffee-script
mehmeta/coffee-script
melcher/coffee-script
mental/coffee-script
mhart/coffee-script
michaelficarra/coffee-script
misfo/coffee-script
mizchi/coffee-script
mlinderm/coffee-script
mrlauer/coffee-script-monads
muratmeran/coffee-script
myang/coffee-script
nanqiu/coffee-script
neobine/coffee-script
netconstructor/coffee-script
nickjs/coffee-script
nihar/coffee-script
onilabs/coffee-script
paiq/blackcoffee
parkerl/coffee-script
paulmars/coffee-script
peick/coffee-script
pjaspers/coffee-script
plambert/coffee-script
poutyface/coffee-script
pschyska/coffee-script
ptoomey3/coffee-script
quangv/coffee-script
revence27/coffee-script
rkJun/coffee-script
robarondaz/coffee-script
robotlolita/coffee-script
rolftimmermans/coffee-script
rpl/coffee-script
runeb/coffee-script
rwaldron/coffee-script
rymohr/coffee-script
ryszard/coffee-script
samcday/coffee-script
sarang25491/coffee-script
satyr/coffee-script
seedjs/coffee-script
sequoiar/coffee-script
sgraham/coffee-script
shariefsk/coffee-script
shesek/coffee-script
shimaore/cake
siefkenj/gjscoffee-script
smhanov/coffee-script
soutaro/coffee-script
spaghetticode/coffee-script
sparecycles/coffee-script
spencerelliott/coffee-script
sstephenson/coffee-script
stephank/coffee-script
strangemonad/coffee-script
swistak/coffee-script
syg/heap.coffee
taku0/coffee-script
tanob/coffee-script
tglines/coffee-script
thdtjsdn/coffee-script
theIntuitionist/coffee-script
thedeeno/coffee-script
thejh/coffee-script
timruffles/coffee-script
tkpage/coffee-script
tlrobinson/coffee-script
tmishra/coffee-script
tobee/coffee-script
tomelam/coffee-script
tosh/coffee-script
tswicegood/coffee-script
ttilley/coffee-script
twilson63/coffee-script
up2u0609/coffee-script
vanviegen/coffee-script
vjpr/coffee-script
vol4ok/coffee-script
walski/coffee-script
wearefractal/yerbascript
willmoffat/coffee-script
xixixao/coffee-script
yihuang/coffee-script
zaach/coffee-script
zmthy/coffee-script
zot/coffee-script
Nothing to show
Choose a head branch
16
contributors
Commits on Sep 03, 2015
|
|
lydell |
Ensure that all source files end with a single `\n`
This was done by first checking all files in the repository root by hand, and
then by doing the following:
$ npm i get-stdin@4
$ cat clean.coffee
fs = require 'fs'
stdin = require 'get-stdin'
stdin (text) ->
for file in text.trim().split('\n')
contents = fs.readFileSync file
.toString().replace /\s*$/, '\n'
fs.writeFileSync file, contents
return
$ ls !(node_modules)/**/*.coffee | coffee clean.coffee |
6c6c8d4
|
|||
|
|
lydell |
Update date and fix formatting error in 1.10.0 changelog
|
fcf5924
|
|||
|
|
lydell |
Remove unnecessary .js files
The example code in documentation/coffee/*.coffee accidentally had duplicate compiled .js versions committed: Both as documentation/js/*.js and as documentation/coffee/*.js. The former is generated when running `cake doc:site`, while the latter has no cake task to be generated. Removing the former and then re-compiling index.html results in all the code examples being missing in the resulting HTML, while removing the latter makes no difference. In conclusion, documentation/coffee/*.js must be the unnecessary duplicates. They are removed by this commit. |
ae65875
|
|||
|
|
jashkenas |
Merge pull request #4082 from lydell/changelog-fix
Update date and fix formatting error in 1.10.0 changelog |
d742a7d
|
|||
|
|
jashkenas |
Merge pull request #4083 from lydell/remove-unnecessary-files
Remove unnecessary .js files |
eb6baf2
|
Commits on Sep 04, 2015
|
|
michaelficarra |
Merge pull request #4080 from lydell/single-newline-at-eof
Ensure that all source files end with a single `\n` |
8711da0
|
Commits on Sep 10, 2015
|
|
lydell |
Fix #4088: Don't declare caught variables
|
75a4c01
|
|||
|
|
jashkenas |
Merge pull request #4089 from lydell/issue-4088
Fix #4088: Don't declare caught variables |
1739c9d
|
Commits on Sep 13, 2015
|
|
alubbe |
Remove uncaught error vars
|
d3cff90
|
|||
|
|
alubbe |
Add support for standalone yield
This breaks compatibility with
->
yield for i in [1..3]
i * 2
and
->
yield
i * 2
yield's behaviour now mirrors that of return in that it can be used stand alone as well as with expressions. Thus, it currently also inherits the above limitations. |
c1a9cfa
|
|||
|
|
alubbe |
Remove unnecessary brackets and empty spaces around yield
This removes unnecessary brackets and empty spaces around yield when not needed. We still need brackets for if(a === (yield)). |
b1ef5a9
|
Commits on Sep 14, 2015
|
|
jashkenas |
Merge pull request #4094 from alubbe/removeuncaughterrorvars
Remove uncaught error vars |
d1c6db4
|
|||
|
|
jashkenas |
Merge pull request #4093 from alubbe/betteryieldcompilation
Remove unnecessary brackets and empty spaces around yield |
da23a2f
|
|||
|
|
jashkenas |
Merge pull request #4095 from alubbe/standaloneyieldd
Add support for standalone yield |
d6ff91a
|
Commits on Sep 16, 2015
|
|
lydell |
Only allow `yield return` as a statement
|
4ceb6a6
|
Commits on Sep 17, 2015
|
|
mjhassanpur |
Fix documentation typos
|
de2db48
|
|||
|
|
michaelficarra |
Merge pull request #4101 from mjhassanpur/fix-doc-typos
Fix documentation typos |
73b05a5
|
|||
|
|
casidiablo |
Fixed link to Groovy doc link
|
4acafad
|
|||
|
|
vendethiel |
Merge pull request #4102 from casidiablo/patch-1
Fixed link to Groovy doc link |
2536bfd
|
|||
|
|
jashkenas |
Merge pull request #4099 from lydell/yield-return
Only allow `yield return` as a statement |
36e80d7
|
Commits on Sep 27, 2015
|
|
lydell |
Fix compiler crash with renamed destrucured params with defaults
`({a = 1}) ->` and `({a: b}) ->` worked, but not the combination of the two:
`({a: b = 1}) ->`. That destrucuring worked for normal assignments, though:
`{a: b = 1} = c`. This commit fixes the param case. |
4b4675d
|
Commits on Oct 03, 2015
|
|
michaelficarra |
Merge pull request #4112 from lydell/renamed-destrucured-params-with-…
…defaults Fix compiler crash with renamed destrucured params with defaults |
968f94f
|
Commits on Oct 22, 2015
|
|
lydell |
Fix #4130: Unassignable param destructuring crash
|
1dd5795
|
|||
|
|
michaelficarra |
Merge pull request #4131 from lydell/issue-4130
Fix #4130: Unassignable param destructuring crash |
87a854a
|
Commits on Nov 02, 2015
|
|
lydell |
Fix #4137: Caught errors named `undefined`
Previously, `catch`-less `try`s named the caught error `undefined`, instead of `error` like usual. |
89921c0
|
|||
|
|
michaelficarra |
Merge pull request #4140 from lydell/issue-4137
Fix #4137: Caught errors named `undefined` |
0995ba3
|
Commits on Nov 18, 2015
|
|
mvj3 |
Fixed minor document typos
|
f179b20
|
|||
|
|
michaelficarra |
Merge pull request #4146 from mvj3/minor-document-typos
Fixed minor document typos |
b8403bf
|
Commits on Jan 07, 2016
|
|
lydell |
Fix scoping error in coffee-script.coffee
Closes #4167. |
ae72dbb
|
|||
|
|
lydell |
Fix invalid JS in one of the docs examples
Fixes #4175. |
ce84924
|
Commits on Jan 12, 2016
|
|
zhanzhenzhen |
Fix #4178: an issue of processing Unicode characters in stdin
|
67b0f95
|
|||
|
|
zhanzhenzhen |
Build for #4178
|
97882b8
|
|||
|
|
michaelficarra |
Merge pull request #4180 from zhanzhenzhen/master
Fix #4178: an issue of processing Unicode characters in stdin |
2df011f
|
Commits on Jan 23, 2016
|
|
DylanPiercey |
Add inline sourcemap support
|
347a625
|
Commits on Jan 31, 2016
|
|
jashkenas |
Merge pull request #4111 from DylanPiercey/master
Add inline sourcemap support |
08129d0
|
|||
|
|
DylanPiercey |
Allow for external and inline sourcemap generation separately
|
f7277c9
|
|||
|
|
michaelficarra |
Merge pull request #4193 from DylanPiercey/master
Allow for external and inline sourcemap generation separately |
65c35e0
|
|||
|
|
lydell |
Fix broken `CoffeeScript.register()` and commit build
Commit 347a625 is a bit problematic: - It doesn't include the built .js files. - It breaks `CoffeeScript.register()`. This can be seen by running the tests; four of them fails. The error is that `CoffeeScript.register()` calls `CoffeeScript._compileFile()` with the `sourceMap` option enabled, which returns an object while the code expected a string. This commit fixes the broken `CoffeeScript.register()`, by setting the `sourceMap` option to `false` (but still keeping the `inlineMap` option enabled, which was the intention of commit 347a625). It also commits the built .js files. The tests now pass. |
34b4311
|
Commits on Feb 03, 2016
|
|
pra85 |
Fix minor typo
Remove extra `the` |
402133a
|
|||
|
|
michaelficarra |
Merge pull request #4199 from pra85/patch-1
Fix minor typo |
9590ad7
|
Commits on Feb 29, 2016
|
|
nvignola |
Change a bad link in documentation
|
f80a8a5
|
Commits on Mar 01, 2016
|
|
michaelficarra |
Merge pull request #4212 from nvignola/issue4042
Change a bad link in documentation issue#4042 |
87216ea
|
Commits on Mar 05, 2016
|
|
lydell |
Refactor `Literal` into several subtypes
Previously, the parser created `Literal` nodes for many things. This resulted in information loss. Instead of being able to check the node type, we had to use regexes to tell the different types of `Literal`s apart. That was a bit like parsing literals twice: Once in the lexer, and once (or more) in the compiler. It also caused problems, such as `` `this` `` and `this` being indistinguishable (fixes #2009). Instead returning `new Literal` in the grammar, subtypes of it are now returned instead, such as `NumberLiteral`, `StringLiteral` and `IdentifierLiteral`. `new Literal` by itself is only used to represent code chunks that fit no category. (While mentioning `NumberLiteral`, there's also `InfinityLiteral` now, which is a subtype of `NumberLiteral`.) `StringWithInterpolations` has been added as a subtype of `Parens`, and `RegexWithInterpolations` as a subtype of `Call`. This makes it easier for other programs to make use of CoffeeScript's "AST" (nodes). For example, it is now possible to distinguish between `"a #{b} c"` and `"a " + b + " c"`. Fixes #4192. `SuperCall` has been added as a subtype of `Call`. Note, though, that some information is still lost, especially in the lexer. For example, there is no way to distinguish a heredoc from a regular string, or a heregex without interpolations from a regular regex. Binary and octal number literals are indistinguishable from hexadecimal literals. After the new subtypes were added, they were taken advantage of, removing most regexes in nodes.coffee. `SIMPLENUM` (which matches non-hex integers) had to be kept, though, because such numbers need special handling in JavaScript (for example in `1..toString()`). An especially nice hack to get rid of was using `new String()` for the token value for reserved identifiers (to be able to set a property on them which could survive through the parser). Now it's a good old regular string. In range literals, slices, splices and for loop steps when number literals are involved, CoffeeScript can do some optimizations, such as precomputing the value of, say, `5 - 3` (outputting `2` instead of `5 - 3` literally). As a side bonus, this now also works with hexadecimal number literals, such as `0x02`. Finally, this also improves the output of `coffee --nodes`: # Before: $ bin/coffee -ne 'while true "#{a}" break' Block While Value Bool Block Value Parens Block Op + Value """" Value Parens Block Value "a" "break" # After: $ bin/coffee -ne 'while true "#{a}" break' Block While Value BooleanLiteral: true Block Value StringWithInterpolations Block Op + Value StringLiteral: "" Value Parens Block Value IdentifierLiteral: a StatementLiteral: break |
021d2e4
|
|||
|
|
michaelficarra |
Merge pull request #4198 from lydell/node-types
Refactor `Literal` into several subtypes |
8afb7cc
|
|||
|
|
michaelficarra |
compile InfinityLiterals to 2e308
|
585932c
|
Commits on Mar 06, 2016
|
|
lydell |
Unify, simplify and fixup assignment errors
- Show the same type of error message for compound assignment as for `=` assignment when the LHS is invalid. - Show the same type of error message when trying to assign to a CoffeeScript keyword as when trying to assign to a JavaScript keyword. - Now longer treat `&& =` as `&&=`. The same goes for `and=`, `||=` and `or=`. - Unify the error message to: `<optional type> '<value>' can't be assigned`. |
4d8cd03
|
|||
|
|
michaelficarra |
Merge pull request #4221 from lydell/assignment-errors
Unify, simplify and fixup assignment errors |
5b7ac32
|
|||
|
|
lydell |
Split out properties from identifiers
- Split out a PROPERTY token from the IDENTIFIER token. - Split out Property from the Identifier in the grammar. - Split out PropertyLiteral from IdentifierLiteral. |
e42fc47
|
|||
|
|
lydell |
Merge pull request #4220 from lydell/propertyliteral
Split out properties from identifiers |
cbc72a2
|
|||
|
|
lydell |
Treat Infinity and NaN as reserved words
Fixes #4218. |
9a0babf
|
|||
|
|
lydell |
Improve inline source maps generation
- Inline source maps are now shorter by not using pretty-printed JSON.
- `.register()`ed files are now given more information in their inline source
maps: The name and contents of the source file.
- Some code cleanup.
If you decode the inline source map generated (when using `.register()`) for a
file test.coffee with the contents `console.log "it works!"`, here is the
output:
Before:
{
"version": 3,
"file": "",
"sourceRoot": "",
"sources": [
""
],
"names": [],
"mappings": "AAAA;EAAA,OAAO,CAAC,GAAR,CAAY,eAAZ;AAAA"
}
After:
{"version":3,"file":"","sourceRoot":"","sources":["test.coffee"],"names":[],"mappings":"AAAA;EAAA,OAAO,CAAC,GAAR,CAAY,WAAZ;AAAA","sourcesContent":["console.log \"it works!\"\n"]}
Related: #4214. |
841b3cd
|
|||
|
|
michaelficarra |
Merge pull request #4223 from lydell/inline-maps
Improve inline source maps generation |
6291b53
|
Commits on Mar 07, 2016
|
|
michaelficarra |
Merge pull request #4219 from lydell/infinity-nan
Treat Infinity and NaN as reserved words |
e318469
|
Commits on Mar 09, 2016
|
|
eventualbuddha |
Fix typo.
|
d7385ec
|
|||
|
|
michaelficarra |
Merge pull request #4226 from eventualbuddha/patch-1
Fix typo. |
88192c1
|
Commits on Apr 14, 2016
|
|
benbuckman |
Fix 'Error: EBADF: bad file descriptor, write' on `.exit` in REPL
Fixes issue #4252. |
7c2f348
|
Commits on Jun 02, 2016
|
|
lydell |
Fix failing source map tests
This should have been done in commit 841b3cd, but I forgot to. Since that commit, `SourceMap::generate` returns an object instead of `JSON.stringify()` of that object, but the tests still compared strings. Fixes #4269. Note: `SourceMap::generate` is only used internally, so its change in return type is not a breaking change. The "public API" is unchanged. |
d7e752b
|
Commits on Jun 10, 2016
|
|
lydell |
Improve naming of generated 'i-variables'
In for example `for` loops, a variable called `i` is generated (for the loop index). If that name is unavailable, `j` is used instead, then `k`, `l`, etc. all the way to `z`. Then, `aa`, `ab`, `ac` etc. are used. This meant that, eventually, `do` would be used, but that's not a valid variable name since `do` is a JavaScript keyword. This logic was also inefficiently implemented. For example, going from `aa` to `ab` or from `az` to `ba` required lots of loop iterations. This commit changes the variable naming convention. Now, `i`, `j`, `k`, etc. to `z` are used like before. Then comes `i1`, `j1`, `k1`, etc. Then `i2`, `j2`, `k2` and so on. This is simpler, efficient and easier to understand. `i1` is more obvious to be a loop index than `aa`. Fixes #4267. |
0247b13
|
Commits on Jun 19, 2016
|
|
lydell |
Merge pull request #4274 from lydell/for-variables
Improve naming of generated 'i-variables' |
ec333a0
|
Commits on Jul 25, 2016
|
|
GeoffreyBooth |
Fix misspellings
|
a598024
|
|||
|
|
lydell |
Merge pull request #4289 from GeoffreyBooth/fix-typos
Fix misspellings |
133fadd
|
Commits on Jul 30, 2016
|
|
alangpierce |
Fix incorrect location data in OUTDENT nodes
In f609036, a line was changed from `if length > 0 then (length - 1) else 0` to `Math.max 0, length - 1`. However, in some cases, the `length` variable can be `undefined`. The previous code would correctly compute `lastCharacter` as 0, but the new code would compute it as `NaN`. This would cause trouble later on: the end location would just be the end of the current chunk, which would be incorrect. Here's a specific case where the parser was behaving incorrectly: ``` a { b: -> return c d, if e f } g ``` The OUTDENT tokens after the `f` had an undefined length, so the `NaN` made it so the end location was at the end of the file. That meant that various nodes in the AST, like the `return` node, would incorrectly have an end location at the end of the file. To fix, I just reverted the change to that particular line. |
bd0024a
|
Commits on Aug 02, 2016
|
|
alangpierce |
Add a test that tokens have locations that are in order
|
feb42e5
|
Commits on Sep 14, 2016
|
|
GeoffreyBooth |
Support import and export of ES2015 modules (#4300)
This pull request adds support for ES2015 modules, by recognizing `import` and `export` statements. The following syntaxes are supported, based on the MDN [import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) and [export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export) pages: ```js import "module-name" import defaultMember from "module-name" import * as name from "module-name" import { } from "module-name" import { member } from "module-name" import { member as alias } from "module-name" import { member1, member2 as alias2, … } from "module-name" import defaultMember, * as name from "module-name" import defaultMember, { … } from "module-name" export default expression export class name export { } export { name } export { name as exportedName } export { name as default } export { name1, name2 as exportedName2, name3 as default, … } export * from "module-name" export { … } from "module-name" ``` As a subsitute for ECMAScript’s `export var name = …` and `export function name {}`, CoffeeScript also supports: ```js export name = … ``` CoffeeScript also supports optional commas within `{ … }`. This PR converts the supported `import` and `export` statements into ES2015 `import` and `export` statements; it **does not resolve the modules**. So any CoffeeScript with `import` or `export` statements will be output as ES2015, and will need to be transpiled by another tool such as Babel before it can be used in a browser. We will need to add a warning to the documentation explaining this. This should be fully backwards-compatible, as `import` and `export` were previously reserved keywords. No flags are used. There are extensive tests included, though because no current JavaScript runtime supports `import` or `export`, the tests compare strings of what the compiled CoffeeScript output is against what the expected ES2015 should be. I also conducted two more elaborate tests: * I forked the [ember-piqu](https://github.com/pauc/piqu-ember) project, which was an Ember CLI app that used ember-cli-coffeescript and [ember-cli-coffees6](https://github.com/alexspeller/ember-cli-coffees6) (which adds “support” for `import`/`export` by wrapping such statements in backticks before passing the result to the CoffeeScript compiler). I removed `ember-cli-coffees6` and replaced the CoffeeScript compiler used in the build chain with this code, and the app built without errors. [Demo here.](https://github.com/GeoffreyBooth/coffeescript-modules-test-piqu) * I also forked the [CoffeeScript version of Meteor’s Todos example app](https://github.com/meteor/todos/tree/coffeescript), and replaced all of its `require` statements with the `import` and `export` statements from the original ES2015 version of the app on its `master` branch. I then updated the `coffeescript` Meteor package in the app to use this new code, and again the app builds without errors. [Demo here.](https://github.com/GeoffreyBooth/coffeescript-modules-test-meteor-todos) The discussion history for this work started [here](#4160) and continued [here](GeoffreyBooth#2). @lydell provided guidance, and @JimPanic and @rattrayalex contributed essential code. |
66ac8af
|
|||
|
|
lydell |
Merge pull request #4291 from alangpierce/fix-outdent-location-data
Fix incorrect location data in OUTDENT nodes |
ec9c4d8
|
|||
|
|
lydell |
Fix CLI crash when `null` is thrown
Before:
```
$ ./bin/coffee -e 'throw null'
/src/coffee-script/lib/coffee-script/command.js:251
message = err.stack || ("" + err);
^
TypeError: Cannot read property 'stack' of null
at compileScript ...
```
After:
```
$ ./bin/coffee -e 'throw null'
null
```
Supersedes and closes #4135. |
0e0e8f8
|
|||
|
|
lydell |
Fix source maps for errors thrown from .coffee.md files
Before:
```
$ cat tmp.coffee.md
test
a
$ ./bin/coffee tmp.coffee.md
ReferenceError: a is not defined
at Object.<anonymous> (/src/coffee-script/tmp.coffee.md:2:3)
...
```
Note how the line and column numbers (2 and 3, respectively) are not
correct.
After:
```
$ ./bin/coffee tmp.coffee.md
ReferenceError: a is not defined
at Object.<anonymous> (/home/lydell/forks/coffee-script/tmp.coffee.md:3:5)
...
```
Line 3, column 5 is the actual position of the `a` in tmp.coffee.md.
Supersedes and fixes #4204. |
9ae377b
|
Commits on Sep 15, 2016
|
|
GeoffreyBooth |
Be much more careful about parsing `*` in import and export statement…
…s; handle export expressions that use `*` on the same line as `export` |
51f24e0
|
|||
|
|
lydell |
Merge pull request #4308 from GeoffreyBooth/import-export
Be much more careful about parsing `*` in import and export statements |
7667cb2
|
Commits on Sep 18, 2016
|
|
GeoffreyBooth |
Add modules documentation (#4309)
|
a8b77fb
|
Commits on Sep 24, 2016
Unified
Split
Showing
with
7,072 additions
and 4,402 deletions.
- +0 −11 .npmignore
- +1 −1 CNAME
- +1 −1 CONTRIBUTING.md
- +3 −0 Cakefile
- +2 −2 bower.json
- +0 −24 documentation/coffee/aliases.js
- +0 −24 documentation/coffee/array_comprehensions.js
- +0 −2 documentation/coffee/block_comment.coffee
- +0 −7 documentation/coffee/block_comment.js
- +1 −1 documentation/coffee/cake_tasks.coffee
- +0 −14 documentation/coffee/cake_tasks.js
- +0 −4 documentation/coffee/chaining.js
- +0 −57 documentation/coffee/classes.js
- +0 −6 documentation/coffee/comparisons.js
- +0 −15 documentation/coffee/conditionals.js
- +0 −17 documentation/coffee/constructor_destructuring.js
- +0 −9 documentation/coffee/default_args.js
- +1 −1 documentation/coffee/do.coffee
- +0 −12 documentation/coffee/do.js
- +0 −6 documentation/coffee/embedded.js
- +0 −14 documentation/coffee/existence.js
- +0 −6 documentation/coffee/expansion.js
- +1 −1 documentation/coffee/expressions.coffee
- +0 −18 documentation/coffee/expressions.js
- +0 −4 documentation/coffee/expressions_assignment.js
- +1 −1 documentation/coffee/expressions_comprehension.coffee
- +0 −11 documentation/coffee/expressions_comprehension.js
- +0 −12 documentation/coffee/expressions_try.js
- +1 −1 documentation/coffee/fat_arrow.coffee
- +0 −12 documentation/coffee/fat_arrow.js
- +0 −10 documentation/coffee/functions.js
- +1 −1 documentation/coffee/generators.coffee
- +0 −13 documentation/coffee/generators.js
- +0 −4 documentation/coffee/heredocs.js
- +0 −4 documentation/coffee/heregexes.js
- +0 −8 documentation/coffee/interpolation.js
- +22 −0 documentation/coffee/modules.coffee
- +0 −8 documentation/coffee/modulo.js
- +0 −8 documentation/coffee/multiple_return_values.js
- +0 −18 documentation/coffee/object_comprehensions.js
- +0 −13 documentation/coffee/object_extraction.js
- +0 −22 documentation/coffee/objects_and_arrays.js
- +0 −6 documentation/coffee/objects_reserved.js
- +0 −45 documentation/coffee/overview.js
- +0 −8 documentation/coffee/parallel_assignment.js
- +0 −7 documentation/coffee/patterns_and_splats.js
- +0 −4 documentation/coffee/prototypes.js
- +0 −11 documentation/coffee/range_comprehensions.js
- +1 −1 documentation/coffee/scope.coffee
- +0 −12 documentation/coffee/scope.js
- +0 −12 documentation/coffee/slices.js
- +0 −4 documentation/coffee/soaks.js
- +0 −23 documentation/coffee/splats.js
- +0 −6 documentation/coffee/splices.js
- +0 −4 documentation/coffee/strings.js
- +1 −1 documentation/coffee/switch.coffee
- +0 −24 documentation/coffee/switch.js
- +0 −19 documentation/coffee/switch_with_no_expression.js
- +0 −12 documentation/coffee/try.js
- +0 −22 documentation/coffee/while.js
- +5 −3 documentation/css/docs.css
- +13 −15 documentation/docs/browser.html
- +7 −7 documentation/docs/cake.html
- +156 −99 documentation/docs/coffee-script.html
- +56 −54 documentation/docs/command.html
- +443 −372 documentation/docs/grammar.html
- +35 −35 documentation/docs/helpers.html
- +1 −1 documentation/docs/index.html
- +486 −397 documentation/docs/lexer.html
- +1,706 −1,362 documentation/docs/nodes.html
- +16 −16 documentation/docs/optparse.html
- +8 −8 documentation/docs/register.html
- +25 −25 documentation/docs/repl.html
- +135 −135 documentation/docs/rewriter.html
- +46 −40 documentation/docs/scope.html
- +31 −31 documentation/docs/sourcemap.html
- +162 −25 documentation/index.html.js
- +1 −1 documentation/js/aliases.js
- +1 −1 documentation/js/array_comprehensions.js
- +1 −1 documentation/js/block_comment.js
- +1 −1 documentation/js/cake_tasks.js
- +1 −1 documentation/js/chaining.js
- +1 −1 documentation/js/classes.js
- +1 −1 documentation/js/comparisons.js
- +1 −1 documentation/js/conditionals.js
- +1 −1 documentation/js/constructor_destructuring.js
- +1 −1 documentation/js/default_args.js
- +1 −1 documentation/js/do.js
- +1 −1 documentation/js/embedded.js
- +1 −1 documentation/js/existence.js
- +1 −1 documentation/js/expansion.js
- +1 −1 documentation/js/expressions.js
- +1 −1 documentation/js/expressions_assignment.js
- +1 −1 documentation/js/expressions_comprehension.js
- +1 −2 documentation/js/expressions_try.js
- +1 −1 documentation/js/fat_arrow.js
- +1 −1 documentation/js/functions.js
- +2 −2 documentation/js/generators.js
- +1 −1 documentation/js/heredocs.js
- +1 −1 documentation/js/heregexes.js
- +1 −1 documentation/js/interpolation.js
- +66 −0 documentation/js/modules.js
- +1 −1 documentation/js/modulo.js
- +1 −1 documentation/js/multiple_return_values.js
- +1 −1 documentation/js/object_comprehensions.js
- +1 −1 documentation/js/object_extraction.js
- +1 −1 documentation/js/objects_and_arrays.js
- +1 −1 documentation/js/objects_reserved.js
- +1 −1 documentation/js/overview.js
- +1 −1 documentation/js/parallel_assignment.js
- +1 −1 documentation/js/patterns_and_splats.js
- +1 −1 documentation/js/prototypes.js
- +1 −1 documentation/js/range_comprehensions.js
- +1 −1 documentation/js/scope.js
- +1 −1 documentation/js/slices.js
- +1 −1 documentation/js/soaks.js
- +1 −1 documentation/js/splats.js
- +1 −1 documentation/js/splices.js
- +1 −1 documentation/js/strings.js
- +1 −1 documentation/js/switch.js
- +1 −1 documentation/js/switch_with_no_expression.js
- +2 −2 documentation/js/try.js
- +1 −1 documentation/js/while.js
- +1 −1 examples/beautiful_code/binary_search.coffee
- +1 −1 examples/beautiful_code/regular_expression_matcher.coffee
- +1 −1 examples/code.coffee
- +1 −1 examples/computer_science/binary_search.coffee
- +1 −1 examples/computer_science/bubble_sort.coffee
- +1 −1 examples/computer_science/merge_sort.coffee
- +1 −1 examples/computer_science/selection_sort.coffee
- +6 −6 extras/coffee-script.js
- +375 −145 index.html
- +4 −7 lib/coffee-script/browser.js
- +2 −2 lib/coffee-script/cake.js
- +69 −30 lib/coffee-script/coffee-script.js
- +20 −20 lib/coffee-script/command.js
- +157 −41 lib/coffee-script/grammar.js
- +5 −4 lib/coffee-script/helpers.js
- +1 −1 lib/coffee-script/index.js
- +92 −48 lib/coffee-script/lexer.js
- +755 −259 lib/coffee-script/nodes.js
- +1 −1 lib/coffee-script/optparse.js
- +278 −158 lib/coffee-script/parser.js
- +2 −2 lib/coffee-script/register.js
- +5 −5 lib/coffee-script/repl.js
- +3 −3 lib/coffee-script/rewriter.js
- +10 −3 lib/coffee-script/scope.js
- +3 −3 lib/coffee-script/sourcemap.js
- +8 −2 package.json
- +4 −6 src/browser.coffee
- +49 −16 src/coffee-script.coffee
- +6 −4 src/command.coffee
- +113 −30 src/grammar.coffee
- +93 −39 src/lexer.coffee
- +422 −212 src/nodes.coffee
- +1 −1 src/optparse.coffee
- +1 −1 src/register.coffee
- +2 −2 src/repl.coffee
- +6 −4 src/rewriter.coffee
- +8 −2 src/scope.litcoffee
- +2 −2 src/sourcemap.litcoffee
- +9 −0 test/control_flow.coffee
- +335 −7 test/error_messages.coffee
- +14 −0 test/functions.coffee
- +8 −23 test/generators.coffee
- +19 −0 test/location.coffee
- +658 −0 test/modules.coffee
- +12 −0 test/numbers.coffee
- +1 −1 test/operators.coffee
- +22 −8 test/sourcemap.coffee
- +2 −0 test/strict.coffee
- +1 −0 test/test.html
View
11
.npmignore
| @@ -1,11 +0,0 @@ | ||
| -*.coffee | ||
| -*.html | ||
| -.DS_Store | ||
| -.git* | ||
| -Cakefile | ||
| -documentation/ | ||
| -examples/ | ||
| -extras/coffee-script.js | ||
| -raw/ | ||
| -src/ | ||
| -test/ |
View
2
CNAME
| @@ -1 +1 @@ | ||
| -coffeescript.org | ||
| +coffeescript.org |
View
2
CONTRIBUTING.md
| @@ -6,4 +6,4 @@ | ||
| * Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffeescript/tree/master/src). If you're just getting started with CoffeeScript, there's a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide). | ||
| -* In your pull request, do not add documentation to `index.html` or re-build the minified `coffee-script.js` file. We'll do those things before cutting a new release. | ||
| +* In your pull request, do not add documentation to `index.html` or re-build the minified `coffee-script.js` file. We'll do those things before cutting a new release. | ||
View
3
Cakefile
| @@ -54,6 +54,9 @@ codeFor = -> | ||
| js = js.replace /^\/\/ generated.*?\n/i, '' | ||
| cshtml = "<pre><code>#{hljs.highlight('coffeescript', cs).value}</code></pre>" | ||
| + # Temporary fix until highlight.js adds support for newer CoffeeScript reserved words | ||
| + if file is 'modules' | ||
| + cshtml = cshtml.replace /(import|export|from|as|default) /g, '<span class="reserved">$1</span> ' | ||
| jshtml = "<pre><code>#{hljs.highlight('javascript', js).value}</code></pre>" | ||
| append = if executable is yes then '' else "alert(#{executable});" | ||
| if executable and executable != yes | ||
View
4
bower.json
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "coffee-script", | ||
| - "version": "1.10.0", | ||
| + "version": "1.11.0", | ||
| "main": [ | ||
| "lib/coffee-script/coffee-script.js" | ||
| ], | ||
| @@ -14,7 +14,7 @@ | ||
| "devDependencies": { | ||
| "uglify-js": "~2.2", | ||
| "jison": ">=0.2.0", | ||
| - "highlight.js": "~8.0.0", | ||
| + "highlight.js": "~9.6.0", | ||
| "underscore": "~1.5.2", | ||
| "docco": "~0.6.2" | ||
| }, | ||
View
24
documentation/coffee/aliases.js
| @@ -1,24 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var volume, winner; | ||
| - | ||
| -if (ignition === true) { | ||
| - launch(); | ||
| -} | ||
| - | ||
| -if (band !== SpinalTap) { | ||
| - volume = 10; | ||
| -} | ||
| - | ||
| -if (answer !== false) { | ||
| - letTheWildRumpusBegin(); | ||
| -} | ||
| - | ||
| -if (car.speed < limit) { | ||
| - accelerate(); | ||
| -} | ||
| - | ||
| -if (pick === 47 || pick === 92 || pick === 13) { | ||
| - winner = true; | ||
| -} | ||
| - | ||
| -print(inspect("My name is " + this.name)); |
View
24
documentation/coffee/array_comprehensions.js
| @@ -1,24 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var courses, dish, food, foods, i, j, k, l, len, len1, len2, ref; | ||
| - | ||
| -ref = ['toast', 'cheese', 'wine']; | ||
| -for (j = 0, len = ref.length; j < len; j++) { | ||
| - food = ref[j]; | ||
| - eat(food); | ||
| -} | ||
| - | ||
| -courses = ['greens', 'caviar', 'truffles', 'roast', 'cake']; | ||
| - | ||
| -for (i = k = 0, len1 = courses.length; k < len1; i = ++k) { | ||
| - dish = courses[i]; | ||
| - menu(i + 1, dish); | ||
| -} | ||
| - | ||
| -foods = ['broccoli', 'spinach', 'chocolate']; | ||
| - | ||
| -for (l = 0, len2 = foods.length; l < len2; l++) { | ||
| - food = foods[l]; | ||
| - if (food !== 'chocolate') { | ||
| - eat(food); | ||
| - } | ||
| -} |
View
2
documentation/coffee/block_comment.coffee
| @@ -2,5 +2,3 @@ | ||
| SkinnyMochaHalfCaffScript Compiler v1.0 | ||
| Released under the MIT License | ||
| ### | ||
| - | ||
| - | ||
View
7
documentation/coffee/block_comment.js
| @@ -1,7 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| - | ||
| -/* | ||
| -SkinnyMochaHalfCaffScript Compiler v1.0 | ||
| -Released under the MIT License | ||
| - */ | ||
| - |
View
2
documentation/coffee/cake_tasks.coffee
| @@ -6,4 +6,4 @@ task 'build:parser', 'rebuild the Jison parser', (options) -> | ||
| require 'jison' | ||
| code = require('./lib/grammar').parser.generate() | ||
| dir = options.output or 'lib' | ||
| - fs.writeFile "#{dir}/parser.js", code | ||
| + fs.writeFile "#{dir}/parser.js", code | ||
View
14
documentation/coffee/cake_tasks.js
| @@ -1,14 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var fs; | ||
| - | ||
| -fs = require('fs'); | ||
| - | ||
| -option('-o', '--output [DIR]', 'directory for compiled code'); | ||
| - | ||
| -task('build:parser', 'rebuild the Jison parser', function(options) { | ||
| - var code, dir; | ||
| - require('jison'); | ||
| - code = require('./lib/grammar').parser.generate(); | ||
| - dir = options.output || 'lib'; | ||
| - return fs.writeFile(dir + "/parser.js", code); | ||
| -}); |
View
4
documentation/coffee/chaining.js
| @@ -1,4 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -$('body').click(function(e) { | ||
| - return $('.box').fadeIn('fast').addClass('.active'); | ||
| -}).css('background', 'white'); |
View
57
documentation/coffee/classes.js
| @@ -1,57 +0,0 @@ | ||
| -// 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; | ||
| - | ||
| -Animal = (function() { | ||
| - function Animal(name) { | ||
| - this.name = name; | ||
| - } | ||
| - | ||
| - Animal.prototype.move = function(meters) { | ||
| - return alert(this.name + (" moved " + meters + "m.")); | ||
| - }; | ||
| - | ||
| - return Animal; | ||
| - | ||
| -})(); | ||
| - | ||
| -Snake = (function(superClass) { | ||
| - extend(Snake, superClass); | ||
| - | ||
| - function Snake() { | ||
| - return Snake.__super__.constructor.apply(this, arguments); | ||
| - } | ||
| - | ||
| - Snake.prototype.move = function() { | ||
| - alert("Slithering..."); | ||
| - return Snake.__super__.move.call(this, 5); | ||
| - }; | ||
| - | ||
| - return Snake; | ||
| - | ||
| -})(Animal); | ||
| - | ||
| -Horse = (function(superClass) { | ||
| - extend(Horse, superClass); | ||
| - | ||
| - function Horse() { | ||
| - return Horse.__super__.constructor.apply(this, arguments); | ||
| - } | ||
| - | ||
| - Horse.prototype.move = function() { | ||
| - alert("Galloping..."); | ||
| - return Horse.__super__.move.call(this, 45); | ||
| - }; | ||
| - | ||
| - return Horse; | ||
| - | ||
| -})(Animal); | ||
| - | ||
| -sam = new Snake("Sammy the Python"); | ||
| - | ||
| -tom = new Horse("Tommy the Palomino"); | ||
| - | ||
| -sam.move(); | ||
| - | ||
| -tom.move(); |
View
6
documentation/coffee/comparisons.js
| @@ -1,6 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var cholesterol, healthy; | ||
| - | ||
| -cholesterol = 127; | ||
| - | ||
| -healthy = (200 > cholesterol && cholesterol > 60); |
View
15
documentation/coffee/conditionals.js
| @@ -1,15 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var date, mood; | ||
| - | ||
| -if (singing) { | ||
| - mood = greatlyImproved; | ||
| -} | ||
| - | ||
| -if (happy && knowsIt) { | ||
| - clapsHands(); | ||
| - chaChaCha(); | ||
| -} else { | ||
| - showIt(); | ||
| -} | ||
| - | ||
| -date = friday ? sue : jill; |
View
17
documentation/coffee/constructor_destructuring.js
| @@ -1,17 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var Person, tim; | ||
| - | ||
| -Person = (function() { | ||
| - function Person(options) { | ||
| - var ref; | ||
| - this.name = options.name, this.age = options.age, this.height = (ref = options.height) != null ? ref : 'average'; | ||
| - } | ||
| - | ||
| - return Person; | ||
| - | ||
| -})(); | ||
| - | ||
| -tim = new Person({ | ||
| - name: 'Tim', | ||
| - age: 4 | ||
| -}); |
View
9
documentation/coffee/default_args.js
| @@ -1,9 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var fill; | ||
| - | ||
| -fill = function(container, liquid) { | ||
| - if (liquid == null) { | ||
| - liquid = "coffee"; | ||
| - } | ||
| - return "Filling the " + container + " with " + liquid + "..."; | ||
| -}; |
View
2
documentation/coffee/do.coffee
| @@ -1,4 +1,4 @@ | ||
| for filename in list | ||
| do (filename) -> | ||
| fs.readFile filename, (err, contents) -> | ||
| - compile filename, contents.toString() | ||
| + compile filename, contents.toString() |
View
12
documentation/coffee/do.js
| @@ -1,12 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var filename, fn, i, len; | ||
| - | ||
| -fn = function(filename) { | ||
| - return fs.readFile(filename, function(err, contents) { | ||
| - return compile(filename, contents.toString()); | ||
| - }); | ||
| -}; | ||
| -for (i = 0, len = list.length; i < len; i++) { | ||
| - filename = list[i]; | ||
| - fn(filename); | ||
| -} |
View
6
documentation/coffee/embedded.js
| @@ -1,6 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var hi; | ||
| - | ||
| -hi = function() { | ||
| - return [document.title, "Hello JavaScript"].join(": "); | ||
| -}; |
View
14
documentation/coffee/existence.js
| @@ -1,14 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var footprints, solipsism, speed; | ||
| - | ||
| -if ((typeof mind !== "undefined" && mind !== null) && (typeof world === "undefined" || world === null)) { | ||
| - solipsism = true; | ||
| -} | ||
| - | ||
| -speed = 0; | ||
| - | ||
| -if (speed == null) { | ||
| - speed = 15; | ||
| -} | ||
| - | ||
| -footprints = typeof yeti !== "undefined" && yeti !== null ? yeti : "bear"; |
View
6
documentation/coffee/expansion.js
| @@ -1,6 +0,0 @@ | ||
| -// 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"; | ||
| - | ||
| -ref = text.split(" "), first = ref[0], last = ref[ref.length - 1]; |
View
2
documentation/coffee/expressions.coffee
| @@ -6,4 +6,4 @@ grade = (student) -> | ||
| else | ||
| "C" | ||
| -eldest = if 24 > 21 then "Liz" else "Ike" | ||
| +eldest = if 24 > 21 then "Liz" else "Ike" | ||
View
18
documentation/coffee/expressions.js
| @@ -1,18 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var eldest, grade; | ||
| - | ||
| -grade = function(student) { | ||
| - if (student.excellentWork) { | ||
| - return "A+"; | ||
| - } else if (student.okayStuff) { | ||
| - if (student.triedHard) { | ||
| - return "B"; | ||
| - } else { | ||
| - return "B-"; | ||
| - } | ||
| - } else { | ||
| - return "C"; | ||
| - } | ||
| -}; | ||
| - | ||
| -eldest = 24 > 21 ? "Liz" : "Ike"; |
View
4
documentation/coffee/expressions_assignment.js
| @@ -1,4 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var one, six, three, two; | ||
| - | ||
| -six = (one = 1) + (two = 2) + (three = 3); |
View
2
documentation/coffee/expressions_comprehension.coffee
| @@ -1,3 +1,3 @@ | ||
| # The first ten global properties. | ||
| -globals = (name for name of window)[0...10] | ||
| +globals = (name for name of window)[0...10] |
View
11
documentation/coffee/expressions_comprehension.js
| @@ -1,11 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var globals, name; | ||
| - | ||
| -globals = ((function() { | ||
| - var results; | ||
| - results = []; | ||
| - for (name in window) { | ||
| - results.push(name); | ||
| - } | ||
| - return results; | ||
| -})()).slice(0, 10); |
View
12
documentation/coffee/expressions_try.js
| @@ -1,12 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var error; | ||
| - | ||
| -alert((function() { | ||
| - var error1; | ||
| - try { | ||
| - return nonexistent / void 0; | ||
| - } catch (error1) { | ||
| - error = error1; | ||
| - return "And the error is ... " + error; | ||
| - } | ||
| -})()); |
View
2
documentation/coffee/fat_arrow.coffee
| @@ -3,4 +3,4 @@ Account = (customer, cart) -> | ||
| @cart = cart | ||
| $('.shopping_cart').on 'click', (event) => | ||
| - @customer.purchase @cart | ||
| + @customer.purchase @cart | ||
View
12
documentation/coffee/fat_arrow.js
| @@ -1,12 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var Account; | ||
| - | ||
| -Account = function(customer, cart) { | ||
| - this.customer = customer; | ||
| - this.cart = cart; | ||
| - return $('.shopping_cart').on('click', (function(_this) { | ||
| - return function(event) { | ||
| - return _this.customer.purchase(_this.cart); | ||
| - }; | ||
| - })(this)); | ||
| -}; |
View
10
documentation/coffee/functions.js
| @@ -1,10 +0,0 @@ | ||
| -// Generated by CoffeeScript 1.10.0 | ||
| -var cube, square; | ||
| - | ||
| -square = function(x) { | ||
| - return x * x; | ||
| -}; | ||
| - | ||
| -cube = function(x) { | ||
| - return square(x) * x; | ||
| -}; |
View
2
documentation/coffee/generators.coffee
| @@ -5,4 +5,4 @@ perfectSquares = -> | ||
| yield num * num | ||
| return | ||
| -window.ps or= perfectSquares() | ||
| +window.ps or= perfectSquares() | ||
Oops, something went wrong.
Showing you all comments on commits in this comparison.
|