13853 Commits

Author SHA1 Message Date
Bogdan Savluk
32e7bb4027
fix build config to work the same when running on windows (#11688) 2020-07-30 14:11:58 -04:00
Ujjwal Sharma
2ac49ba7c4
add support for logical assignments with private properties (#11702)
* add support for logical assignments with private properties

Patches the logic for handling assignment operators and adds support for
handling the logical assignment operators appropriately.

Fixes: https://github.com/babel/babel/issues/11646

* replace hardcoded logical assignment operators with constant

Replace a hardcoded check for logical assignment operators with the
LOGICAL_OPERATORS constant in
plugin-proposal-logical-assignment-operators.

Refs: https://github.com/babel/babel/pull/11702#discussion_r438554423
2020-07-30 14:10:16 -04:00
James C. Davis
aa82ab6358
Typescript: always strip declare from class fields (#11747)
* test: add failing test for decorated declare

* fix: always strip declare from class fields

* test: add decorated-declare-properties test
2020-07-30 14:06:45 -04:00
Huáng Jùnliàng
4c9929ca28
Prepare to publish @babel/eslint-* packages (#11894)
* remove private flag, bump node and babel versions

* disallow submodule imports

* Revert "Do not automatically publish eslint packages (#10722)"

This reverts commit 5ca8acdb38bc7a9a4669ad3249c219531f8f6579.

# Conflicts:
#	Makefile
#	eslint/babel-eslint-parser/package.json
#	eslint/babel-eslint-plugin-development/package.json
#	lerna.json
#	scripts/integration-tests/publish-local.sh

* disable submodule imports for babel-eslint-config-internal

* chore: push back a bit to make tests happy
2020-07-30 13:32:38 -04:00
Huáng Jùnliàng
0e4cf1e6a2
chore: build standalone once in prepublish step (#11777) 2020-07-30 12:54:56 -04:00
SZ-Coder
4ce1b70ade
Fix incorrect module path when absoluteRuntime is specified (#11893)
* - Added failing tests for issue #11885.

* - Fix issue #11885: absoluteRuntime does not work as expected with corejs3.

* - Removed helper code from test output files (tests for issue #11885).

* chore: add @babel/runtime-corejs3 to dev deps

* chore: update test fixtures

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-07-30 10:35:37 -04:00
Huáng Jùnliàng
164a93945d
add showConfig support (#11588)
* draft: showConfig support

* feat: pass through showConfig command options

* update test file

* refactor: add createLogger to makeChainWalker

* serializing dynamic plugin instance

* fix flow errors

* chore: add tests on extended config

* fix: do not print empty presets

* add more test cases

* add windows testcases

* address review comments

* throw error when showConfigPath does not exist

* print reason when showConfig is targetting an ignored file

* remove showConfig: boolean

* refactor: simplify environment flag name

* rename test fixtures

* fix: throw when SHOW_CONFIG_FOR is not a regular file

* cleanup test fixtures

* add test on only

* Update packages/babel-core/src/config/files/configuration.js

Co-authored-by: Brian Ng <bng412@gmail.com>

* address review comments

* update test fixtures

* feat: sort config items in ascending priority

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-30 09:24:19 -04:00
dependabot[bot]
374a253d0c
chore(deps): bump elliptic from 6.5.2 to 6.5.3 (#11891)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-29 20:26:38 -05:00
Huáng Jùnliàng
01d4625412
Correctly check reserved word for PropertyDefinition: IdentifierReference (#11862)
* fix: check IdentifierReference in PropertyDefinition

* chore: add more test cases

* fix: incorrect test title
2020-07-29 19:40:52 -04:00
Kai Cataldo
4ac9c7afe2
Upgrade to ESLint v7 (#11857)
* Upgrade to ESLint v7

* Upgrade eslint-plugin-import

* Update peer deps

* Remove max-len from ESLint config

* Update tests

* Only test babel-eslint-* packages in Node >=10

* Remove babel-eslint

* Fix linking in dev

* Add comment to Makefile

* Fix e2e tests

* Add --ignore-engines flag when installing in ESLint packages

* fix: convert tt.questionDot to Punctuator

* chore: update lockfile

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-07-29 19:11:48 -04:00
Huáng Jùnliàng
95fcb3e16c Update compat-table (#11890)
* chore: update compat-table

* chore: friendly to node < 14 contributors

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

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-29 18:32:12 -04:00
morrme
2f89e72321 enable logical assignment in babel preset env (#11876)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-07-29 18:32:12 -04:00
Vahagn Aharonian
b651a6f6ab Enable logical assignment by default in @babel/parser (#11860) (#11869) 2020-07-29 18:32:12 -04:00
Huáng Jùnliàng
0e985fb287 feat: enable numericSeparator parsing support (#11863) 2020-07-29 18:32:12 -04:00
Huáng Jùnliàng
ccd98f042c Add numeric-separator to preset-env (#11865) 2020-07-29 18:32:12 -04:00
Huáng Jùnliàng
cdb81d7703 Add export-namespace-from to preset-env (#11849)
* feat: add compat-data of proposal-export-namespace-from

* feat: add export-namespace-from to preset-env

* chore: update test fixtures

* address review comments
2020-07-29 18:32:12 -04:00
Nicolò Ribaudo
eba4c3b6ed TypeScript 4.0: Support labeled tuple elements (#11754)
* TypeScript 4.0: Support labeled tuple elements

* More tests

* Disallow mixing labeled and unlabeled elements

* Update AST shape

* Enable test after rebase

* Allow labeled spread types

* Fix flow

* Add types and generator suport

* Update packages/babel-parser/src/plugins/typescript/index.js

* Prettier
2020-07-29 16:51:48 -04:00
Huáng Jùnliàng
9e6663f125 Follow-up on initial TS4 catch param support (#11767)
* refactor: align with AST shape convention

* feat: print catch param type annotations

* test: add test case on transform
2020-07-29 16:51:48 -04:00
Brian Ng
8a1d7e41f2 Allow unknown/any in TS catch clause param (#11755) 2020-07-29 16:51:48 -04:00
Nicolò Ribaudo
5b4b3a3e4a TypeScript 4.0: Allow spread in the middle of tuples (#11753) 2020-07-29 16:51:48 -04:00
Huáng Jùnliàng
d7347fb8bd
eslint-parser: ES2020 features (#11815)
* chore: update espree test on nullish coalescing

* feat: add optional chaining support

* fix: adapt to estree AST shape

* chore: update lockfile

* add estree optional-chaining test fixtures

* address review comments

* chore: simplify smoke test

* export * support

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-29 16:46:29 -04:00
Huáng Jùnliàng
059e9124ff
Add decimal parsing support (#11640)
* docs: add DecimalLiteral to AST spec

* add decimal support

* fix: throw invalid decimal on start

* add DecimalLiteral type definitions

* update parser typings

* add generator support

* add syntax-decimal plugin

* Add syntax-decimal to babel-standalone

* add syntax-decimal to missing plugin helpers

* fix incorrect test macro
2020-07-29 16:43:15 -04:00
James Addison
9daa50e005
babel-traverse: prefer clearer, reduced-bias option naming (#11791)
* babel-traverse: prefer clearer, reduced-bias option naming

* Apply suggestions from code review

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-07-29 16:41:20 -04:00
coderaiser
cf425a0bde
feature: babel-core: add cloneInputAst (#10241)
Co-authored-by: coderaiser <coderaiser@cloudcmd.io>
2020-07-29 16:40:02 -04:00
Huáng Jùnliàng
6373eb5d82
chore: use modules: "auto" (#11879)
* chore: use modules: “auto”

* address review comments
2020-07-28 09:41:35 -04:00
Sven
3a0aa8e829
chore(github): fix issue template typo (#11875) 2020-07-24 19:33:33 -04:00
Huáng Jùnliàng
2bf38fb914
fix: disallow \8, \9 in strict mode string (#11852) 2020-07-21 09:44:56 -04:00
Huáng Jùnliàng
3680f019d7
fix: allow 09.1_1 and 09e1_1 in sloppy mode (#11854)
* fix: allow 09.1_1 and 09e1_1 in sloppy mode

* polish: avoid extra input source scanning

* chore: move comment [skip ci]
2020-07-21 09:44:28 -04:00
Huáng Jùnliàng
48be93b46c
refactor: replace caniuse-db by mdn-browser-compat-data (#11838)
* refactor: replace caniuse-db by mdn-browser-compat-data

* fix broken test
2020-07-20 17:11:21 -04:00
Huáng Jùnliàng
e51a91e131
fix: eval?.() is indirect (#11850) 2020-07-20 17:06:27 -04:00
Huáng Jùnliàng
238cadda4c
chore: update spec-new in CONTRIBUTING.md [skip ci] (#11706)
* chore: update CONTRIBUTING.md [skip ci]

* Update CONTRIBUTING.md [skip ci]

Co-authored-by: Brian Ng <bng412@gmail.com>

* Update CONTRIBUTING.md [skip ci]

Co-authored-by: Brian Ng <bng412@gmail.com>

* Apply suggestions from code review [skip ci]

Co-authored-by: Brian Ng <bng412@gmail.com>

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-16 21:46:41 -04:00
Huáng Jùnliàng
f4eeff947d
fix: correctly set innerEndPos in CoverParenthesizedExpressionAndArrowParameterList (#11847) 2020-07-16 17:11:06 -05:00
Huáng Jùnliàng
8f191ead92
chore: fix typo in codebase (#11846) 2020-07-16 16:01:20 -05:00
Huáng Jùnliàng
02f30af59c
refactor: reorganize babel types definitions structure (#11843)
* refactor: reorganize babel types definitions structure

* chore: update generated artifacts
2020-07-15 17:34:31 -04:00
Joshua Ohlman
e12caf4f69
Always retain lines for async arrow (#11836) 2020-07-15 22:48:08 +02:00
Huáng Jùnliàng
7eaf37ea3e
chore: use repository HEAD when pulling third party repos (#11837) 2020-07-14 18:14:25 -04:00
Babel Bot
cc646fa10a Add v7.10.5 to CHANGELOG.md [skip ci] 2020-07-14 18:51:51 +00:00
Huáng Jùnliàng
f7964a9ac5 v7.10.5 2020-07-14 14:10:36 -04:00
Huáng Jùnliàng
5dd64ecc4a
Disallow duplicated AST nodes (#11807) 2020-07-14 08:32:16 -05:00
Brian Ng
ffb42488ba
Bump some deps for audit (#11818) 2020-07-10 21:42:18 +02:00
Huáng Jùnliàng
02c8fd92bd
fix: add optional: false to chained optional call expression (#11814) 2020-07-09 20:33:50 -04:00
Rafael Salguero Iturrios
f32d5debda
Typescript transform now removes generic arguments from optional calls (Fixes #11813) (#11816) 2020-07-09 17:32:05 -05:00
James Addison
55ce749f42
Replace lodash 'clone' usage with ES6 Spread initializer (#11811) 2020-07-09 10:32:04 -05:00
James Addison
aae1862170
Replace lodash 'extend' usage with Object.assign (#11812) 2020-07-09 09:04:48 -05:00
James Addison
bff6298578
Reduce dependency on lodash functions: values, extends (#11798)
* Replace lodash 'values' usage with Object.keys => .map(obj[key])

* Block scoping: refactor letReferences, outsideLetReferences as objects of type Map

* Remove lodash dependency from babel-plugin-transform-block-scoping

* Fixup: Add missing Object.keys call

* Fixup: Update remaining property accessors

* Coerce Map.values() iterator results into an array via spread operator

* Fixup: Map.put -> Map.set

* Fixup: undo incorrect variable de-duplication

* Replace array-spread-plus-map combination with Array.from call

* Extract an extendMap function as an attempt to create an optimization boundary

* Experiment: cast objects to string (eliminates one Map/object difference per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map )

* Fixup: perform String cast on map keys, not values

* Revert "Fixup: perform String cast on map keys, not values"

This reverts commit abdd147438fa74f51ac50ef1f96bb462810cd3f2.

* Revert "Experiment: cast objects to string (eliminates one Map/object difference per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map )"

This reverts commit a4035c885b37bfd6e926a0362bda9dcf5b5a52c2.

* Experiment: filter keys via Object.prototype.hasOwnProperty.call

* Revert "Experiment: filter keys via Object.prototype.hasOwnProperty.call"

This reverts commit 491c093f213c6229815b2e6dc9243245376265b0.

* Migrate back from Map-based reference storage to Object-based storage; access performance appears much improved for Object property access

* Revert "Migrate back from Map-based reference storage to Object-based storage; access performance appears much improved for Object property access"

This reverts commit 2119acc7f0d78ced3b9ad77820b4b72e5ad67475.

* Iterate over a clone of outsideRefs keys

* Revert "Extract an extendMap function as an attempt to create an optimization boundary"

This reverts commit 85689f2bfc180d0b5c0e674e5de7954470c7ec69.

* Fixup: migrate remaining Object property access to Map.get in tdz module
2020-07-08 13:17:04 +02:00
Brian Ng
58cfaf20ee
Fix break/continue when switch is nested inside loop (#11802)
* Fix break/continue when switch is nested inside loop

* merge retCheck
2020-07-07 18:38:11 -04:00
Bogdan Savluk
b1a8e72e16
Refactor generated builder names in @babel/types (#11582)
* ensure only builders starting with lowercase are used

* update generate builders to have function name starting flow lowercase

* fix bug in deprecated builders

* remove comment about not yet discussed change in next major version
2020-07-07 09:53:00 +02:00
Huáng Jùnliàng
3a53f7244d
docs: update README example and REPL link (#11799) 2020-07-06 20:21:38 -04:00
James Addison
3e55270135
Reduce dependency on lodash functions: includes, uniq, repeat, isinteger (#11790)
* Replace lodash 'includes' usage with Array.prototype.includes

* Replace lodash 'values' usage with Object.values

* Replace lodash 'uniq' usage with Array.from(new Set(...))

* Property safety: ensure that ignoreSuites/ignoreTasks are populated prior to access

* Property safety: ensure that blacklistTypes is populated prior to access

* Revert "Replace lodash 'values' usage with Object.values"

This reverts commit 9fd3679d6db03066daee09fad0050e5292a32aa1.

* Replace lodash 'repeat' usage with String.prototype.repeat

* Replace lodash 'isinteger' usage with Number.isInteger

* Remove explicit lodash dependency from babel-generator package

* Update packages/babel-helper-transform-fixture-test-runner/src/index.js

Co-authored-by: Brian Ng <bng412@gmail.com>

* Rely on optional chaining operator as sole boolean check

* Handle additional optional chaining operator simplification

* Update type signature

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-06 09:27:41 +02:00
Huáng Jùnliàng
c664fbdd07
fix: update class properties support matrix (#11783) 2020-07-03 07:54:40 -04:00