12544 Commits

Author SHA1 Message Date
Babel Bot
7e4f48139c Add v7.6.0 to CHANGELOG.md [skip ci] 2019-09-06 17:36:19 +00:00
Nicolò Ribaudo
cbd5a26e57
v7.6.0 v7.6.0 2019-09-06 19:25:16 +02:00
Nicolò Ribaudo
42e5974fd4
Remove old uglify option
It's false by default
2019-09-06 19:24:15 +02:00
Nicolò Ribaudo
735abc0ed8
Update lerna
v3.16 includes https://github.com/lerna/lerna/pull/2185,
which fixes an issue we had in the v7.5 releases
2019-09-06 18:40:06 +02:00
Corey Farrell
aa7678f32a Remove core-js from @babel/register. (#9847)
This module doesn't use core-js at all.
2019-09-06 18:11:38 +02:00
Huáng Jùnliàng
b64cb9aaf1 fix: early return when instance is not iterable (#10396)
* fix: early return when instance is not iterable

* chore: update test fixtures

* fix: gaurd against arguments for old browsers
2019-09-06 18:09:57 +02:00
Huáng Jùnliàng
8da9d8b4b8 feat(errors): validate preset when filename is absent (#10181)
* feat(errors): validate preset when filename is absent

Closes #10154

* fix: test overrides for filename compulsory

* docs: rewrite validate error message

per https://github.com/babel/babel/pull/10181#discussion_r301607986

* polish error message
2019-09-06 18:09:19 +02:00
Tim McClure
3e4889d649 Class Private Static Accessors (#10217)
* Remove error for static private accessors

* Private static accessors strict

* Add loose mode support

* Move `value` decl for early return

* Reuse getter/setter template

* Reuse getter/setter templates

* Use `buildUndefinedNode` in accessor templates

* Extract `isAccessor` variable
2019-09-06 18:08:10 +02:00
Huáng Jùnliàng
da0af5fd99 V8intrinsic syntax plugin (#10148)
* feat: v8intrinsic syntax plugin

Implement V8 Intrinsic Syntax Extension. Here we check the execution branch inside the parseSubscript to make sure the V8IntrinsicIdentifier is immediately followed by a call expression.

* feat: disable combining placeholders and v8intrisic

per https://github.com/babel/babel/issues/10104#issuecomment-506950969

* test: add more error cases

* refactor: parse v8 intrinsic in parseExprAtom

This approach is identical to V8’s implementation. Move the test cases as the behaviour changes.

* fix: plugin-name typo

* test: add yield-expression test case

* feat: require startsExpr on modulo for v8intrinsic

* perf: skip eof and braceR check as they must return false

* Print V8IntrinsicIdentifier

* feat: add v8intrinsic to parser typings

* Add generated type helpers

* fix: incorrect type definition

* fix: allow V8IntrinsicIdentifier to be callee
2019-09-06 17:43:19 +02:00
Vivek Nayyar
b02e35c19a Fix parenthesis for nullish coalescing (#10269)
* ♻️ added condition to check for left and right of nullish coalescing operator and if any is a logical expression without a paren then throw an error

* 🐛 bugs fixed and test cases updated for babel parser

* ♻️ code comments added

* 🐛 spell error rectified

* ♻️ failing test updated

* 🐛 push tests after make build

* Skip nullish-coalescing flow precedence tests

They're now incorrect

* ♻️ error message updated, binop priority of other logical operators +1 from ?? and

* ♻️ increaed the binOp for in and instanceOf, added logic to print the brackets in an ?? && || expression, test cases added

* 🐛 failing test fixed and comments updated

* ♻️ new lines added between tests

* ♻️ basic tests for checking the binOp of instanceOf, in and relational operators to be equal added

* ♻️ new lines added in between tests
2019-09-06 17:35:44 +02:00
Nicolò Ribaudo
3e8a5c5e28
Use "validateLogs" for preset-env's debug fixtures (#10401)
* Add ability to ignore output to the test runner

* Use normal fixtures instead of custom debug-fixtures in preset-env
2019-09-06 17:32:20 +02:00
Bin Xin
8769903284 Add supports for polyfill computed methods (#10398) 2019-09-06 01:35:03 +02:00
Bin Xin
5c859b1117 Don't polyfill if evaluation is not confident (#10397) 2019-09-06 00:29:19 +02:00
Huáng Jùnliàng
2e7bea4a6a fix: transform name capturing regex once (#10395)
* fix: transform name capturing regex once

* refactor: early return when pattern contains only lookbehind

* chore: simplify test regex

* chore: run test on >=8.0.0
2019-09-05 17:35:57 +02:00
Bin Xin
29734b924a Don't allow instance properties transformation on namespace (#10372) 2019-09-05 10:32:57 -05:00
Huáng Jùnliàng
6813ee02d7 chore: update regexp-tree to version 0.1.13 (#10376) 2019-09-05 10:07:18 -05:00
Adam Ramberg
fcb77de901 [preset-env] Include / exclude module plugins properly (#10218)
* Include / exclude module plugins properly

* Use filter-items to excl / incl module plugins

* Move transform selection to getModulesPluginNames

* Remove unnecessary spread operator

Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* Adjust tests to changes in #10218
2019-09-05 15:58:29 +02:00
Ajay Sagar
d05bd9edc8 Bumped chokidar dependency of babel-cli to 2.1.8 (#10394) 2019-09-04 21:33:31 -04:00
Nicolò Ribaudo
27ba292774
Silence remaining test warnings (#10392) 2019-09-04 22:56:47 +02:00
Tan Li Hau
a08e856804 fix typescript for babel-types (#10098)
* fix typescript for babel-types

* fix missing typescript/flow types for babel-types

* Add cloneNode to flow.js

* Add cloneNode to typescript.js
2019-09-04 15:35:19 +02:00
Shrey Banga
c0e3fa0081 Refactor trailing comma comment adjustment (#10380)
* Refactor trailing comment adjustment

Following up from https://github.com/babel/babel/pull/10369

- Unify the logic for adjusting trailing comments into a separate
  function
- Use it for all three cases, which fixes a bug for ObjectExpressions
  and CallExpressions
- Update tests to check for the fixed bug

* Fix tests

- Only modify trailingComments if necessary
- Update snapshots of a couple of affected tests

* Drop the underscore in adjustCommentsAfterTrailingComma_

* Handle ArrayPattern

* Handle ObjectPattern

* Handle import and export declarations

These have to be handled a bit differently, because the  node is visited after the  and before the declaration. So we intercept when we are going from the last specifier to the source node.

* Remove unnecessary check
2019-09-02 20:35:15 -04:00
Dylan Kirkby
e5afa57cca Allow setting 'allowNamespaces' in typescript preset (#10382)
* Support 'allowNamespaces' in typescript preset

* Remove default for allowNamespaces
2019-09-02 20:33:01 -04:00
Thiago Arrais
e7fa566442 Includes test for #8354 (#10385) 2019-09-02 21:58:54 +02:00
Nicolò Ribaudo
7c0333e12a
Move preset-env old changelog
Fixes #9730
2019-09-02 12:41:55 +02:00
Shrey Banga
8a775a32ba Retain trailing comments in array expressions (#10369)
* Retain trailing comments in array expressions

This is a proposed fix for https://github.com/babel/babel/issues/10368
with a simple test.

* Move lastElement in the block where it's used

* Test trailing comment after array expression

* Don't move comments after the array expression

* Retain trailing comment after the array expression
2019-08-28 14:03:37 -04:00
dependabot[bot]
94e47c30a9 Bump eslint-utils from 1.4.0 to 1.4.2 (#10370)
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.4.0...v1.4.2)

Signed-off-by: dependabot[bot] <support@github.com>
2019-08-27 09:50:33 +02:00
Justin Ridgewell
1664cce681
Don't allow JSXNamespacedName to chain (#10366)
Eg, `namespace:foo.bar` used to parse but is invalid in the [spec](https://facebook.github.io/jsx/).

Also, allow `JSXNamespacedName` in the `JSXOpeningElement`/`JSXClosingElement` builders.
2019-08-26 13:16:22 -04:00
Nicolò Ribaudo
a2bf68981f Add TSBigIntKeyword to @babel/types (#10341) 2019-08-20 17:31:45 -05:00
Nicolò Ribaudo
15aa511b8e Do not register ambient classes to the TS scope (#10352) 2019-08-20 17:22:47 -05:00
Henry Zhu
11ed2e2bf5 readme: links/contributing updates (#10206) [skip ci]
* readme: links/contributing updates

* Update README.md
2019-08-19 09:31:37 +02:00
Even Alander
eb3767d58b Add a builder definition including name for tsTypeParameter (#10319) 2019-08-15 19:59:08 +02:00
Nicolò Ribaudo
f0c2364d01
Do not delete "fake" source map comments from strings (#9960)
Instead of using `convert-source-map`'s `removeComments` method before
parsing the file, we can first parse the file with `@babel/parser` and then
analyze the comments.
This is needed because it is not possible to reliabily detect comments in
JavaScript without fully parsing the file:
https://github.com/thlorenz/convert-source-map/issues/63
2019-08-14 17:05:55 +02:00
Huáng Jùnliàng
ee344c3e4c Revert "chore: remove FORCE_COLOR workaround" (#10336)
This reverts commit 347ee036becdca3c9e158311d44a48ed89df9a94.
2019-08-14 16:58:01 +02:00
Ziad El Khoury Hanna
64041e1669 Fix flow comments plugin issues (#10329)
* Fix issues in flow-comments to preserve comments and there order (fixes #10324)

* Add support in flow-comments for extends in class declarations (fixes #10323, #10321)

* Refactoring and cleanup of flow-comments plugin

* Fix comments preservation logic of flow-comments

* Fix flow-comments where comments are class identifier and extends keyword
2019-08-14 15:46:26 +02:00
Nicolò Ribaudo
469a5a71cd
Allow testing logs with @babel/helper-transform-fixture-test-runner (#10326)
* Add support for logs to transform-fixture-test-runner

* Test some warnings

* Use stderr/stdout, and add a validateLogs test option

* Normalize CWD in logs and rename vars

* Silence preset-env tests

* Restore old methods
2019-08-14 08:03:03 +02:00
Huáng Jùnliàng
75090f10e5 fix: assign comment to ObjectProperty only when inside an ObjectExpression (#10292)
Fixes #10230
2019-08-13 13:49:16 -05:00
Huáng Jùnliàng
22df2ae244 Commit generated code (#10331)
* update prettier generated artifacts

* chore: sync babel-helpers to artifacts
2019-08-13 16:31:28 +02:00
Nicolò Ribaudo
051965052c
Update @lerna/collect-updates git hash 2019-08-13 12:03:34 +02:00
Thiago Arrais
ee397ff107 Adds note about two approval policy to PR template (#10313)
* Adds note about two approval policy to PR template

* Adds qualifier to approval policy

Because, although two approvals is the general case, some PRs maybe merged with more or fewer approvals

[skip ci]
2019-08-12 17:32:31 +02:00
Huáng Jùnliàng
15535cf52c Update preset-env text fixtures (#10318)
* chore: update preset-env text fixtures

* chore: remove FORCE_COLOR workaround
2019-08-12 00:55:27 +02:00
README Bot
682d9f9f09 Add CodeTriage badge to babel/babel (#10088) [skip ci]
Adds a badge showing the number of people helping this repo on CodeTriage.

[![Open Source Helpers](https://www.codetriage.com/babel/babel/badges/users.svg)](https://www.codetriage.com/babel/babel)

## What is CodeTriage?

CodeTriage is an Open Source app that is designed to make contributing to Open Source projects easier. It works by sending subscribers a few open issues in their inbox. If subscribers get busy, there is an algorithm that backs off issue load so they do not get overwhelmed

[Read more about the CodeTriage project](https://www.codetriage.com/what).

## Why am I getting this PR?

Your project was picked by the human, @schneems. They selected it from the projects submitted to https://www.codetriage.com and hand edited the PR. How did your project get added to [CodeTriage](https://www.codetriage.com/what)? Roughly over 3 years ago, [iamsolankiamit](https://github.com/iamsolankiamit) added this project to CodeTriage in order to start contributing. Since then, 94 people have subscribed to help this repo.

## What does adding a badge accomplish?

Adding a badge invites people to help contribute to your project. It also lets developers know that others are invested in the longterm success and maintainability of the project.

You can see an example of a CodeTriage badge on these popular OSS READMEs:

- [![Email clients like GMAIL do not render SVG images](https://www.codetriage.com/rails/rails/badges/users.svg)](https://www.codetriage.com/rails/rails) https://github.com/rails/rails
- [![Email clients like GMAIL do not render SVG images](https://www.codetriage.com/crystal-lang/crystal/badges/users.svg)](https://www.codetriage.com/crystal-lang/crystal) https://github.com/crystal-lang/crystal

## Have a question or comment?

While I am a bot, this PR was manually reviewed and monitored by a human - @schneems. My job is writing commit messages and handling PR logistics.

If you have any questions, you can reply back to this PR and they will be answered by @schneems. If you do not want a badge right now, no worries, close the PR, you will not hear from me again.

Thanks for making your project Open Source! Any feedback is greatly appreciated.
2019-08-09 19:18:18 +02:00
Serge Havas
a112be2fa0 [fix] jsx helper calls order (#10307)
imitate properly react createElement calls order
2019-08-08 22:43:57 +02:00
ifsnow
9ec26a7d3e Improves the logic to import objects in helpers (#10161)
* Improves the logic to import objects in helpers

* Modified to work with more cases.

* Modified by considering exception cases

* Fixed not using bundler's polyfill

Co-Authored-By: Jordan Harband <ljharb@gmail.com>

* Updated test output files

* Changes to cache logic

* Modified to use if statement
2019-08-08 11:11:50 +02:00
Thiago Arrais
ba2c0f7adf fix: register inserted class declaration (#10302)
* Decorators legacy: register inserted declaration

For compatibility with the Typescript plugin

Fixes #10264

* Register declaration but also keep replaceWithMultiple
2019-08-08 07:14:23 +02:00
Huáng Jùnliàng
5fb4d84a33 perf: always return void 0 as undefined node (#10243) 2019-08-01 09:53:40 +02:00
Tan Li Hau
3e4a9d588b Do expressions transform for switch statements (#10070)
* lint fix

* switch inside do expression

* review comments

* review comments

* make min diff

* adding more test

* review changes

* review changes

* handle block statement and added more test cases

* fix implementation and add more test cases

* fix last swtich case

* disable block fallthrough case

* fix nitpick reviews
2019-08-01 09:36:35 +02:00
Tan Li Hau
be2cbde560 remove finally from completion record in trystatement (#10277) 2019-08-01 09:24:08 +02:00
Ashwin Ramaswami
66727632e8 fix: replace es.string.reverse with es.array.reverse (#10284) 2019-08-01 09:20:52 +02:00
Brian Donovan
ba28f462bc Fix typo "to" → "so". (#10288) 2019-07-31 16:04:53 -04:00
Huáng Jùnliàng
f08062b1de chore: fix ESLint errors (#10278) 2019-07-29 10:14:11 -05:00