13690 Commits

Author SHA1 Message Date
Huáng Jùnliàng
2e4f18ac92
Add some parser missing plugins errors (#11478)
* fix: do not throw invalid hash in tokenizer

* refactor: bigint has been enabled by default

* polish: add numeric separator missing plugin error

* fix: forward expectPlugin declaration
2020-04-25 10:26:39 +02:00
Jacob Dreesen
d05334bde2
Fix typo and remove outdated doc comment (#11472)
* Fix typo

* Fix outdated doc comment [skip ci]
2020-04-25 10:24:22 +02:00
Henry Zhu
e010db84aa
Canary build of packages using CodeSandbox CI + mini repl link per PR (#11479)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-04-24 18:19:57 -04:00
Zen
af669297ef
Fix evaluation order with object spread (#11412)
* Fix object spread runtime semantics

* limit this deoptimization

* optimize empty objects

* declare variables
2020-04-23 17:59:35 -04:00
Huáng Jùnliàng
5f299bab18
chore: test against node.js 14 (#11467) 2020-04-23 07:06:39 -04:00
Kevin Lau
9b716518ed
Throw error on TypeScript declare const enum (#11410)
Throw error on `const enum` even if it has `declare`.

Resolves: #10785
2020-04-23 11:27:19 +02:00
beraliv
a34424a894
Adding createFlowUnionType in place of createUnionTypeAnnotati… (#11448)
* 🔄 createUnionTypeAnnotation => createFlowUnionType

*  add createFlowUnionType if it exists (in new versions only ⚠️)

* 🔄 use createFlowUnionType for createUnionTypeAnnotation
2020-04-22 19:11:01 +02:00
Huáng Jùnliàng
928b9f8c95
chore: add node.js 14 support data (#11462) 2020-04-22 09:42:15 -05:00
Brian Ng
1a2f67191c
Update flow test whitelist (#11459) 2020-04-21 16:39:40 -05:00
Nicolò Ribaudo
d4c8db5177
Update babel-plugin-dynamic-import-node to 2.3.3 (#11458) 2020-04-21 21:26:33 +02:00
Brian Ng
40c517ed84
Set exprAllowed to false for star token (#11449) 2020-04-21 14:22:40 -05:00
Huáng Jùnliàng
fba64d439d
fix: disallow expression after binding identifier of (#11355) 2020-04-21 15:12:23 -04:00
Huáng Jùnliàng
d18d465cf3
remove < x.y.z engines specification (#11456)
* chore: remove lt engines specification

* remove unecessary yarn update
2020-04-21 21:02:27 +02:00
Nicolò Ribaudo
5b8477e969
Update dynamic import (#11453)
* Update babel-plugin-proposal-dynamic-import fixture test outputs

* Update package.json files

Co-authored-by: Arun Kumar Mohan <arunmohandm@gmail.com>
2020-04-21 12:12:54 +02:00
Huáng Jùnliàng
53008803fb
Update compat data (#11450)
* chore: update compat-data

* refactor: use Set for proposalPlugins
2020-04-21 11:37:47 +02:00
Arun Kumar Mohan
7e6839f42b
refactor(babel-node): Refactor babel-node tests configuration (#11440) 2020-04-20 16:03:58 -04:00
Nicolò Ribaudo
1a08aa5adc
Update failing fixtures (#11447) 2020-04-20 18:06:08 +02:00
Justin Ridgewell
d6efed5b22
Fix redeclaring private in nested class's superClass (#11424)
If a nested class's `superClass` redeclares the outer class's private field and access it in a computed key, that should fail.

Follow up to #11405.
2020-04-20 16:54:14 +02:00
Huáng Jùnliàng
0aa5a47196
chore: remove included proposal plugins (#11433) 2020-04-16 21:14:46 +02:00
Huáng Jùnliàng
1c0970131e
polish: recommend preset for js extensions (#11421) 2020-04-16 21:13:57 +02:00
Nicolò Ribaudo
d9eb94327a
Don't include "resolve" in @babel/standalone (#11432)
* Don't include "resolve" in @babel/standalone

* Also alias src
2020-04-16 20:19:22 +02:00
beraliv
6b8f6ab2de
transform-spread: create TS types (not Flow) when using TS (#11378)
*  add test fixture

*  add removeTypeDuplicates for typescript

*  add createTSUnionType for typescript

* 💊 fix ConditionalExpression for typescript

* 💊 fix ConditionalExpression

* 💊 fix added test case

*  add new line at the end of the file

* 💊 types.every(f) => f(types[0])

* 🔄 bug => foo

*  add TSBaseType

*  add conditions NOT to break backward compatibility
2020-04-15 21:47:28 +02:00
Huáng Jùnliàng
c85aafdff6
chore: upgrade @babel/* deps (#11422)
* chore: upgrade @babel/* deps

* chore: run build-bundle-ci before check-compat-data
2020-04-15 16:57:22 +02:00
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