Daniel Tschinder
4e5e319d5b
perf: remove double check for keywords in readWord
...
Instead of calling isKeyword we simple check directly if the keyword token is available
2019-01-17 16:16:31 -08:00
Daniel Tschinder
b66d921053
perf: Use === or Set.has instead of array.indexOf for keyword checks
2019-01-17 16:16:30 -08:00
Daniel Tschinder
f12905b531
perf: Use for loops while cloning classes
2019-01-17 16:16:29 -08:00
Daniel Tschinder
f216975378
perf: call isLineTerminator as last check
2019-01-17 16:16:28 -08:00
Daniel Tschinder
3a3d5cbe9c
perf: Check for plugin only once before looping
2019-01-17 16:16:28 -08:00
Daniel Tschinder
10555c719e
Build the parser also for node 6.9 and up
2019-01-17 16:16:27 -08:00
Daniel Tschinder
58768072ef
perf: Ensure canInsertSemicolon is always called last
...
It does a lot of checks and a regex test
2019-01-17 16:16:26 -08:00
Daniel Tschinder
455e003567
perf: Optimize regex
...
This saves some steps, as the regex parser does not have to backtrack for character classes, but is has to for alternates
2019-01-17 16:15:07 -08:00
Daniel Tschinder
49f7bcf271
perf: Remove unnecessary check for flow plugin inside of flow plugin
2019-01-17 16:15:07 -08:00
Daniel Tschinder
c2e41588aa
perf: run flow code in flow plugin
2019-01-17 16:15:05 -08:00
Daniel Tschinder
a1eac37bd2
Generate prettier comments
2019-01-17 16:15:04 -08:00
Daniel Tschinder
0370af58f1
perf: Use strict equals
2019-01-17 16:15:03 -08:00
Daniel Tschinder
8df0500f55
perf: Simplify reading of tokens.
...
This avoids checking isIdentifierStart for every single token
2019-01-17 16:15:01 -08:00
Daniel Tschinder
e4b8cfc768
perf: use Set instead of string indexOf
2019-01-17 16:15:00 -08:00
Daniel Tschinder
a7757ec4d0
perf: Use increment operator
2019-01-17 16:14:58 -08:00
Daniel Tschinder
25a8db2a29
perf: use normal equality check in stead of indexOf
2019-01-17 16:14:57 -08:00
Daniel Tschinder
48fd387779
perf: precalculate length
2019-01-17 16:14:56 -08:00
Daniel Tschinder
59c4bbb4ab
perf: Make plugins a map instead of object
...
Fix plugin options
2019-01-17 16:14:55 -08:00
Daniel Tschinder
2dc1c91955
perf: Move input to state and precalculate length
...
This also fixes a bug with async functions
2019-01-17 16:14:54 -08:00
Daniel Tschinder
ae154c86ed
perf: Minor optimizations
2019-01-17 16:14:53 -08:00
unconfident
e9588061d7
Copy "optional" property when cloning Identifier node ( #9333 )
...
Fixes #9331
2019-01-17 17:12:16 -05:00
Nicolò Ribaudo
0a88230ec4
Disallow async functions as loop bodies ( #9314 )
2019-01-17 17:07:48 -05:00
Nicolò Ribaudo
a27b9b4299
Add @babel/plugin-transform-named-capturing-groups-regex ( #7105 )
...
When the `runtime` flag is on (by default), this plugin adds a new helper which wraps the native `RegExp` class to provide groups support. People nees to use a polyfill (I implemented it in core-js) for browsers that don't support ES6 regexps.
2019-01-15 18:21:17 +01:00
Brian Ng
aaec2cd51d
Fix handling newline with TypeScript declare and abstract classes ( #9328 )
2019-01-15 06:56:52 -06:00
Brian Ng
34c9890f41
Fix range on TypeScript index signature parameters ( #9335 )
2019-01-15 06:52:33 -06:00
Armano
e8038863c3
Fix range on TypeScript this type predicate ( #9339 )
2019-01-15 10:35:49 +01:00
Nicolò Ribaudo
694e3fd8cf
Merge declaration and init of props in parser's state ( #9312 )
...
* Merge declaration and init of props in parser's state
* Move type def
2019-01-13 23:54:44 +01:00
Brian Ng
40ae6568a4
Add support for proposal-json-strings in preset-env ( #9323 )
2019-01-13 08:32:33 -06:00
Henry Zhu
4944e9e180
update sponsor link again [skip ci]
2019-01-13 08:00:46 -05:00
Nicolò Ribaudo
a24206eb96
Fix error for decorators not enabled ( #9321 )
...
* Fix error for decorators not enabled
* Update error message
2019-01-13 00:35:22 +01:00
Henry Zhu
d6b4ab75ee
fix sponsor link [skip ci]
2019-01-12 10:41:49 -05:00
Nicolò Ribaudo
3e4b608a80
Parse class heritage as strict mode code ( #9315 )
2019-01-12 14:54:23 +01:00
Henry Zhu
28319eb07e
add sponsor [skip ci]
2019-01-11 13:50:48 -05:00
Nicolò Ribaudo
5889620a6a
Disallow new import(x) and import(x,) ( #9313 )
...
* Disallow "new import(...)"
* Disallow trailing comma inside dynamic import
* Rename test
* Update error message
2019-01-11 18:59:51 +01:00
Nicolò Ribaudo
9764718c32
Disallow trailing comma after rest ( #9311 )
...
* Add new tests
* Use state instead of param and disallow comma in [...a,]=[]
* Unify error messages
* Object destructuring
* Update whitelist
2019-01-11 13:08:38 +01:00
Nicolò Ribaudo
28b70e5910
Generate types for TSImportType
2019-01-11 11:46:15 +01:00
Henry Zhu
4c2f8d9337
@babel/generator: Add emit and builder for TSImportType ( #9309 )
2019-01-10 13:57:00 -05:00
Armano
2cc0376756
@babel/parser(ts): Add parsing of type import ( #9302 )
2019-01-10 11:14:48 -05:00
Nicolò Ribaudo
8e051cae46
[decorators] Set method names at compile time instead of at runtime ( #9244 )
2019-01-10 00:45:02 +01:00
Cameron Martin
778a61a3c2
[@babel/types] Moved generators related to babel-types into the babel-types package directory. ( #9245 )
2019-01-09 00:14:31 +01:00
Armano
46e3f6df1f
@babel/parser: include leading character into range of generic ArrowFunctionExpression ( #9295 )
2019-01-08 07:19:55 -06:00
Brian Ng
03022d169e
Throw error if TypeScript class has empty implements ( #9292 )
2019-01-07 15:27:27 -06:00
David Laban
9803253363
flow type update: babel-types.isType(?string, string): boolean ( #9275 )
2019-01-07 08:53:01 -06:00
Brian Ng
a55382e4ad
Test262 update ( #9288 )
2019-01-07 08:52:36 -06:00
Sven Sauleau
b211b810d1
Use 2014-present in license ( #9290 )
2019-01-07 08:52:11 -06:00
James George
25e880d355
Add follow on twitter badge ( #9264 ) [skip ci]
2019-01-07 09:49:20 -05:00
Daniel Tschinder
e43777bb5f
Fix location for typescript type assertions in AST ( #9284 )
2019-01-06 16:39:14 -08:00
Nicolò Ribaudo
efc60a1703
Add test sources to prettierignore ( #9287 ) [skip ci]
2019-01-06 20:59:02 +01:00
Daniel Tschinder
54f072991d
Revert "Revert babel-helper-builder-react-jsx change from #4988 " ( #9119 )
...
This reverts commit dbc07220ae9188a3fb2bdea3d826ff7f48532a2e.
# Conflicts:
# packages/babel-helper-builder-react-jsx/src/index.js
2019-01-05 22:22:49 -08:00
Brian Ng
a58893d1e3
Ensure modifiers are included in TSParameterProperty ranges ( #9276 )
2019-01-04 10:02:09 -06:00