158 Commits

Author SHA1 Message Date
Amjad Masad
5699403835 Add comment clarifying the optimization 2016-01-22 14:24:45 -08:00
Amjad Masad
7d719d9ce9 Merge pull request #3283 from gzzhanghao/gen-perf
Improve generator performance
2016-01-22 14:22:48 -08:00
Jason
e9fae4ca54 Update Whitespace._findToken 2016-01-20 16:37:46 +08:00
Jason
d11a2e3d48 Add type annotations for Whitespace._findToken 2016-01-20 13:01:32 +08:00
Henry Zhu
e152e7044e v6.4.5 2016-01-19 18:02:31 -05:00
Jason
993c5a572b Improve performance for generator.buffer 2016-01-20 02:04:26 +08:00
Jason
235d8397fd Make Whitespace._findToken private and add comments 2016-01-19 21:46:22 +08:00
Jason
ed227a6c8a Use binary search to improve getNewlinesBefore/After performance 2016-01-19 21:18:06 +08:00
Jason
76e3c5227b Improve generator performance by caching the last character in Buffer 2016-01-19 21:16:33 +08:00
Sebastian McKenzie
65a4c8f4a4 Merge branch 'source-map-reenter' of https://github.com/kpdecker/babel into kpdecker-source-map-reenter
Conflicts:
	packages/babel-generator/src/printer.js
2016-01-18 18:36:57 +00:00
Amjad Masad
3f2a445c9a v6.4.3 2016-01-13 21:56:22 -08:00
Amjad Masad
add96d626d Double quotes 2016-01-12 17:30:53 -08:00
Amjad Masad
0d9459dbb6 Fix minified labeledStatement printing
Unary expressions with alphabetic operators like 'void' were being
squished next to the statement.
2016-01-12 17:28:46 -08:00
ForbesLindesay
bd7b202866 Document options for babel-generator 2016-01-08 14:38:37 +00:00
Henry Zhu
7af1bd4354 v6.4.2 2016-01-06 21:26:43 -05:00
Amjad Masad
17ea5cd916 Fix failing test 2016-01-06 17:50:17 -08:00
Amjad Masad
139503e86f Parenthesize await/yield expression in binary expr 2016-01-06 17:35:39 -08:00
Amjad Masad
ada2fdbe4b v6.4.1 2016-01-06 16:27:49 -08:00
Amjad Masad
ec983b276e add assignment expression parentheses test 2016-01-06 16:03:45 -08:00
Amjad Masad
6abee425d3 Revert "babel-types: add Binary alias to AssignmentExpression definition (fixes T6887)"
This was causing problems with parenthesizing assignment expression
This reverts commit b5cf529d6b342b3dd8dd49c50cc9cd5fed4fc5a7.
2016-01-06 15:59:39 -08:00
Henry Zhu
8cac20d845 v6.4.0 2016-01-06 15:34:12 -05:00
Amjad Masad
e79c625091 Merge pull request #3229 from hzoo/T6913
Add a check for parentheses for AwaitExpressions (fixes T6913)
2016-01-06 14:22:54 -06:00
Mike Anderson
2471d80bd0 Fix small typo in babel-generator README 2016-01-05 23:33:50 -06:00
Sam Goldman
17d19a0056 Add export interface Flow syntax support
An interface export is just like a type export. In fact, it's a syntax affordance which makes the following equivalent:

```javascript
interface I_ { ... }
export type I = I_;
```

```javascript
export interface I { ... }
```

See facebook/flow#1145
2016-01-05 15:57:45 -08:00
Henry Zhu
cf41c321af Don't overparenthesize, add yield tests 2016-01-05 18:12:25 -05:00
Amjad Masad
06545e6f70 Merge pull request #3217 from babel/hzoo-patch-1
`babel-types`: add `Binary` alias to `AssignmentExpression` definitio…
2016-01-05 16:26:02 -06:00
Sam Goldman
26c97c4069 Add support for "declare interface" Flow syntax
This has been a feature in Flow for a long time (couldn't easily find a
specific commit adding this). Interfaces are basically undocumented, though, so
it's easy to see how this was missed.
2016-01-04 11:50:12 -08:00
Sam Goldman
e764346d5f Add support for "declare type" Flow syntax
See facebook/flow#1105
2016-01-04 11:42:43 -08:00
Henry Zhu
ab2135bc9f Add a check for parentheses for AwaitExpressions (fixes T6913) 2016-01-04 08:31:07 -05:00
Henry Zhu
b5cf529d6b babel-types: add Binary alias to AssignmentExpression definition (fixes T6887) 2016-01-01 14:44:28 -05:00
Amjad Masad
570b50c895 Merge pull request #3213 from babel/print-bugs
Fix various print inefficiencies/bugs
2015-12-27 18:28:27 -06:00
Sebastian McKenzie
5ca1cf0506 Merge pull request #3203 from samwgoldman/flow-mixins-6.x
Add support for mixins to Babel 6.x
2015-12-27 21:04:40 +00:00
Amjad Masad
5be9d9d8aa More tests 2015-12-27 01:59:24 -08:00
Amjad Masad
ed5a057e4e Fix various print inefficiencies/bugs 2015-12-27 01:24:19 -08:00
Amjad Masad
10c9d26983 Also use for object expressions 2015-12-24 15:01:46 -08:00
Amjad Masad
0d8e5a9e86 Fix over-parenthesizing of function expressions 2015-12-24 14:55:51 -08:00
Sam Goldman
e9c23ba7a1 Don't generate class mixins if prop doesn't exist 2015-12-23 16:37:14 -05:00
Sam Goldman
bb874a4e46 Add babel-generator support for mixins to Babel 6.x 2015-12-23 16:26:29 -05:00
Sam Goldman
32c03222bf Add support for this type to Babel 6.x 2015-12-23 13:54:57 -05:00
Amjad Masad
ae8b7ea352 v6.3.26 2015-12-22 23:11:59 -08:00
Amjad Masad
959021dc70 Merge pull request #3190 from hzoo/remove-await-star
Remove await* from babel-generator, add parsing error to babylon - (fixes T6688)
2015-12-22 22:57:23 -08:00
Amjad Masad
705b0959e7 v6.3.25 2015-12-21 13:59:11 -08:00
Amjad Masad
c5f504b865 Merge pull request #3189 from hzoo/T6859
babel-generator: keep double quotes in StringLiteral for JSX parent
2015-12-21 02:51:04 -08:00
Henry Zhu
276c98f7f0 Remove await* from babel-generator, add parsing error to babylon - (fixes T6688) 2015-12-19 23:15:09 -05:00
Henry Zhu
379be365d6 babel-generator: keep double quotes in StringLiteral for JSX parent (fixes T6859) 2015-12-19 22:12:41 -05:00
Steven Luscher
370c3ad343 Make use of opts.quotes in the CodeGenerator
I think we're meant to respect the value of `opts.quotes`, and try to infer it if none was supplied.
2015-12-18 18:23:20 -08:00
Amjad Masad
31032ee7ad v6.3.21 2015-12-18 00:23:03 -08:00
Amjad Masad
135e1e56ca Merge pull request #3182 from babel/arrow-fn
Parenthesize arrow function when part of logical or binary expression
2015-12-18 00:11:24 -08:00
kpdecker
9e382b1686 Fix aux comment termination in lists and calls 2015-12-18 01:37:26 -06:00
Amjad Masad
4aaaeb9ccf decouple arrow functions from function exprs 2015-12-17 23:31:52 -08:00