249 Commits

Author SHA1 Message Date
Brian Ng
55aea26f13 Add support for export type star in babel-generator (#5985)
* Add support for export type star in babel-generator

* Bump babylon
2017-07-25 11:37:27 -04:00
MarckK
9fc910d8c0 Add optionality to catch bindings (#5956) 2017-07-25 09:38:48 -05:00
Ryan Gaus
0b890ced19 Code generator tests (#5847) 2017-07-20 18:22:18 -04:00
Naveen jain
245c78dcdc Added test cases for babel-generator (#5934)
* edited .gitignore to ignore all package-lock.json files
2017-07-20 11:39:26 -04:00
Sarup Banskota
213ad1ed7a [generator] remove parens from break & continue (#5950)
* Remove parens around break and continue

Fixes #5742

* Fix space in doc comment

* Add some tests

* Remove newlines within CommentBlock

* Prevent newline before/after label

* Remove reference to node

* Check for label within startTerminatorless

* Print block instead of single line comment

* Clean up
2017-07-17 09:30:28 -07: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
89d8f70fcd Merge pull request #5813 from jridgewell/pr/5786
Optional Chaining Operator (Stage 1)
2017-06-27 11:10:47 -04:00
Ryan Gaus
070662e381 Add tests for babel-generator (#5845)
Added two tests for src/generators/flow.js that check if a value is of
type `empty` or `mixed`.
2017-06-10 09:28:37 -04:00
Brian Ng
cce83a0cea Fix parens issues with exponentiation in generator (#5830) 2017-06-09 11:10:16 -04:00
Daniel Tschinder
36ab72f095 Support declare export statements (#5589)
* Add definition of declare export statements

* Add more codecoverage
2017-06-08 23:15:54 +02:00
Justin Ridgewell
f537fc7da7 Add babel-generator tests 2017-06-07 03:22:52 -04:00
Henry Zhu
123dce5fcd Hardcode to double quotes, indent to 2 spaces (#5824) 2017-06-05 22:14:37 -05:00
Nicolò Ribaudo
b0524427c1 Wrap an arrow function in parentheses if it the test of a conditional expression (#5820)
* Wrap an arrow function in parentheses if it the test of a conditional expression

Fixes #5819

* Use ConditionalExpresion to check if () => {} should be wrapped

* Move `t.isTaggedTemplateExpression()` from ArrowFunctionExpression to
  ConditionalExpresion

* [test] `await (() => {})` needs the parentheses

* [test] (a ? b : c)`` needs the parentheses
2017-06-05 12:39:28 -04:00
Brian Ng
3563823870
Print decorators before ExportDeclaration 2017-05-23 10:37:38 -05:00
Brian Ng
9d95b3faae
518-spread-assignable 2017-05-23 09:09:01 -05:00
Brian Ng
f8f2ead450
358-decorator-exported-class 2017-05-23 08:57:03 -05:00
Brian Ng
32c4cdf016
339-spread-obj-pattern-assignable 2017-05-23 08:43:15 -05:00
Brian Ng
889a505ffd
377-async-func-decl 2017-05-22 17:35:01 -05:00
Brian Ng
6c6ee74eb0
351-class-prop 2017-05-22 17:26:15 -05:00
Brian Ng
48ce5bcf1c
499-super-class-prop 2017-05-22 16:59:16 -05:00
Brian Ng
ec596604bc
474-export-default-exotic 2017-05-22 16:54:23 -05:00
Henry Zhu
d365dad341 add some tests 2017-05-22 17:48:20 -04:00
Conrad Buck
8434f89bc0 Add support for object type spread (#5525)
* Add support for object type spread

* Type spread: remove variance and add stripping test
2017-04-20 11:59:45 -04:00
Erik Simmler
769eddc788 Avoid creating a new line comment when a block comment is preceded by a forward slash (#5562)
Fixes #5557
2017-04-09 16:36:18 -07:00
Alex Rattray
348cc5eeff Use raw value of JSXText and JSXAttribute (#5256) 2017-04-04 15:46:20 +02:00
Henry Zhu
b638c8b3eb Transform the template literals revision proposal (#5523)
* Account for template literals revision

* extra tests

* update to babylon beta 7

* pr feedback (keep arr length the same)
2017-03-22 16:07:36 -04:00
Aaron Ang
3d987ed6c0 Keep parentheses for logical expression when in await expression (fix #5428) (#5433) 2017-03-09 09:13:53 -05:00
Brian Ng
8a82cc060a Run new lint rules (#5413) 2017-03-04 10:46:01 -05:00
Henry Zhu
696e63c58b Merge pull request #5380 from babel/extra-do + 6.x commits 2017-02-25 18:48:27 -05:00
Henry Zhu
6529cb5f01 babel-generator: add another do test 2017-02-25 18:39:18 -05:00
Alex Kuzmenko
01918c68c1 Improve babel-generator's code coverage (#5338) 2017-02-25 13:26:29 -05:00
Henry Zhu
d33d023594 Merge remote-tracking branch 'origin/master' into merge-master 2017-02-23 18:54:15 -05:00
Zachary Miller
6614a63b3b Wrap some generated do expressions in parens (#5339) 2017-02-22 07:50:58 -05:00
Henry Zhu
9083bd6283 Merge branch 'master' into 7.0 2017-02-09 18:36:02 -05:00
Erik Desjardins
e9d7757433 Emit parens for await (but not yield) of ternary expressions (#5270) 2017-02-06 09:06:48 -08:00
Logan Smyth
b845f2b69d Re-enable the max-len ESLint rule. (#5265) 2017-02-04 11:07:15 -05:00
Brian Ng
e530e3c025 [7.0] List babylon plugins instead of * in babel-generator tests (#5231) 2017-01-28 09:35:21 -05:00
Brian Ng
b69dc51be0 Fix missing parens when function expressions is tag (#5193) 2017-01-23 08:45:57 -08:00
Chau Nguyen
d710e6dd5b [7.0] Drop flowUsesCommas option from babel-generator (#5123) 2017-01-19 22:24:13 -05:00
Sergey Rubanov
292c3ca206 Refactor test packages to use ES modules instead of CJS (#5138) 2017-01-16 11:25:04 -05:00
Andres Suarez
85b3aec747 Use native or lodash util module where full "lodash" is required 2017-01-15 13:35:00 -08:00
Logan Smyth
3c2e9c0021 Merge pull request #5110 from loganfsmyth/flowtype-codegen
Validate importKind and ensure code generation exists.
2017-01-14 10:41:25 -08:00
Henry Zhu
672adba9a1 enable prefer const (#5113) 2017-01-14 09:48:52 -05:00
Logan Smyth
80a757819f Validate importKind and ensure code generation exists. 2017-01-13 22:17:39 -08:00
chico
2d7703afd9 Like was discussed in Slack chat with @ljharb and @hzoo spaces was added with no particular reason.
https://babeljs.slack.com/archives/discussion/p1481744017001806

I'm still not sure if everything here is correct (for example source maps)
2016-12-21 19:14:39 +03:00
Dan Harper
d90aaf2c76 Print Flow optional & type annotations in function params with defaults (#4872)
Fixes #4863
2016-12-16 15:31:05 -05:00
Brian Ng
01bc43464e Ensure directives get printed in block statements (#4873) 2016-12-16 15:30:14 -05:00
Justin Ridgewell
2bbc36d25e JSXSpreadChildren, throw in transform-react-jsx (#4988) 2016-12-16 15:30:00 -05:00