9088 Commits

Author SHA1 Message Date
Jhen
6cb3e5ed1f Add statement-no-block test fixture for remove-console/debugger 2016-07-19 13:02:29 +08:00
Jhen
e464b9ab87 Add block if parent is no block statement for remove-console/debugger 2016-07-19 12:56:29 +08:00
Logan Smyth
ab47b439cc Merge pull request #3586 from loganfsmyth/fix-retainLines-generator-issue
Avoid duplicated identifier sharing location - fixes T7436
2016-07-18 20:56:57 -07:00
Logan Smyth
ea426baa07 Avoid duplicated identifier sharing location - fixes T7436 2016-07-18 20:49:14 -07:00
Logan Smyth
a1c2d4dd5d Merge pull request #3584 from loganfsmyth/generator-refactor-cleanup2
babel-generator: More refactoring and optimizations
2016-07-18 19:23:24 -07:00
Logan Smyth
a13bf6e0be Drop the unhelpful 'keyword' helper. 2016-07-18 19:12:22 -07:00
Logan Smyth
1b527eb23c Perform number decimal checks at the token level. 2016-07-18 19:12:21 -07:00
Logan Smyth
9f49c99774 Drop .getLast(). 2016-07-18 19:12:21 -07:00
Justin Ridgewell
9a6890c92f Default parameters cleanup (#3574)
* Remove buildDefaultParamAssign

This seems to have been
[added](https://github.com/babel/babel/commit/4b85b05839017ab2abc03ba2d1
e875a63f002890) in v5.5.4 to address
[#1690](https://phabricator.babeljs.io/T1690). It [became
“dead”](https://github.com/babel/babel/blob/v6.0.0/packages/babel-core/t
est/fixtures/transformation/es6.parameters/default-before-last/expected.
js) (as far as I can tell) in the [v6.0.0
commit](https://github.com/babel/babel/commit/ae7d5367f1c3d438667242d692
5db024f875fccd).

Either way, this code is never executed.

- `pushDefNode` is only called when the param is a default param.
- `buildDefaultParamAssign` (which is inside `pushDefNode`) only runs
of the param index is less than or equals to the lastNonDefaultParam.
AKA, is this param before any non-defaulting params.

Which is a contradiction.

* Small optimization

No need to check if we need an iife if we already know we need one.
2016-07-18 11:03:59 -04:00
Daniel Tschinder
88eec4b852 Support all variations of v8Flags (#3578)
This adds support for specifying v8Flags with dashes. Previously only underscores
were allowed.
Also allows specifying values for v8Flags in the from --flag=value, which was not supported till now.
Also add --inspect support.
2016-07-18 10:36:03 -04:00
Logan Smyth
fdc5b7cb5d Only set the source location when inserting the comment text. 2016-07-17 21:51:01 -07:00
Logan Smyth
4dcec860bd Drop trailing whitespace after all newlines. 2016-07-17 21:51:01 -07:00
Logan Smyth
59fe72ee7d Avoid recalculating the current line. 2016-07-17 21:51:01 -07:00
Logan Smyth
1bbf109e8e Move aux comments entirely into printer. 2016-07-17 21:51:01 -07:00
Logan Smyth
11ee8642fd Drop the 'after' callback from 'print'. 2016-07-17 21:51:01 -07:00
Logan Smyth
59c1945493 Move whitespace handling into statement list printing. 2016-07-17 21:51:01 -07:00
Logan Smyth
5de7433147 Avoid calls to isUserWhitespacable by explicitly marking statement lists. 2016-07-17 21:51:00 -07:00
Logan Smyth
38b91235cc Print inter-node newlines before other node items. 2016-07-17 21:51:00 -07:00
Logan Smyth
6bf52b74c0 Include newline insertion in the call sites of rightBrace. 2016-07-17 12:39:22 -07:00
Logan Smyth
0e05e9f216 Rely on .space and .newline behavior instead of explicit format checks. 2016-07-17 12:39:22 -07:00
Logan Smyth
68bc3d7dfb Standardize on the comment format function. 2016-07-17 12:39:22 -07:00
Logan Smyth
a3c99278ba Move format definition into Printer. 2016-07-17 11:07:26 -07:00
Logan Smyth
0d5cbe6102 Move class static helpers off class. 2016-07-17 11:07:26 -07:00
Logan Smyth
5e730b18bb Instantiate Whitespace in the printer. 2016-07-17 11:07:25 -07:00
Logan Smyth
ca1d601037 Move property definitions to class props. 2016-07-17 11:07:24 -07:00
Logan Smyth
1d0ff341fd Skip mutating the 'ignore' flag when printing. 2016-07-17 11:06:31 -07:00
Logan Smyth
3cc38a0063 Merge pull request #3581 from loganfsmyth/generator-refactor-cleanup
babel-generator: Misc cleanup and stale code removal
2016-07-16 12:44:19 -07:00
Logan Smyth
a255ef9ba1 Merge pull request #3580 from jridgewell/babel-generator
Further optimize babel-generator Buffer
2016-07-16 12:40:55 -07:00
Logan Smyth
44282e4579 Disable indent and inc/dec time. 2016-07-14 22:58:48 -07:00
Logan Smyth
9b8b5112df Remove unneeded _compact assignment. 2016-07-14 22:58:48 -07:00
Logan Smyth
1bf76b0f33 Use .append to force-commit semicolons for empty statements. 2016-07-14 22:58:48 -07:00
Logan Smyth
bd9bb053c3 Flatten aux comment logic. 2016-07-14 22:58:48 -07:00
Logan Smyth
9483f4bd94 Drop old stale code. 2016-07-14 22:58:47 -07:00
Logan Smyth
b841d12c9e Initialize inForStatementInitCounter as a public var. 2016-07-14 22:58:47 -07:00
Logan Smyth
e056c0b9d6 Use the presence of _whitespace to toggle its use. 2016-07-14 22:58:47 -07:00
Logan Smyth
6a74731c6b Drop the private version of ._format 2016-07-14 22:58:47 -07:00
Logan Smyth
55a1ffd266 Mark a bunch of methods private. 2016-07-14 22:58:46 -07:00
Justin Ridgewell
a70755d0e6 Further optimize babel-generator Buffer
We can eek out a bit more speed from Babel generator by turning the
buffer into an array as well.
Re: #3565

```
Items: 2 , time: 4 length: 114
Items: 4 , time: 3 length: 218
Items: 8 , time: 3 length: 426
Items: 16 , time: 2 length: 861
Items: 32 , time: 5 length: 1741
Items: 64 , time: 2 length: 3501
Items: 128 , time: 4 length: 7106
Items: 256 , time: 8 length: 14530
Items: 512 , time: 12 length: 29378
Items: 1024 , time: 24 length: 59147
Items: 2048 , time: 38 length: 121611
Items: 4096 , time: 71 length: 246539
Items: 8192 , time: 131 length: 496395
Items: 16384 , time: 350 length: 1015260
Items: 32768 , time: 573 length: 2063836
Items: 65536 , time: 1263 length: 4160988
Items: 131072 , time: 2143 length: 8448509
Items: 262144 , time: 4859 length: 17230333
```

to

```
Items: 2 , time: 4 length: 114
Items: 4 , time: 3 length: 218
Items: 8 , time: 9 length: 426
Items: 16 , time: 1 length: 861
Items: 32 , time: 5 length: 1741
Items: 64 , time: 1 length: 3501
Items: 128 , time: 3 length: 7106
Items: 256 , time: 7 length: 14530
Items: 512 , time: 9 length: 29378
Items: 1024 , time: 17 length: 59147
Items: 2048 , time: 30 length: 121611
Items: 4096 , time: 61 length: 246539
Items: 8192 , time: 113 length: 496395
Items: 16384 , time: 307 length: 1015260
Items: 32768 , time: 443 length: 2063836
Items: 65536 , time: 1065 length: 4160988
Items: 131072 , time: 1799 length: 8448509
Items: 262144 , time: 4217 length: 17230333
```
2016-07-15 01:27:45 -04:00
Logan Smyth
6b7f3cc4cd Inline comment generation function. 2016-07-14 21:55:08 -07:00
Logan Smyth
475581dc66 Ditch the tiny Position class. 2016-07-14 21:55:08 -07:00
Logan Smyth
8379c21939 Drop unneeded condition in SourceMap class. 2016-07-14 21:54:47 -07:00
Henry Zhu
3073c63e58 Docs: 6.11.3 changelog [skip ci] (#3576) 2016-07-13 06:50:47 -04:00
Henry Zhu
7076c675d9 v6.11.3 2016-07-12 22:33:58 -04:00
Justin Ridgewell
823ffbd87c Fix error in rest parameter length optimization (#3573)
If there aren’t enough arguments to get to the offset index, we would
return an negative length.
2016-07-12 21:12:45 -04:00
James Talmage
0a9cbe6e83 git commit add test for package.json config 2016-07-07 16:58:22 -04:00
James Talmage
8e84196eb8 add tests for env options 2016-07-07 16:36:34 -04:00
Logan Smyth
57ef3ea8eb Merge pull request #3567 from loganfsmyth/fix-generator-buffer-getlast
Use the first item in the queue since it is the most recent.
2016-07-06 23:45:46 -07:00
Logan Smyth
11d49db23b Use the first item in the queue since it is the most recent. 2016-07-06 23:30:45 -07:00
Logan Smyth
f1a71093f9 Merge pull request #3566 from jridgewell/patch-1
Remove unused Position#unshift
2016-07-06 19:13:53 -07:00
Justin Ridgewell
9cdb24157e Remove unused Position#unshift
Not only is it unused, it'll break things if you push a newline since it doesn't set a new `#column` value.
2016-07-06 21:58:02 -04:00