-
Notifications
You must be signed in to change notification settings - Fork 48
improvements
|
|
Coco uses them more wisely than Coffee, making generated code cleaner and/or faster.
|
|
|
|
|
|
Math += 1;
$ coco -bce 'Math += 1'
SyntaxError: assignment to undeclared variable "Math" on line 1
$ coffee -bce '{0, "0"}'
// Generated by CoffeeScript 1.3.3
({
0: 0,
"0": "0"
});
$ coco -bpe 'a:1, a:2'
SyntaxError: duplicate property "0" on line 1
$ coffee -bce 'x = (return)'
SyntaxError: cannot use a pure statement in an expression.
...
$ coco -bce 'x = (return)'
SyntaxError: inconvertible statement on line 1
...
$ cat space_tab.coffee
if 0
console.log 1
console.log 2
$ coffee space_tab.coffee
2
$ coco space_tab.coffee
Failed at: space_tab.coffee
SyntaxError: contaminated indent %09 on line 2
$ cat misdent.coffee
if 0
console.log 1
console.log 2
$ coffee misdent.coffee
2
$ coco misdent.coffee
Failed at: misdent.coffee
SyntaxError: unmatched dedent (2 for 4) on line 3
$ coffee -bce '[]()'
// Generated by CoffeeScript 1.3.3
[]();
$ coco -bce '[]()'
SyntaxError: invalid callee on line 1
$ coffee -bce '/+/'
// Generated by CoffeeScript 1.3.3
/+/;
$ coco -bce '/+/'
SyntaxError: Invalid regular expression: /+/: Nothing to repeat on line 1
$ coffee -bce '$= 1'
// Generated by CoffeeScript 1.3.3
var $;
$ = 1;
$ coco -bce '$= 1'
Error: Parse error on line 1: Unexpected '$'
$ node -e '$= 1'
undefined:1
^
SyntaxError: Unexpected token ILLEGAL
$ coffee -bce '0 instanceof 1'
// Generated by CoffeeScript 1.3.3
0 instanceof 1;
$ coco -bce '0 instanceof 1'
SyntaxError: invalid instanceof operand on line 1
$ node -e '0 instanceof 1'
undefined:1
^
TypeError: Expecting a function in instanceof check, but got 0
|
|
|
|
|
|
|
|