13667 Commits

Author SHA1 Message Date
Justin Ridgewell
9b48a8ead7
Fix nested classes reference private fields (#11405)
* Fix nested classes reference private fields

* Process only visible private fields when redeclaring

* Comments

* Skip class traversal if there are no private fields

* Handle redeclared private field in computed key
2020-04-14 21:51:51 +02:00
Henry Zhu
aaced0156d
contributing.md updates [skip ci] (#11403)
* contributing.md updates [skip ci]

* [skip ci]

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

Co-Authored-By: Brian Ng <bng412@gmail.com>

* Use Yarn > 1

Co-authored-by: Brian Ng <bng412@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-04-14 15:27:15 +02:00
Huáng Jùnliàng
a466f9c310
fix: report missing plugins on type exports (#11417)
* fix: report missing plugins on type exports

* nit refactors

* Update packages/babel-parser/src/parser/statement.js [skip ci]
2020-04-14 15:23:54 +02:00
Justin Ridgewell
070ec201bb
Speed up the createSuper helper (#11401) 2020-04-10 16:00:20 +02:00
Huáng Jùnliàng
88b12e3dd1
fix: add classPrivateProperties and classPrivateMethods to missing plugin helper (#11397)
* fix: add classPrivateProperties and classPrivateMethods to missing plugin helper

* make flow happy
2020-04-09 19:41:14 -04:00
Nicolò Ribaudo
cab1e79ba7
Update browserslist (#11398) 2020-04-09 22:51:28 +02:00
Huáng Jùnliàng
eb6d5c6a80
chore: update stage preset in babel-standalone (#11395) 2020-04-09 20:55:29 +02:00
Huáng Jùnliàng
8b976b0670
fix: do not push new token context when function is following dot/questionDot (#11388)
* fix: do not push new token context when function is following dot/questionDot

* more cautiously poping context
2020-04-08 10:10:36 -04:00
johannes
fbcb251d61
fix: replace backslashes with forward slashes from resolved pa… (#11366)
* fix: replace backslashes with forward slashes from resolved path for windows environments

* add test for resolveAbsoluteRuntime under windows
2020-04-08 15:36:55 +02:00
Nicolò Ribaudo
ce6cc4eb55
Unify parens printing for postfix-like expressions (#11382)
* Unify parens printing for postfix exprs: (), [...], !

* Also move template tags handling

* Add tagged template test

* isPostfixExpression -> hasPostfixPart
2020-04-07 21:36:35 +02:00
Babel Bot
b04ddff853 Add v7.9.5 to CHANGELOG.md [skip ci] 2020-04-07 19:27:45 +00:00
Nicolò Ribaudo
5b97e77e03 v7.9.5 2020-04-07 21:15:23 +02:00
Vedant Roy
aea0fcd599
Correctly transpile when cross-param refs with obj rest (#11326)
* Transform initializers with ids in rest elements

Fix issue 11281. Transform parameters with default initializers that
have ids that are also in a parameter with a rest element.
Before, these parameters were not transformed.

* Add plugin-transform-parameters as dependency

* Remove outdated comment

* Use set instead of array for paramsWithRestElement

* Skip when encounter "Scope"

Previously, f({...R}, f = R => R) would be incorrectly transformed.

* Pass in loose mode option instead of false

* Address review and re-organize tests

Checking the RHS of an assignment pattern/checking the parent of
an identifier node fails on cases like "({...R}, a = f(R))" or
"({...R}, {[R.key]: a = 42})".

Also refactor tests by removing unecessary tests and
separating "should transform" from "should not transform" tests.
2020-04-07 21:06:43 +02:00
Mateusz Burzyński
70cc111b35
Fixed generateUid creating clashing ids after scope re-crawling (#11375) 2020-04-07 17:32:46 +02:00
Zen
ca096c56aa
fix Incorrect destructuring compilation of `for (let [[x] = [1… (#11360) 2020-04-07 10:10:21 -05:00
Nicolò Ribaudo
e3ad798a24
Remove unnecessary test file (#11383)
bigInts are enabled by default
2020-04-05 22:18:59 -04:00
Nicolò Ribaudo
65d09e46a0
Don't check type annotations when deciding params scope (#11349)
* Don't check type annotations when deciding params scope

* Also type params
2020-04-05 23:43:20 +02:00
Mateusz Burzyński
aeebc08234
Simplify scope.hasReferences implementation (#11368) 2020-04-04 00:44:44 +02:00
Brian Ng
051fc0a791
Bump handlebars dep (#11374) 2020-04-03 21:41:48 +02:00
Jovica Markoski
40db926170
Fixed useBuiltIns and modules validation when using 'false' as option (#11373)
* Fixed useBuiltIns and modules validation when using 'false' as option

* Added tests for 'validateUseBuiltInsOptions' and for 'validateModulesOption' when input is 'false'

Co-authored-by: Jovica Markoski <jovica@upshiftwork.com>
2020-04-03 15:41:32 -04:00
Nicolò Ribaudo
2c31587aa1
Fix createSuper in Babel <7.5.5 (#11341)
* Fix createSuper in Babel <7.5.5

In Babel <7.5.5, addHelper only throws when called for the first time.
This was fixed by babel/babel#10208, but since we are already adding
a workaround for <7.9.0, we may as well fix <7.5.5

* Use 7.0.0 in "babel-old-version" test
2020-04-02 17:52:50 +02:00
Huáng Jùnliàng
c3042cfd27
fix: don’t add function name when operator is not = (#11361) 2020-04-02 11:12:13 -04:00
Luna Ruan
94447135c7
fix auto import error with whitespace JSXText (#11354) 2020-04-02 00:29:27 +02:00
Huáng Jùnliàng
df819a060c
fix: allow logical assignment operators in AssignmentExpression (#11359) 2020-04-01 18:09:46 -04:00
Nicolò Ribaudo
67609a1232
Don't call createSuper in loose mode (it was unused) (#11358)
* Don't call `createSuper` in loose mode (it was unused)

* Update fixtures
2020-04-01 23:08:21 +02:00
Nicolò Ribaudo
548cb3ee89
Fix e2e publish test when branching from an older version (#11347)
* Fix e2e publish test when branching from an older version

* Fix

* Fix

* Fix
2020-03-30 12:55:52 -04:00
Nicolò Ribaudo
c8a8be7221
Set correct async/generator in IIFE for params (#11346)
* Set correct async/generator in IIFE for params

* Reject in async params

* Skip async test on node 6 (it doesn't support async fns)
2020-03-29 22:01:15 +02:00
Oliver Dunk
71e7a7b1e0
Ignore abstract methods when decorating class (#11345)
* Ignore abstract methods when decorating class

* Address Nico's feedback

* Add input/output test

* Update test output to account for _nonIterableRest changes
2020-03-29 00:17:29 +01:00
Huáng Jùnliàng
6a00cbe0ab
fix: isIdentifierName should reject empty string (#11339) 2020-03-26 21:54:50 +01:00
Huáng Jùnliàng
a901bd50b1
chore: remove unused graceful-fs (#11329) 2020-03-25 09:13:44 -05:00
Huáng Jùnliàng
8e7ef30968
polish: align optional chain whitespace behavior to their sibiling (#11328) 2020-03-24 15:52:36 -04:00
Mateusz Burzyński
025e4ae44c
Fixed issue with programPath.scope.references not being regist… (#11323) 2020-03-24 16:27:32 +01:00
Babel Bot
46f31460d6 Add v7.9.4 to CHANGELOG.md [skip ci] 2020-03-24 08:32:30 +00:00
Nicolò Ribaudo
d3cf5fb5f4 v7.9.4 2020-03-24 09:26:12 +01:00
Kai Cataldo
4e6c9c52ef
fix: token after strict mode block is evaluated in strict mode (#11186) 2020-03-24 08:38:02 +01:00
Huáng Jùnliàng
146ea4176e
fix: check parenthesis between optional chain and other types (#11325) 2020-03-24 08:28:47 +01:00
Huáng Jùnliàng
dc7c5640e9
Compact parser fixture loc info (#11322)
* chore: compact loc information in parser fixtures

* chore: update test fixtures
2020-03-23 20:10:29 -04:00
Brian Ng
6a728a05a8
Restore default pragmas in preset-react for classic runtime (#11324) 2020-03-24 00:06:44 +01:00
Nicolò Ribaudo
9b976b2164
Test Babel compiled using an old version of @babel/core (#11319)
* Test Babel compiled using an old version of @babel/core

This should catch regressions where we use a new helper without a fallback
for older versions, or when we use a new @babel/traverse method.

* Enable the test
2020-03-23 22:42:40 +01:00
Nicolò Ribaudo
d23f0ae0ec
Add regression tests for regenerator (#10223)
* Add regression tests for regenerator

* Update tests
2020-03-23 20:49:59 +01:00
Vlad Rindevich
2f549886e4
[preset-typescript] Fix private members type annotations (#11315) 2020-03-23 19:33:16 +01:00
Babel Bot
296d8ce179 Add v7.9.3 to CHANGELOG.md [skip ci] 2020-03-22 11:07:26 +00:00
Nicolò Ribaudo
1ae85560a7 v7.9.3 2020-03-22 11:57:58 +01:00
Nicolò Ribaudo
ceb54dd756
Define default value for vars shadowing params (#11307)
* Define default value for vars shadowing params

* Remove from package.json

* Only convert traverse the params if needed

This prevents this plugin from running after the destructuring
transform, which causes #11256

* Review

* Review

* Update packages/babel-plugin-transform-parameters/src/params.js [skip ci]

Co-Authored-By: Brian Ng <bng412@gmail.com>

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-03-22 10:45:10 +01:00
Nicolò Ribaudo
b0315b81c7
Fix logic to insert parens in return statements with comments (#11306) 2020-03-21 20:53:38 +01:00
Huáng Jùnliàng
5b2c1f34d3
chore: fix build-babel exclude in gulpfile (#11293) 2020-03-21 19:39:22 +01:00
Vedant Roy
0e5c1da659
fix: async arrow functions should not be allowed after binary… (#11284)
* Forbid async arrow functions after binary operator.

This commit makes Babel throw an error when parsing
code like "3 + async() => 2".

* Make atPossibleAsync more accurate

* Change atPossibleAsync to atPossibleAsyncArrow

Add an extra test to atPossibleAsync and refactor it to
atPossibleAsyncArrow. This also fixes a bug in the Typescript plugin,
so a new test has been added.

* Add test for async arrow after unary operator
2020-03-21 19:38:36 +01:00
Babel Bot
a9b430b464 Add v7.9.2 to CHANGELOG.md [skip ci] 2020-03-21 14:15:41 +00:00
Nicolò Ribaudo
2399e0df23 v7.9.2 2020-03-21 14:57:31 +01:00
Nicolò Ribaudo
429dd2ce8a
Manually inline the createSuper helper on older Babel versions (#11298)
* Manually inline the createSuper helper on older Babel versions

* Forgot to commit this

* Add comments [skip ci]
2020-03-21 14:39:14 +01:00