Nicolò Ribaudo
a254ea38a4
Enable ergonomic brand checks (#priv in) by default ( #13554 )
...
* Enable ergonomic brand checks by default in `@babel/parser`
* Enable ergonomic brand checks by default in `preset-env`
* Fix error position
* Update Babel 8 tests
2021-08-03 23:02:17 +02:00
Oleksandr T
b3ab4769d0
fix(ts): raise error for export default interface {} ( #13622 )
2021-08-02 18:16:01 +02:00
Babel Bot
aa2cac5edc
v7.14.9
2021-08-01 07:42:57 +00:00
Huáng Jùnliàng
d3a7cd5e8d
Replace generic __clone call by specific methods ( #13611 )
...
* update benchmark babel parser version
* perf: replace generic __clone by specific methods
baseline 256 length-1 named export: 4_704 ops/sec ±1.59% (0.213ms)
baseline 512 length-1 named export: 2_426 ops/sec ±0.52% (0.412ms)
baseline 1024 length-1 named export: 1_118 ops/sec ±1.23% (0.895ms)
baseline 2048 length-1 named export: 556 ops/sec ±0.77% (1.799ms)
current 256 length-1 named export: 7_073 ops/sec ±33.67% (0.141ms)
current 512 length-1 named export: 4_441 ops/sec ±0.79% (0.225ms)
current 1024 length-1 named export: 2_142 ops/sec ±1.09% (0.467ms)
current 2048 length-1 named export: 943 ops/sec ±2.12% (1.06ms)
* breaking: remove Node#__clone in Babel 8
* test: use t.cloneNode
2021-07-30 22:19:35 +02:00
Huáng Jùnliàng
e4de256cdd
chore: reorganize benchmarks ( #13606 )
2021-07-28 07:10:29 -04:00
Nicolò Ribaudo
4a56387330
ts: Check if param is assignable when parsing arrow return type ( #13581 )
2021-07-26 17:58:10 +02:00
Babel Bot
e591780244
v7.14.8
2021-07-20 17:51:55 +00:00
Sosuke Suzuki
22b2f4fc02
Update babel-parser.d.ts ( #13575 )
...
* Add moduleBlocks to ParserPlugin type
* Add TypeScriptPluginOptions to ParserPluginWithOptions
2021-07-20 10:44:13 -04:00
overlookmotel
dd942f92af
fix: parser strictMode option ( #13548 )
2021-07-20 10:42:04 -04:00
Nicholas Eveland
2c6db56696
Allow module block to start a member expression ( #13573 )
...
* Accept module in primaryExpression
* Add module blocks to primaryExpression
* Fix package.json
* Fix yarn.lock
* Fix yarn.lock
* Remove package.tgz file
2021-07-19 17:29:23 -04:00
Huáng Jùnliàng
6e57617138
Fix await binding error within static block ( #13088 )
...
* fix: allow await within SCOPE_FUNCTION under static block
* perf: scan scopeStack for once
* add new test case
* chore: update allowlist
2021-07-16 10:35:19 -04:00
Huáng Jùnliàng
79d3276f61
Overhaul comment attachment ( #13521 )
...
* refactor: inline pushComment
* chore: add benchmark cases
* perf: overhaul comment attachment
* cleanup
* update test fixtures
They are all bugfixes.
* fix: merge HTMLComment parsing to skipSpace
* perf: remove unattachedCommentStack
baseline 128 nested leading comments: 11_034 ops/sec ±50.64% (0.091ms)
baseline 256 nested leading comments: 6_037 ops/sec ±11.46% (0.166ms)
baseline 512 nested leading comments: 3_077 ops/sec ±2.31% (0.325ms)
baseline 1024 nested leading comments: 1_374 ops/sec ±3.22% (0.728ms)
current 128 nested leading comments: 11_027 ops/sec ±37.41% (0.091ms)
current 256 nested leading comments: 6_736 ops/sec ±1.39% (0.148ms)
current 512 nested leading comments: 3_306 ops/sec ±0.69% (0.302ms)
current 1024 nested leading comments: 1_579 ops/sec ±2.09% (0.633ms)
baseline 128 nested trailing comments: 10_073 ops/sec ±42.95% (0.099ms)
baseline 256 nested trailing comments: 6_294 ops/sec ±2.19% (0.159ms)
baseline 512 nested trailing comments: 3_041 ops/sec ±0.8% (0.329ms)
baseline 1024 nested trailing comments: 1_530 ops/sec ±1.18% (0.654ms)
current 128 nested trailing comments: 11_461 ops/sec ±44.89% (0.087ms)
current 256 nested trailing comments: 7_212 ops/sec ±1.6% (0.139ms)
current 512 nested trailing comments: 3_403 ops/sec ±1% (0.294ms)
current 1024 nested trailing comments: 1_539 ops/sec ±1.49% (0.65ms)
* fix: do not expose CommentWhitespace type
* add comments on CommentWhitespace
* add test case for #11576
* fix: mark containerNode be the innermost node containing commentWS
* fix: adjust trailing comma comments for Record/Tuple/OptionalCall
* fix: drain comment stacks in parseExpression
* docs: update comments
* add a new benchmark
* chore: containerNode => containingNode
* add more benchmark cases
* fix: avoid finishNodeAt in stmtToDirective
* finalize comment right after containerNode is set
* add testcase about directive
* fix: finish SequenceExpression at current pos and adjust later
* chore: rename test cases
* add new test case on switch statement
* fix: adjust comments after trailing comma of function params
* add comment attachment design doc
* misc fix
* fix: reset previous trailing comments when parsing async method/accessor
* chore: add more comment testcases
* fix flow errors
* fix: handle comments when parsing async arrow
* fix: handle comments when "static" is a class modifier
* fix flow errors
* fix: handle comments when parsing async function/do
* refactor: simplify resetPreviousNodeTrailingComments
* update test fixtures
2021-07-07 11:51:40 -04:00
Huáng Jùnliàng
8a3e0fd960
Async do expression should start at async ( #13534 )
2021-07-07 00:09:34 -04:00
Huáng Jùnliàng
bfd2f8f4b1
fix: disallow computed async/get/set keyword ( #13531 )
2021-07-07 00:25:57 +02:00
Federico Ciardi
9bad558d13
[babel 8] Use an identifier for TSTypeParameter.name ( #12829 )
2021-07-02 10:44:49 +02:00
lightmare
e6068cd9a5
enhance benchmark output with thousands separators ( #13512 )
2021-06-28 11:57:15 +02:00
Tony Gorez
b0fe6bdbc3
chore(parser): add test to handle optional paramteter in async call ( #13504 )
...
* chore(parser): add test to handle optional paramteter in async call
* chore(parser): add flow test
* chore(parser): add ts test
2021-06-23 11:11:06 -04:00
Babel Bot
268e4ca0de
v7.14.7
2021-06-21 21:44:55 +00:00
Huáng Jùnliàng
5145c98a73
Simplify token context ( #13450 )
...
* refactor: unify tc.brace and tc.templateQuasi
* refactor: remove unused context check
* perf: reduce arrayPrototype call and hoist variables
2021-06-21 10:51:00 -04:00
Tony Gorez
101249f3aa
refactor(parser): remove refNeedsArrowPos ( #13419 )
...
* fix(parser:expression): remove refNeedsArrowPos in parseExprListItem
* feat: use refExpressionErrors to catch optional parameters
* feat: delete useless refNeedArrowPos
* fix: forgotten deletion
* fix: lint and factorize
* fix: delete useless comment
* fix: review corrections
* fix: review corrections pt2
* fix: review correction pt2
* fix: nit correction
* fix: update types
* Update packages/babel-parser/src/parser/util.js
* fix: add invariant comment in flow and ts file
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-06-19 10:40:52 +02:00
Babel Bot
1774e2aaef
v7.14.6
2021-06-14 21:45:36 +00:00
Huáng Jùnliàng
6c8b2336f6
Faster readRegexp ( #13453 )
2021-06-10 19:00:21 -04:00
Sosuke Suzuki
0eb2853732
[ts] Support override modifiers for parameter properties ( #13428 )
2021-06-10 22:29:38 +02:00
Huáng Jùnliàng
b1fe831e4a
fix: disallow JSX tag after non-null assertion ( #13449 )
2021-06-10 15:07:47 -04:00
Babel Bot
7a2a928398
v7.14.5
2021-06-09 23:03:30 +00:00
Huáng Jùnliàng
d3f4c22c28
update test fixtures ( #13440 )
...
* update test fixtures
* chore: typo
2021-06-09 11:48:29 -04:00
Huáng Jùnliàng
b9c1884a58
Reduce exprAllowed usage ( #13431 )
2021-06-09 16:36:09 +02:00
Federico Ciardi
a64d08c101
fix(parser): correctly parse record and tuple tokens ( #13418 )
...
* fix(parser): correctly parse token location for `#{` and `#[`
* fix: `bar` tokens
* fix: don't parse record and tuple pipe closing tokens as operators
2021-06-08 20:58:48 -04:00
Eyoatam Tamirat
56db172b0e
fix(@babel/parser): fix tokenizer context update code ( #13422 )
...
* fix(`@babel/parser`): fix `_function` update code
* fmt
2021-06-08 08:26:50 -04:00
Tony Gorez
a0369fdbfa
fix: throw when async() call param is object with assignement ( #13410 )
2021-06-03 16:12:15 +02:00
Huáng Jùnliàng
b8175ec060
Relax import assertion key-is-type constraint ( #13409 )
2021-06-02 07:51:56 -04:00
Huáng Jùnliàng
b281fe352c
Use set in parser scope ( #13408 )
...
* chore: rename benchmark
* perf: back parser scope names storage by set
* chore: add benchmark
2021-06-01 10:35:19 -04:00
Huáng Jùnliàng
cbad50ac1d
Faster checkReservedWord ( #13386 )
...
* perf: faster parser scope check
* perf: early return for identifier length > 10
* perf: early return for normal identifier names
* chore: add benchmark
* Update packages/babel-parser/src/parser/expression.js
2021-06-01 08:42:23 -04:00
Huáng Jùnliàng
ae3f5d905a
Back parser state exportedIdentifiers by set ( #13406 )
2021-06-01 07:17:30 -04:00
Kristoffer K
140ec5aa5c
chore: setup Yarn constraints ( #13363 )
2021-05-31 18:46:03 +02:00
Yosuke Ota
0b29b5c2c0
Add support for d flag of regex literals in parser ( #13396 )
2021-05-31 08:34:53 -04:00
Babel Bot
219fd3ab1f
v7.14.4
2021-05-28 16:50:09 +00:00
Nicolò Ribaudo
1341e560ff
Skip flow/typecasts/3 test on Node.js 6 ( #13382 )
2021-05-27 09:20:45 -05:00
Huáng Jùnliàng
079f8cd5bc
fix: disallow surrogate in the end of contextual name ( #13377 )
2021-05-26 22:57:59 -04:00
Huáng Jùnliàng
acf2a10899
Faster tokenizer lookahead ( #13341 )
...
* refactor: simplify token context structure
* add benchmark
* perf: return a sub-state on tokenizer lookahead
* Update packages/babel-parser/src/tokenizer/index.js
Co-authored-by: Brian Ng <bng412@gmail.com>
* Update packages/babel-parser/src/tokenizer/index.js
Co-authored-by: Brian Ng <bng412@gmail.com>
* remove irrelevant comment
* fix: guard curPosition with isLookahead
* add test cases
Co-authored-by: Brian Ng <bng412@gmail.com>
2021-05-25 21:12:38 -04:00
Sosuke Suzuki
d6a5f6190d
[ts] Default typeAnnotation of TSTypePredicate to null ( #13354 )
2021-05-23 20:12:42 +02:00
Huáng Jùnliàng
461ba2531a
refactor: add parse*Literal parser routines ( #13333 )
...
* refactor: simplify parseLiteral interface
* refactor: extract specific methods on parsing literals
* fix: avoid StringLiteral type comparison
* add test cases
* fix: remove redundant node
* Update packages/babel-parser/src/plugins/flow/index.js
Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>
* update test fixtures
* fix: refine parseLiteral typings
Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>
2021-05-19 16:00:24 -04:00
Huáng Jùnliàng
2a5b23186a
perf: minimize identifier lookahead when parsing let ( #13328 )
2021-05-18 08:19:58 -04:00
Babel Bot
1487a46dd5
v7.14.3
2021-05-17 20:26:25 +00:00
Huáng Jùnliàng
0d0950f341
fix: preserve tokensLength in tryParse ( #13326 )
...
* fix: preserve tokensLength in tryParse
* Apply suggestions from code review
Co-authored-by: Brian Ng <bng412@gmail.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
2021-05-17 15:32:12 -04:00
Nicolò Ribaudo
c2181343f1
Parse let declarations whose id starts with \ ( #13325 )
2021-05-17 08:46:59 -05:00
Huáng Jùnliàng
b3d35cd412
[Babel 8]: remove module attributes parser/generator support ( #13308 )
...
* breaking: remove support of moduleAttributes
* Update packages/babel-parser/src/plugin-utils.js
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* chore: remove todo comments
* make prettier happy
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-05-14 09:55:40 -04:00
Babel Bot
7512095c84
v7.14.2
2021-05-12 16:58:57 +00:00
Sosuke Suzuki
b2d9156cc6
Update to Prettier 2.3 ( #13288 )
2021-05-10 15:34:13 +02:00
Sosuke Suzuki
1d54419ec4
Parse attributes of import expression with estree plugin ( #13284 )
...
* Parse attributes of import expression with estree plugin
* Add tests
* Update packages/babel-parser/src/types.js
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2021-05-07 16:37:20 -04:00