327 Commits

Author SHA1 Message Date
Peeyush Kushwaha
4a35243118 Non string computed keys in object-rest-spread (#5757) 2017-07-25 09:46:52 -05:00
Justin Ridgewell
63204ae51e Remove maybePopFromStatements (#5945)
It prevented you from pushing into the `params` of a function.

```js
fnpath.pushContainer("params", t.identifier("memo"))
```
2017-07-18 14:55:33 -04:00
Brian Ng
58ec149c52 Fix some unneeded semis in test fixtures (#5892) 2017-06-27 22:15:10 -05: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
bd9e1860d0 for-of optimization on arrays/known functions that return arrays (#4747) 2017-06-26 16:47:39 -04:00
Peeyush Kushwaha
ee389384bc Update regenerator test relying on wrong semantics
Broken by fix to switch statements in block scoping
2017-05-25 13:51:13 +05:30
Steven Hargrove
d5aa6d3ff8 Fix for #4943 "Calling an async function with default parameter as function for arguments checking handled synchonous" (#5688)
* 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
2017-05-03 21:44:41 -07:00
Logan Smyth
d1d812edff Fix a regression from adding negation support in #5625. (#5641) 2017-04-17 18:13:37 -07:00
Logan Smyth
2b86d353d6 Restrict Babel's plugins/presets to a single target. (#5547) 2017-04-17 11:45:49 -07:00
Logan Smyth
c59e9f5f0e Merge pull request #5608 from loganfsmyth/config-cache
Cache configs based on mtime and allow .babelrc.js functions
2017-04-17 11:43:31 -07:00
Logan Smyth
1c078e5a76 Add tests for caching API and .babelrc.js functions. 2017-04-17 11:20:34 -07:00
Logan Smyth
ad250ef10a Merge pull request #5602 from loganfsmyth/option-manager-cleanup
Refactor OptionManager to be a short class with a bunch of pure helper functions.
2017-04-14 14:25:45 -07:00
Logan Smyth
d1c954b36f Allow negation of ignore and only patterns. (#5625) 2017-04-12 11:10:33 -07:00
Logan Smyth
d7e10a3adc Misc refactoring of OptionManager. 2017-04-10 10:01:01 -07:00
Logan Smyth
75847306fd Expose passes as a first-class output of OptionManager. 2017-04-10 10:01:01 -07:00
Logan Smyth
258e82ca13 Expose a function rather than a class from option-manager. 2017-04-10 10:01:01 -07:00
Logan Smyth
86fc4fbc4f Avoid using OptionManager statics 2017-04-10 10:01:01 -07:00
Andres Suarez
f0dc710a46 Remove unnecessary returns in asyncToGenerator helper (#5548)
* Remove unnecessary returns in asyncToGenerator helper

* Reuse "then" callbacks in asyncToGenerator helpher
2017-04-06 11:40:55 -04:00
Logan Smyth
d39400c9d5 Separate config/plugin loading from config processing. (#5563) 2017-04-04 14:48:48 -07:00
Logan Smyth
878a7c5fdb Add tests to test the plugin ordering. (#5571) 2017-03-31 18:52:58 -07:00
Henry Zhu
3d74dc044f fix ci 2017-03-27 17:26:39 -04:00
Henry Zhu
67253c5d27 babelrc false to relevant files 2017-03-27 17:19:02 -04:00
Kai Cataldo
1f2f63ccdf Fix: config lookup logic in babel-core (#5550)
This fixes a bug that was causing the config lookup to stop
when a package.json file was found even if it did not contain a
"babel" key.
2017-03-27 11:54:57 -07:00
Logan Smyth
3c63431c7e Move config loading helpers into config folder. 2017-03-17 00:03:59 -07:00
Logan Smyth
12a2124d16 Move the deeply nested option logic to a toplevel folder. 2017-03-17 00:03:58 -07:00
Logan Smyth
6c4810cea5 Move Plugin class to be part of config loading, independent of File. 2017-03-17 00:03:58 -07:00
Logan Smyth
bf13ed4da0 Limit where certain arguments are allowed in Babel config. 2017-03-17 00:03:58 -07:00
Logan Smyth
39c862c195 Make only/ignore relative to cwd/config file and move only/ignore checking all to core. (#5487)
* Make only/ignore relative to cwd/config file and move only/ignore checking all to core.
2017-03-16 23:22:43 -07:00
Logan Smyth
b6194a8533 Merge pull request #5467 from loganfsmyth/clean-options
Misc reorganizing and prep for ignore/only refactoring
2017-03-16 20:25:20 -07:00
Logan Smyth
dd1bc3b183 Resolve programmatic/CLI arguments from cwd, not file being compiled. (#5466) 2017-03-14 16:56:00 -07:00
Logan Smyth
bf4664b430 Invert the resolution order of config-chain to process higher-priority items first. 2017-03-14 13:39:57 -07:00
Logan Smyth
4f72232ca9 Move option parsing to babel-cli. 2017-03-13 11:06:46 -07:00
Logan Smyth
305165eda4 Remove Logger usage from options processing. 2017-03-09 16:13:38 -08:00
Kai Cataldo
d054cd0ea8 Add support for .babelrc.js files 2017-03-07 16:44:24 -05:00
Brian Ng
8a82cc060a Run new lint rules (#5413) 2017-03-04 10:46:01 -05:00
Daniel Tschinder
6d6cdf6baf [7.0] Allow presets to be objects (#5385)
* Allow presets to be objects

* Improve logic to detect preset format
2017-02-28 16:39:08 -05:00
Henry Zhu
d33d023594 Merge remote-tracking branch 'origin/master' into merge-master 2017-02-23 18:54:15 -05:00
Daniel Tschinder
87ca6150ae [7.0] Remove bc code from preset handling and preset-es2015 (#5128)
* Remove bc code from preset handling and preset-es2015

* Add more tests

* Only allow functions for presets

* Fix lint
2017-02-22 14:58:01 +01:00
Izaak Schroeder
8d9195f862 Pass dirname as extra metadata to preset constructor. (#4834)
* Pass `dirname` as extra metadata to preset constructor.

Sometimes a preset would like to know where it should resolve relative paths from (e.g. https://github.com/tleunen/babel-plugin-module-resolver) and this extra information makes that possible.

* Test for `dirname` passed into preset constructor

This adds a check for `dirname`’s existence and correctness to the
`resolve-addons-relative-to-file` test, and serves as a minimal example
of a path-aware preset.
2017-02-21 22:13:03 -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
e1fee21529 Add charset so tests work with convert-source-map@>1.4 (#5302) 2017-02-13 14:37:41 -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
Logan Smyth
b845f2b69d Re-enable the max-len ESLint rule. (#5265) 2017-02-04 11:07:15 -05:00
Sergey Rubanov
d0b42d4313 Update babel-core browserify fixture (#5164) 2017-01-20 10:29:44 +01:00
Jordan Jones
1742035a98 [7.0] Fixes #5108, browser.js and browser.js test removed (#5124)
* Fixes #5108, browser.js and browser.js test removed

* Moved api/node.js to index.js and adjusted associated file references
2017-01-19 22:43:11 -05:00
Sergey Rubanov
3a5ce620c8 [7.0] Deprecate babel-core/register.js (#5132)
* Deprecate babel-core/register.js

* add error when using `babel-core/register`
2017-01-19 22:22:45 -05:00
Brian Ng
8c35b320d3 Bump eslint-config-babel and fix lint (#5129) 2017-01-17 10:51:16 +01:00
Sergey Rubanov
292c3ca206 Refactor test packages to use ES modules instead of CJS (#5138) 2017-01-16 11:25:04 -05:00