-
Notifications
You must be signed in to change notification settings - Fork 48
incompatibilities
Nami-Doc edited this page Jul 9, 2013
·
25 revisions
See additions for incompatibilities caused by additional features.
-
=to a variable declares it on the current scope. Use:=to modify ones on upper scopes. -
===/!==/==/!=each compiles as is. -
superrepresents the direct reference to the parent function rather than being a call itself. Usesuper ...(justsuperin Coffee) for full delegation. - Nested comprehensions return flattened results.
- Within non-triple-quoted strings (
''/""), indentations after newlines are ignored altogether. -
dodoes not specialcase function literals. Useletinstead. -
\does not introduce a pseudo block. It simply cancels following whitespaces.
- The roles of
inandofhave been swapped to keep the JS semantics. -
yes/ no / on / off are unreserved. Define your own or just use
true/false. -
switch-case-defaultreplacesswitch- when -else. -
for everreplaces loop. -
is notreplaces isnt. -
voidreplaces undefined. -
~>(wavy arrow) replaces => (fat arrow). -
when is removed. Use
a if b while cinstead of a while c when b. -
it/that/fallthroughare semi-reserved. They get special meanings depending on context. -
eval/argumentsare keywords as per ES5.
-
()is always a call; allowingf (), disallowing() ->. -
...is prefix as per harmony:spread. -
and/orand spaced./?.close implicit calls.f a .g b or h cmeansf(a).g(b) || h(c). - The range syntax ( x..y ) is removed.
- Block comment is
/* */rather than ### ### . - Heregex is
// //rather than /// ///. - No implicit call against blocks starting with an implicit object. Use
doinstead:
array.push do
a: 1
b: 2
-
a-bdesugars toaBinstead ofa - b -
"#variable" === '' + variableinstead of"#variable" === '#variable' - in a class constructor, omit
constructor:.
- CLIs are named coco and coke (to coexist with coffee and cake).
- JavaScriptLint support is removed (for being pointless).