esnext / es6-module-transpiler

Tomorrow’s JavaScript module syntax today
http://esnext.github.io/es6-module-transpiler/
Other
1.21k stars 85 forks source link

support for classes #176

Closed caridy closed 9 years ago

caridy commented 9 years ago

note: classes are supported today if they are transformed before the transpiler kicks in, but we should also support them natively so the order of the processors should be irrelevant.

add support for classes, specifically:

export class foo {} 
export default class {}
export default class foo {}

which is (nearly) equivalent to:

export function foo () {}
export default function () {}
export default function foo () {}

Considerations:

/cc @matthewrobb

domenic commented 9 years ago

which is equivalent to:

Not exactly. Classes don't hoist like function declarations do.