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
32c03222bf
Add support for this type to Babel 6.x
2015-12-23 13:54:57 -05: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
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
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
Amjad Masad
4aaaeb9ccf
decouple arrow functions from function exprs
2015-12-17 23:31:52 -08:00
Amjad Masad
c889ef4058
Parenthesize arrow function when part of logical or binary expression
2015-12-17 23:18:43 -08:00
Amjad Masad
4c693085a6
Merge pull request #3180 from babel/needsblock
...
Handle nested if statements with alternates in printer
2015-12-17 23:06:05 -08:00
Amjad Masad
47b686b6fa
Handle nested if statements with alternates in printer
...
Previously we saw a bug that when we have nested if statements
and an alternate then the generated code may confuse which
if statement the alternate belongs to.
e.g.
```
if (foo) if (bar) bar(); else baz();
```
But this was handled by looking at the consequent
and if it's an if we add a block. However we didn't
handle situations where it's not an if but the last
recursive statement is an if:
```
if (foo) while (bar) if (baz) baz(); else shoosh()
```
This handles it by recurring until we get the last
statement.
2015-12-17 22:41:55 -08:00
Marshall Roch
8b55f4dfc2
Upgrade to flow 0.20.0
2015-12-17 12:49:48 -08:00
Steven Luscher
b6dabff82e
Correct type annotation for shouldPrintComment
...
I think this is supposed to be a `Function` that returns a `boolean`.
2015-12-17 10:50:59 -08:00
voideanvalue
2ac8e836f5
[babel-generator] fix unhandled new-precedence edge case
2015-12-16 12:51:13 -08:00
Amjad Masad
320cede9be
Fix invalid codegen for number member expr
2015-12-15 17:47:46 -08:00
Amjad Masad
007ef5cdbb
Use the leftMost from the right to check if we need spaces in BinaryExpressions
2015-12-14 13:36:52 -08:00
Amjad Masad
07df8515b9
Parenthesize object expression when it could end up at the start of an expression T6811
2015-12-11 18:04:16 -08:00
Amjad Masad
cb03a98b65
Add minified format option
...
As a follow up from #3145 we agreed to add a new format that is a
superset of the compact format option. Do things that are considered
dangerous. e.g. not printing semicolons, or print literal values
as opposed to raw values.
2015-12-09 17:34:23 -08:00
Amjad Masad
b8f5ca4ff0
Merge pull request #3145 from babel/always-print
...
Always print strings for consistency
2015-12-07 14:12:32 -05:00
Amjad Masad
874ab9dfc7
Merge pull request #3147 from babel/seq-throw
...
Don't print on throw statements with sequence exprs
2015-12-07 14:01:38 -05:00
Amjad Masad
4b99d18ea7
Only reprint in compact mode
2015-12-07 10:59:50 -08:00
Amjad Masad
5b5cd761df
fix logical expression
2015-12-07 10:38:14 -08:00
Amjad Masad
19daae6d96
Don't print on throw statements with sequence exprs
2015-12-07 02:48:11 -08:00
Amjad Masad
8689d1a045
Never print comments in compact mode
2015-12-07 02:37:53 -08:00
Amjad Masad
89e6d5bc7e
Always print strings for consistency
2015-12-07 02:30:14 -08:00
Henry Zhu
6082ac8a59
skip nested new expressions
2015-12-05 14:19:31 -05:00
Henry Zhu
21f76655ad
account for parent NewExpression with arguments
2015-12-05 13:37:06 -05:00
Henry Zhu
8a1ad5350c
Merge pull request #3111 from amasad/new
...
No need for parens for new expressions without args
2015-12-05 13:33:23 -05:00
Amjad Masad
9c20ace184
Add support for null literal type
2015-12-03 23:58:25 -08:00
Amjad Masad
54a2a47030
Fix spacing in binary expression when right is a binary expression and has a unary on the left
2015-12-01 10:37:58 -08:00
Amjad Masad
c78c27a8d6
It's only valid if the node is the callee
2015-11-24 19:24:05 -08:00
Amjad Masad
486d781be3
Handle member expressions
2015-11-24 19:20:06 -08:00
Amjad Masad
f1f6c820fe
Handle new X()()
2015-11-24 19:12:24 -08:00
Amjad Masad
d32fae6fcd
No need for parens for new expressions without args
2015-11-24 19:07:03 -08:00
Amjad Masad
e481c5b570
use + instead of template string
2015-11-24 19:01:12 -08:00
Amjad Masad
e4c5d9dcb3
Respect compact mode in spacing
2015-11-24 19:01:12 -08:00
Amjad Masad
44d5552840
Fix up semicolon omission in compact mode
2015-11-23 21:32:44 -08:00
Sebastian McKenzie
f8c2beb9d8
Merge pull request #3088 from kpdecker/terminal-after-comment
...
Output auxiliaryCommentAfter before trail comment
2015-11-17 23:01:32 -08:00
Amjad Masad
1612c70c10
Take the alternate existence into account
2015-11-17 19:16:19 -08:00
Amjad Masad
35e575cf93
Print a block when encountering consequents that are if statements
2015-11-17 19:07:20 -08:00
kpdecker
1286200712
Output auxiliaryCommentAfter before trail comment
...
Quick fix for the case where generated comment is the terminal leaf in a subtree that is followed by a trailing comment.
Partial for #3034
2015-11-16 20:59:24 -06:00
Daniel Lo Nigro
0076204f80
Fix Flow.
...
Removed `@flow` annotation from files that don't actually pass Flow check at the moment. These will be added back file by file once the files are properly converted to use Flow.
Closes #3064
2015-11-15 21:30:22 -08:00
kpdecker
488f5a067e
Avoid duplicate auxiliary start if in aux section
...
Fixes #3032
2015-11-13 13:43:23 -06:00
Sebastian McKenzie
9d8db74517
only infer whitespace when we've been passed tokens
2015-11-13 03:37:27 -08:00
Sebastian McKenzie
139a61e50d
account for integers with decimal 0 - fixes #3002
2015-11-11 22:11:47 -08:00
Henry Zhu
99284822f3
babel-generator: ignore if TemplateLiteral - fixes #2821
2015-11-07 19:55:36 -05:00
Paolo Moretti
232bf76b4d
preserve original indentation in template literals, fixes #2613
2015-11-03 18:05:26 +00:00
Sebastian McKenzie
7dc1b4e7e9
add ExistentialTypeParam - fixes #2587
2015-11-03 13:48:03 +00:00