* centralize plugin options
* Centralize plugins options
- move more options to the top
- move validations that depend on options to the top
* use isLoose option
* Move more validations to the top
* Move ref parameter for rewriteModuleStatementsAndPrepareHeader() to the top
* fix eslint errors
* remove unused parameter
* set default systemGlobal value
* Revert "Move ref parameter for rewriteModuleStatementsAndPrepareHeader() to the top"
This reverts commit b3855302d17fa19d8acb4c8accab3680c8d2710e.
* Revert "Move more validations to the top"
This reverts commit e5861d8a034ff8f553391f55654f753bcf428a5d.
* fix allowMutablePropsOnTags option usage
* improve naming
* change Contructor definition for sake of consistency
* move allowMutablePropsOnTags validation to the top
* add missing !
* add transform-class-properties to stage 3, set spec mode to default
* update readme with examples; use `buildUndefinedNode()`; change behavior to always define both static and nonstatic class properties regardless of spec/loose mode; update tests
* 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
* moved applying arguments inside new Promise handler block
* updated test fixture to reflect change
* corrected the apply to use correct scope and arguments
* added regression test for issue #4943, added async-to-generator/async-default-arguments test
* added regression test for issue #4943
* switched back to using arrow function, since now pointing to v7 release base branch
* simplified async-to-generator regression test for issue #4943, imrproved change to self/arguments refs by using arrow function on returned promise
* updated text fixtures
* removed es2015 preset usage from issue #4943 regression exec test
* added use strict to test fixture
* added use strict to test fixture
* added destructing transform to test options
* removed use strict from exec test
* added parameters & destructing transforms to test
When you write
```
for (const x of l) {
setTimeout(() => x);
}
```
we need to add a closure because the variable is meant to be block-scoped and recreated each time the block runs. We do this.
However, we also add the closure when no loop is present. This isn't necessary, because if no loop is present then each piece of code runs at most once. I changed the transform to only add a closure if a variable is referenced from within a loop.