* Remove whitespace generation and rely on default printing
Changes to printing:
* Add newline after last empty SwitchCase
* Add newlines around block comments if they are non-flow comments or contain newlines
* Fix a few more fixtures
* Handle arrow function processing via shared API rather than default plugin.
* Fix a few small PR comments.
* Preserve existing spec arrow 'this' rewrites, and support spec in subclass constructors.
Previously, all "bare imports" (e.g. `import './foo';`) were moved to the
end of the array of sources. I presume this was done to remove needless
variables in the callback signature.
Unfortunately, doing this actually changes the intent of the program.
Modules should be evaluated in the order that they were in the source.
In the case of a bare import, it is quite possible that the bare import
has side effects that a later required module should see. With the current
implementation the later imported modules are evaluated before that "side
effecty" module has been evaluated.
Obviously, it is better to avoid these sorts of side effect ridden modules
but even still you could imagine a similar issue with cycles.
This change ensures that module source order is preserved in the AMD
dependencies list, and avoids making needless variables as much as possible.
* Consolidate contiguous var declarations in destructuring transform
Fixes#3081.
* Simplify var node coalescing in es2015-destructuring
* Revert "Simplify var node coalescing in es2015-destructuring"
This reverts commit 15cb373f0726f68225f7080a7ae206a63af174ee.
* More careful condition for var coalescing in es2015-destructuring
* Flip default parameter template
YMMV, I saved ~10b on a 2kb library. Not noticeable at the small scale, by why not do it anyway?
I've (unscientifically) found that flipping the default parameter conditional yields better gzip results. I think this is due to the slightly longer string it can now repeatedly match:
```js
// old
var param = arguments.length <= 0 || void 0 === arguments[0] ? null : arguments[0]
--------------------------------------------------------------^
// new
var param = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null
------------------------------------------------------------------------^
```
Though it's entirely likely gzip will also choose up to the index of the arguments if you many default parameters at different indexes.
* Update tests