Nicolò Ribaudo
ff287ac5a5
Fix %== parsing in hack pipes ( #13536 )
...
* Fix `%==` parsing in hack pipes
* Use custom token type
* Update packages/babel-parser/src/parser/expression.js
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
* Apply suggestions from code review
Co-authored-by: J. S. Choi <jschoi@jschoi.org>
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: J. S. Choi <jschoi@jschoi.org>
2021-08-03 23:30:16 +02:00
J. S. Choi
35e4e1f067
Hack-pipe proposal with % topic token ( #13416 )
...
Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>
2021-08-03 23:30:16 +02:00
J. S. Choi
cd4b3fbffe
parser: Fix Hack/smart-pipe error positions ( #13426 )
2021-08-03 23:30:16 +02:00
J. S. Choi
6276853eb9
Add support for the "Hack" pipeline proposal ( #13191 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-08-03 23:30:16 +02:00
Nicolò Ribaudo
885e1e02f5
Expose @babel/eslint-parser/experimental-worker ( #13398 )
...
* Expose `@babel/eslint-parser/experimental-worker`
* Fix `@babel/runtime` build on Windows
2021-08-03 23:23:32 +02:00
Samuel Gaus
830b99dc83
Add support for rhino as a compilation target ( #13448 )
...
* Add support for rhino as a compilation target
* Add tests for target: rhino
* Fix test failing due to whitespace
* Keep consistent names for rhino tests in babel 7 and 8
* Bump core-js-compat to 3.15.0
* Change references to rhino to include patch version
* Update compat table data import
* Split transpilation of arrow function features more finely
* Rename rhino fixtures to include the patch number and update to include syntax that is and isn't supported for better testing
* Only use the relevant features for transform-new-target and transform-classes
2021-08-03 23:03:16 +02:00
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
Tony Gorez
5f4b58f678
chore(doc): add jest specific pckg command ( #13607 )
...
* chore(doc): add jest specific pckg command
* chore(doc): add debug and grep
* fix(doc): nitpicks
* chore(doc): 🎨 reshape a bit
* fix(doc): 🔍 fix nitpicks 2
* fix(doc): useless tabs
* chore(doc): simplify few lines
* chore(doc): nit picks
2021-08-03 10:25:14 -04:00
王清雨
1960f23c22
Add typings to create-class-features-plugin helper ( #13570 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-08-02 21:22:37 +02:00
Oleksandr T
b3ab4769d0
fix(ts): raise error for export default interface {} ( #13622 )
2021-08-02 18:16:01 +02:00
Babel Bot
86fae72e5b
Add v7.14.9 to CHANGELOG.md [skip ci]
2021-08-01 07:53:51 +00:00
Babel Bot
aa2cac5edc
v7.14.9
2021-08-01 07:42:57 +00:00
Nicolò Ribaudo
93bade2a71
Update core-js@3 packages ( #13621 )
...
* Update `core-js@3` packages
* Update fixtures
* Update Babel 8 fixtures
2021-08-01 09:22:09 +02: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
Babel Bot
2340b87094
Update test262 ( #13619 )
2021-07-30 09:38:34 +02:00
Nicolò Ribaudo
862d9f8dfd
Update Rollup to ~2.54.0 ( #13614 )
2021-07-29 10:01:06 -04:00
Nicolò Ribaudo
82350d529b
[eslint, babel 8] Pass cwd to worker ( #13526 )
2021-07-28 23:12:19 +02:00
王清雨
d45ad500e7
Improve path.get typings with TS template literal types ( #13588 )
2021-07-28 21:47:29 +02:00
Henry Zhu
0a4b1b339c
Update README.md (github sponsors link) ( #13610 )
2021-07-28 19:03:46 +02:00
Huáng Jùnliàng
e4de256cdd
chore: reorganize benchmarks ( #13606 )
2021-07-28 07:10:29 -04:00
Anna Henningsen
d1f908924c
Fix completion record for variable declarations ( #13596 )
2021-07-27 23:50:47 +02:00
王清雨
e0dc925bbe
feat(traverse): specific return type for virtual types' validators ( #13578 )
...
* feat(traverse): specific return type for virtual types' validators
update generator script to use virtualType.types[0] as it's type
fix #13576
* fix: remove unused ts-expect-error
so glad that it works
* feat: use VirtualTypeAliases to generate validators for virtual types
* fix: return boolean when it doesn't have any alias
* fix: use type only import and simplify condition
2021-07-27 10:02:09 -04:00
Nicolò Ribaudo
790c5180d4
Extract computed keys from the class closure ( #13600 )
2021-07-26 23:31:45 +02:00
Rin Tepis
224a35c5c6
Don't insert __self: this within constructors of derived classes ( #13552 )
...
* Don't insert `__self: this` prior to `super()` calls (#13550 )
`__self: this` is inserted for debugging purposes. However, it will cause a runtime error if it is inserted prior to a `super()` call in a constructor. This commit will prevent `__self: this` from inserted when there is a following `super()` call.
* Prevent adding `__self` within a constructor that has `super()` altogether.
* Fix 2 typos in the comments.
* Add an additional test case for constructors that do not have a `super()` call.
* Detect `super()` call by testing whether the class has a superclass.
* Update method name and corresponding comments
* Add an additional test for the case where the derived class do not have a `super()` call.
* Apply the same changes to babel-plugin-transform-react-jsx
2021-07-26 13:32: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
Andy Edwards
1d48bb0d8c
add 12 missing NODE_FIELDS ( #13577 )
...
* test: add fields test
* fix(babel-types): add missing NODE_FIELDS and tests
fix #13558
fix #13563
* chore: avoid using fs-extra
* chore: code cleanup
* chore: avoid util.promisify
* fix: remove bad ts-expect-error suppressions
2021-07-23 09:36:08 -04:00
Babel Bot
844baebd26
chore: update test262 to 6e2a29417ad52ba114c26838a288510d704efa1b ( #13595 )
2021-07-23 08:54:49 +02:00
Huáng Jùnliàng
03e8476b27
Generator performance ( #13593 )
...
* bench: setup benchmarks
* add charcodes
* perf: use string as buffer backend
baseline 256 empty statements: 3_718 ops/sec ±18.65% (0.269ms)
baseline 512 empty statements: 2_070 ops/sec ±0.96% (0.483ms)
baseline 1024 empty statements: 1_012 ops/sec ±1.76% (0.988ms)
baseline 2048 empty statements: 510 ops/sec ±1.53% (1.96ms)
current 256 empty statements: 3_965 ops/sec ±21.14% (0.252ms)
current 512 empty statements: 2_219 ops/sec ±1.29% (0.451ms)
current 1024 empty statements: 1_089 ops/sec ±1.53% (0.918ms)
current 2048 empty statements: 548 ops/sec ±1.87% (1.824ms)
* perf: add endsWithCharAndNewline
baseline 256 1-length identifiers: 1_947 ops/sec ±25.11% (0.514ms)
baseline 512 1-length identifiers: 1_115 ops/sec ±0.89% (0.897ms)
baseline 1024 1-length identifiers: 537 ops/sec ±1.71% (1.862ms)
baseline 2048 1-length identifiers: 273 ops/sec ±0.57% (3.669ms)
current 256 1-length identifiers: 2_178 ops/sec ±27.17% (0.459ms)
current 512 1-length identifiers: 1_250 ops/sec ±1.19% (0.8ms)
current 1024 1-length identifiers: 622 ops/sec ±0.71% (1.608ms)
current 2048 1-length identifiers: 308 ops/sec ±1.35% (3.251ms)
* perf: avoid one byte string compare
* perf: avoid scaning word for /
* perf: hoist babel type methods
baseline 256 25-length identifiers: 1_869 ops/sec ±29.4% (0.535ms)
baseline 512 25-length identifiers: 1_092 ops/sec ±1.62% (0.916ms)
baseline 1024 25-length identifiers: 537 ops/sec ±1.29% (1.862ms)
baseline 2048 25-length identifiers: 264 ops/sec ±2% (3.793ms)
current 256 25-length identifiers: 2_462 ops/sec ±23.38% (0.406ms)
current 512 25-length identifiers: 1_401 ops/sec ±0.73% (0.714ms)
current 1024 25-length identifiers: 671 ops/sec ±1.55% (1.491ms)
current 2048 25-length identifiers: 332 ops/sec ±1.44% (3.014ms)
* perf: hoist parens methods
baseline 256 1-length identifiers: 2_678 ops/sec ±24.96% (0.373ms)
baseline 512 1-length identifiers: 1_472 ops/sec ±2.33% (0.68ms)
baseline 1024 1-length identifiers: 737 ops/sec ±1.74% (1.357ms)
baseline 2048 1-length identifiers: 371 ops/sec ±0.79% (2.695ms)
current 256 1-length identifiers: 2_633 ops/sec ±32.44% (0.38ms)
current 512 1-length identifiers: 1_676 ops/sec ±1.49% (0.597ms)
current 1024 1-length identifiers: 803 ops/sec ±1.95% (1.246ms)
current 2048 1-length identifiers: 385 ops/sec ±2.22% (2.596ms)
* cleanup unused benchcase
* Update packages/babel-generator/src/buffer.ts
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* cleanup benchmarks
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-07-22 23:01:48 -04:00
Nicolò Ribaudo
2b6acada3c
Fix _step.value access in for await ( #13491 )
2021-07-21 19:12:18 +02:00
Andy Edwards
b67ea12c4d
[build docs] Update required node versions to ^12.20 || >=14.13 ( #13580 )
2021-07-20 23:14:14 +02:00
Babel Bot
86a99b662b
Add v7.14.8 to CHANGELOG.md [skip ci]
2021-07-20 18:03:23 +00: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
fa439d6a73
test: patch verifyPackageTree for test purposes ( #13567 )
2021-07-19 23:26:52 +02:00
王清雨
aa18da08cd
fix(class-properties): replace new.target in static properties with undefined ( #13560 )
...
* fix(class-properties): replace `new.target` in static properties with `undefined`
non-static prop is not affected
fix #12737
* Update packages/babel-helper-create-class-features-plugin/src/fields.ts
fix typo
Co-authored-by: Brian Ng <bng412@gmail.com>
* fix: add loose test case and fix replace condition
* test: add new.target tests for static block
* feat: move new-target replace into thisContextVisitor
defaults to replace new.target, do not replace within function
* feat: simplify thisContextVisitor
remove function visitor since environmentVisitor is skipping arrow function
* test: remove unused fixme comments
Co-authored-by: Brian Ng <bng412@gmail.com>
2021-07-16 15:58:55 -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
Babel Bot
1c7da020e4
Update test262 ( #13561 )
2021-07-16 09:10:11 -05:00
Sosuke Suzuki
47d79ac975
Fix make generate-standalone -> make build-standalone ( #13562 )
2021-07-16 09:42:59 +02:00
Babel Bot
bfcf783834
Update test262 ( #13544 )
2021-07-10 17:49:41 +02:00
Huáng Jùnliàng
574f907e61
chore: bump test262-stream ( #13543 )
2021-07-09 22:34:58 -04:00
Mickey Rose
f639eee2f5
Dedupe code when calling buildOptimizedSequenceExpression ( #13535 )
2021-07-09 15:37:41 +02:00
Huáng Jùnliàng
234316161f
fix: use BABEL_8_BREAKING for new babel-types breaking changes ( #13538 )
2021-07-09 09:27:59 -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
Nitin Kumar
bc1b9537b0
Fix arrow transformation when arguments is defined as variable ( #12344 )
...
* fix: arrow-fn transformation when 'arguments' is defined as var
* fix: tests
* refactor: code
* Review by @nicolo-ribaudo
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-07-06 13:59:24 -04:00
Colin Wang
a5a63e3033
fix: accept duplicated import/variable in different module ( #13527 )
...
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2021-07-06 19:18:12 +02:00
Colin Wang
fce35af691
fix(babel-types): accept UnaryExpression in TSLiteralType ( #13525 )
...
* fix(babel-types): add validator for TSLiteralType to accept UnaryExpression
seems that the generated files is missing typings
fix #13327
* fix(babel-types): add allowlist for TSLiteralType
now generated types seems correct
* fix(babel-types): use oneOfNodeTypes instead of oneOf
2021-07-03 00:34:26 +02:00