google / traceur-compiler

Traceur is a JavaScript.next-to-JavaScript-of-today compiler
Apache License 2.0
8.17k stars 580 forks source link

Make module transformer the last transformer #2100

Closed arv closed 8 years ago

arv commented 8 years ago

This is so that other transformers can output import declarations in the future.

There are two real changes in here, both related to export declarations:

ClassTransformer: Make sure that export default class X {} generates valid code.

DestructuringTransformer: Make sure we do not export the temp variable.

arv commented 8 years ago

@johnjbarton PTAL

johnjbarton commented 8 years ago

LGTM

arv commented 8 years ago

I'll also add a feature test that ensures that a module instance object does not have any extra properties. Before this PR a module instance object would have a $__0 property if someone exported using destructuring in an export declaration.