* 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
* fix default exported classes without a name
This correctly requeues class without name so the es3 transform can
transform the default keyword.
* Replace phabricator issue number with github
* Fix buildExportAll to account for commonjs/amd
If the re-exported module was generated with Babel and it is a commonjs or amd module and so is the current module, this will result in an attempt to redefine the __esModule property, which throws a runtime error.
* Add test: don't overwrite __esModule on re-export
(Failing.)
* fixup tests
* Add fix for systemjs
The untransformed `let` keyword causes problems for older parsers. I
understand using `let` instead of `var` ensures each getter function has
its own binding for the KEY variable, but the same can be accomplished
(with less code) using a `.forEach` callback function, and this way
there's no need to worry about generating a unique name for the `key`
variable.