191 Commits

Author SHA1 Message Date
Amjad Masad
4b2a660ee0 Merge pull request #3323 from divmain/master
Source-map support for multiple input source files
2016-03-07 11:57:59 -08:00
Dale Bustad
3c6c09d00a Only detect indent if babel-generator is provided code string, vs multi-source object. 2016-03-07 02:47:28 -08:00
Dale Bustad
288b3ba559 Attach filename property to node.loc when provided. 2016-03-07 02:47:28 -08:00
Dale Bustad
f007b51554 Accept filename-to-file-content hash as code parameter of generate. 2016-03-07 02:47:28 -08:00
Dale Bustad
26dcd6400f When generating sourcemaps, use per-node source filename if present. 2016-03-07 02:47:27 -08:00
Sam Goldman
a38a58bad8 Add support for Flow def-site variance syntax
This syntax allows you to specify whether a type variable can appear in
a covariant or contravariant position, and is super useful for, say,
Promise.

Right now this is hacked in jankily, but in the next major release we
should stop using Identifier nodes for type parameters.
2016-03-06 14:44:09 -08:00
Henry Zhu
57ef6a2b6a v6.6.5 2016-03-04 18:16:17 -05:00
Amjad Masad
2fbe28cc88 Remove remaining @flow annotations 2016-03-03 15:10:59 -08:00
Amjad Masad
12ee11a0a4 Revert "Remove Flow annotations and pragmas"
This reverts commit 4252244d06b225ab26a02d52c04f9940a3e4d6a2.
2016-03-03 15:03:55 -08:00
Amjad Masad
3667527d04 Revert "Remove flow"
This reverts commit 2827ff6b01dcce69e9d3c0402e96b52b3a2a47ee.
2016-03-03 14:49:20 -08:00
Henry Zhu
39a8f5b796 v6.6.4 2016-03-02 16:29:17 -05:00
Sam Goldman
2827ff6b01 Remove flow 2016-03-01 22:33:30 -08:00
Henry Zhu
f34e6518ff v6.6.0 2016-02-29 16:12:12 -05:00
Henry Zhu
1271d2cd52 Merge pull request #3380 from babel/unary-arrow
Fix: Add parens for unary arrow function
2016-02-29 12:18:12 -05:00
Henry Zhu
66ea5342de Merge pull request #3379 from babel/memexp-numliteral
Fix: invalid codegen for non decimal numeric literals in MemberExpression
2016-02-29 11:40:30 -05:00
Henry Zhu
ec3c183668 Fix: Add parens for unary arrow function
Fixes T7157
2016-02-28 21:56:22 -05:00
Henry Zhu
35ed18f628 Fix invalid codegen for non decimal numeric literals in MemberExpression
Fixes T7156
2016-02-28 20:34:45 -05:00
Sam Goldman
5167d001c5 Remove @noflow as well 2016-02-28 13:25:36 -10:00
Sam Goldman
4252244d06 Remove Flow annotations and pragmas 2016-02-28 13:18:57 -10:00
Jason
28ca3f7f3a [generator] bug fix
- Fix Whitespace with empty token list
- Force a newline for line comments in concise mode
2016-02-17 13:01:54 +08:00
Sebastian McKenzie
b5bcd64120 noflow some files 2016-02-14 23:58:37 +00:00
Sebastian McKenzie
5b89849f43 Switch to klint, fix some lint rules 2016-02-14 23:25:14 +00:00
Henry Zhu
f9f8ad6eff v6.5.0 2016-02-06 19:06:41 -05:00
Henry Zhu
4e619db873 Merge pull request #3324 from zjmiller/master
Parenthize "in" in for-loop init, even when init has nested for-loop
2016-02-05 15:50:11 -05:00
Zachary Miller
33b4ef5d52 Parenthize "in" in for-loop init, even when init has nested for-loop 2016-02-05 14:28:01 -06:00
Jeff Morrison
e6951e99f0 Add support for leading pipes in Flow type alias RHS syntax 2016-02-05 13:23:55 -05:00
Amjad Masad
bcc32da0d9 Merge pull request #3316 from forivall/babel-generator-simplify-node
Simplify babel-generator/node/index.js
2016-02-04 14:10:16 -08:00
Henry Zhu
f8036c7230 Merge pull request #3311 from babel/object-body
[T7047] Consider arrow functions when parenthesizing object expressions
2016-02-04 14:44:22 -05:00
Henry Zhu
c2d7e95e1a add some more flow types 2016-02-04 11:07:03 -05:00
Jordan Klassen
8fd329a2f4 Remove "Node" class from generator, just use module
The Node class was unused as a class
2016-02-03 16:51:10 -08:00
Amjad Masad
9aac73e70b Merge pull request #3299 from robcolburn/multibyte-test
Ensure that we do not break mutli-byte handling
2016-02-02 16:45:50 -08:00
Amjad Masad
3d3b30eb45 [T7047]Consider arrow functions when parenthesizing object expressions 2016-02-02 16:26:31 -08:00
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
Rob Colburn
7b1b876dc2 Ensure that we do not break mutli-byte handling 2016-01-22 12:13:18 -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