116 Commits

Author SHA1 Message Date
Henry Zhu
a0f0411abf v7.0.0-alpha.15 2017-07-11 23:35:22 -04:00
Henry Zhu
03f249430a v7.0.0-alpha.14 2017-07-11 22:53:09 -04:00
Henry Zhu
8460b4c62f v7.0.0-alpha.13 2017-07-11 22:27:56 -04:00
Daniel Tschinder
b3372a572d Remove whitespace generation (#5833)
* 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
2017-06-27 21:57:02 -05:00
Brian Ng
e4b35f680d
Run prettier 2017-06-27 12:15:00 -05:00
Henry Zhu
123dce5fcd Hardcode to double quotes, indent to 2 spaces (#5824) 2017-06-05 22:14:37 -05:00
Henry Zhu
c5bad22767 v7.0.0-alpha.12 2017-05-31 17:11:39 -04:00
Henry Zhu
ce976bba2a v7.0.0-alpha.11 2017-05-31 16:43:30 -04:00
Justin Ridgewell
2579c5b6e9 Merge pull request #5775 from peey/switch-continue
Switch continue
2017-05-27 22:45:14 -04:00
Henry Zhu
9b44cef691 v7.0.0-alpha.10 2017-05-25 15:17:07 -04:00
Peeyush Kushwaha
72d83acc07 Properly convert continue statements in switch
Ignore just non-label break statements in a switch, and allow continue
statments and lablled break statements.

Fixes #5725
2017-05-25 13:49:29 +05:30
Logan Smyth
14584c218c Kill the "shadow-functions.js" internal plugin in favor of an explicit helper (#5677)
* 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.
2017-05-05 13:27:18 -07:00
Henry Zhu
62375cdf12 v7.0.0-alpha.9 2017-04-18 10:41:30 -04:00
Henry Zhu
25ae8c8554 v7.0.0-alpha.8 2017-04-17 15:12:31 -04:00
Henry Zhu
c732f5e1d0 v7.0.0-alpha.7 2017-04-05 17:13:26 -04:00
Henry Zhu
f3ef03abfd use caret for devDeps 2017-03-27 16:32:13 -04:00
Henry Zhu
7a1ccf076c Misc (#5545)
* normalize npmignores

* fixup eslint ignore, etc

* lint

* remove unused

* rm from gitignore

* use strict
2017-03-25 21:46:16 -04:00
Henry Zhu
ab68800e06 v7.0.0-alpha.3 2017-03-23 15:49:01 -04:00
Nitin Tulswani
8c1cd177b2 added examples for transforms. [skip ci] (#5393) 2017-03-14 09:43:51 -05:00
Henry Zhu
230712e091 Internal: back to fixed, publish everything (#5436) 2017-03-08 22:56:00 -05:00
Brian Ng
8a82cc060a Run new lint rules (#5413) 2017-03-04 10:46:01 -05:00
Henry Zhu
11e54a6bd3 v7.0.0-alpha.1 2017-03-02 16:04:47 -05:00
Daniel Tschinder
6c03cb0783
Merge branch 'master' into merge-master
# Conflicts:
#	lerna.json
#	packages/babel-cli/package.json
#	packages/babel-core/package.json
#	packages/babel-generator/package.json
#	packages/babel-helper-builder-react-jsx/package.json
#	packages/babel-helper-function-name/package.json
#	packages/babel-helper-optimise-call-expression/package.json
#	packages/babel-helper-replace-supers/package.json
#	packages/babel-helper-transform-fixture-test-runner/package.json
#	packages/babel-helpers/package.json
#	packages/babel-plugin-transform-class-properties/package.json
#	packages/babel-plugin-transform-es2015-block-scoping/package.json
#	packages/babel-plugin-transform-es2015-classes/package.json
#	packages/babel-plugin-transform-es2015-modules-commonjs/package.json
#	packages/babel-plugin-transform-es2015-modules-systemjs/package.json
#	packages/babel-plugin-transform-es2015-modules-umd/package.json
#	packages/babel-plugin-transform-es2015-parameters/package.json
#	packages/babel-plugin-transform-react-jsx/package.json
#	packages/babel-register/package.json
#	packages/babel-template/package.json
#	packages/babel-traverse/package.json
#	packages/babel/package.json
2017-02-14 12:46:23 +01:00
Logan Smyth
48573f1fb4 v6.23.0 2017-02-13 17:14:12 -08:00
Ben Alpert
14d3c2e256 Avoid adding unnecessary closure for block scoping (#5246)
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.
2017-02-13 13:46:00 -08:00
Henry Zhu
9083bd6283 Merge branch 'master' into 7.0 2017-02-09 18:36:02 -05:00
Ben Alpert
ff8a10e52f Add option to block-scoping to slow on throw code (#5236)
The let/const plugin can add closures where you don't expect them. This is undesirable in some perf-sensitive projects (ex: React). I added an option that throws whenever the plugin adds a function (as opposed to simply renaming variables when converting to var).
2017-02-06 13:50:56 -05:00
Logan Smyth
b845f2b69d Re-enable the max-len ESLint rule. (#5265) 2017-02-04 11:07:15 -05:00
Kai Cataldo
e09ea222c9 Remove babel-runtime from packages' dependencies (#5218) 2017-01-27 09:04:35 -05:00
Henry Zhu
e9fc38bcd3 v6.22.0 2017-01-19 19:33:22 -05:00
Sergey Rubanov
292c3ca206 Refactor test packages to use ES modules instead of CJS (#5138) 2017-01-16 11:25:04 -05:00
Henry Zhu
672adba9a1 enable prefer const (#5113) 2017-01-14 09:48:52 -05:00
Henry Zhu
77d9e3e5c4 v6.21.0 2016-12-16 16:55:53 -05:00
Henry Zhu
670ee996c8 Merge pull request #4940 from appden/fix-react-constant-elements
Fix React constant element bugs
2016-12-16 15:29:05 -05:00
Henry Zhu
608e77e389 v6.20.0 2016-12-08 18:25:39 -05:00
Ben Newman
26b4e0909e Add (and fix) failing test of function parameter bindings in a catch block (#4880)
* Add failing test of function parameter bindings in a catch block.

This test can be run in isolation via the following command:

  TEST_GREP='block-scoping.*function in catch' make test-only

This test fails because BlockScoping#getLetReferences accidentally
considers the parameters of the function declaration as let bindings in
the catch scope. When the name of the catch parameter is the same as one
of the function's parameter names, the function declaration will be
unnecessarily wrapped to isolate its parameters from the outer scope.

While the extra wrapping may not seem harmful in this case, this behavior
is a symptom of a deeper problem that causes very subtle bugs in transform
code involving catch parameters and function declarations. This test case
was just the simplest example I could find to demonstrate the problem.

I have a proposed fix for this problem that I will push as soon as the
tests fail for this commit.

* Make BlockScoping#getLetReferences ignore function parameters.
2016-12-08 10:16:48 -05:00
Scott Kyle
5a9509205b Fix constant elements hoisted out of block (#4419)
When block scoped variables caused the block to be wrapped in a closure, the variable `bindings` remained in parent function scope, which caused the JSX element to be hoisted out of the closure.
2016-12-03 19:54:53 -08:00
Brian Ng
f71efbce92 Update transform-es2015 READMEs from babel.github.io [skip ci] (#4926)
Signed-off-by: Brian Ng <bng412@gmail.com>
2016-12-01 16:11:36 -05:00
Henry Zhu
e86f62b304 README: add --save-dev [skip ci]
Closes gh-4910
2016-11-29 08:40:27 -05:00
Sven SAULEAU
2311b5b53a README: remove dollar in sh snippets [skip ci] 2016-11-29 08:39:23 -05:00
Henry Zhu
12f9cd0826 v6.18.0 2016-10-24 17:18:36 -04:00
Moti Zilberman
7a7704fea0 Fix block scoping transform for declarations in labeled statements (#4669)
* Fix block scoping transform for declarations in labeled statements (#4122)

* DRY block-scoping
2016-10-05 21:47:21 +02:00
Henry Zhu
b3dca4fb5a v6.15.0 2016-09-01 11:03:06 -04:00
Ryan Biwer
23ea626241 Fix block scope remapping (fixes T7525) (#3662) 2016-09-01 10:48:32 -04:00
Henry Zhu
5ce325c399 v6.14.0 2016-08-24 17:40:46 -06:00
Adam Leventhal
0d1e1ee10c incorrect handling of returns nested in switch cases (#3618) 2016-08-18 10:14:07 -04:00
Logan Smyth
e64aeb7316 v6.10.1 2016-06-11 00:36:09 -07:00
Logan Smyth
5ddce1372b Fix an issue with the switch handing from PR #3490. 2016-06-11 00:17:36 -07:00
Henry Zhu
c5ae951f98 v6.10.0 2016-06-11 00:05:21 -04:00
Logan Smyth
61b3a6314b Merge pull request #3490 from jayphelps/T7324
create new lexical env inside switch statement blocks, fixes #T7324
2016-05-30 14:42:29 -07:00