344 Commits

Author SHA1 Message Date
Logan Smyth
8339e036bf Remove babel.analyse and surrounding helpers. 2017-09-29 15:17:11 -07:00
Logan Smyth
fc448ca8f2 Flatten, process, and cache incoming options by key. 2017-09-27 11:20:27 -07:00
Logan Smyth
5eda451fb8 Remove the unused '.addImports' API from 'babel-core'. 2017-09-26 11:28:57 -07:00
Logan Smyth
b115ea5da7 Merge pull request #6280 from loganfsmyth/only-transform-modules
Only transform 'this'->'undefined' and inject 'use strict' if module statements are present
2017-09-23 11:24:52 -07:00
Mateusz Burzyński
9159323b1e Skip adding explicit undefined for let declarations when it is not ne… (#6288) 2017-09-21 22:26:08 -07:00
Mateusz Burzyński
88b7983e4f Fixed asyncToGenerator helper using arrow function (#6289) 2017-09-21 17:09:43 -07:00
Logan Smyth
2b88e079ef Only transform this/use strict if a module. 2017-09-20 10:19:35 -07:00
Henry Zhu
57584268cd move out syntax plugins to babel/babel-archive, they don't need to be updated (#6229) 2017-09-19 15:19:13 -04:00
Mateusz Burzyński
4519f95a29 Fixed buildExternalHelpers tool for var and module output types (#6260) 2017-09-19 14:44:40 -04:00
Ajay Narain Mathur
3cdb7d7f0f added instanceOf plugin to preset es2015 (#6257)
* added instanceOf plugin to preset es2015

* fixed test cases
2017-09-17 17:33:42 -04:00
Logan Smyth
158e9fbfd7 Represent helpers as simple modules. 2017-09-12 22:15:16 -07:00
Sven SAULEAU
0c5fae2faa Make sure source type is module when parsing .mjs (#5700)
* feat: force source type module for mjs extension

* style: fix lint
2017-09-12 20:59:00 -07:00
Logan Smyth
1e750a945c Convert CommonJS to use new shared implementation. 2017-09-12 17:17:41 -07:00
Mateusz Burzyński
c47258d68c Annotating transformed classes with #__PURE__ comment (#6209) 2017-09-11 11:18:37 -04:00
Mateusz Burzyński
fffa604023 Fixed regenerator related fixtures 2017-08-16 10:02:33 +02:00
Henry Zhu
0f823beeb1 Newlines in fixtures (#6044)
* write newlines for fixtures

* rerun fixtures
2017-08-02 15:35:29 -04:00
chocolateboy
605adc922d allow PluginPass.file.addImport to create empty import statements (#6022)
* allow PluginPass.file.addImport to create empty import statements; fixes #6021

omitting addImport's second argument creates an import statement with an
empty `specifiers` array i.e. an empty import statement:

plugin:

    Program (path, { file }) {
        file.addImport('foo-bar/register')
    }

output:

    import "foo-bar/register";
2017-07-28 12:37:00 -04:00
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