Compare commits

...

410 Commits

Author SHA1 Message Date
Nicolò Ribaudo
a9a7f4e690 v7.5.4 2019-07-09 20:52:37 +02:00
Nicolò Ribaudo
fa5ec75c43 Fix _objectSpread2 for real (#10188)
* Fix _objectSpread2 for real

* Tests

* Test 2
2019-07-09 20:50:07 +02:00
Babel Bot
b961d39a4d Add v7.5.3 to CHANGELOG.md [skip ci] 2019-07-09 14:52:52 +00:00
Nicolò Ribaudo
759ff4d6df v7.5.3 2019-07-09 16:41:44 +02:00
Nicolò Ribaudo
9e65472377 [_objectSpread2] Do not use hoisted var from prev iteration (#10180) 2019-07-09 16:38:40 +02:00
Babel Bot
25f040caa4 Add v7.5.2 to CHANGELOG.md [skip ci] 2019-07-08 19:53:06 +00:00
Nicolò Ribaudo
0dbf99bedb v7.5.2 2019-07-08 21:46:49 +02:00
Nicolò Ribaudo
f48b47c1f7 Do not trust Scope when removing TypeScript types (#10174)
* Do not trust Scope when removing TypeScript types

* Warn

* Update warning message

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

* Add test

* Node 6
2019-07-08 21:44:26 +02:00
Nicolò Ribaudo
406a65c894 Don't rely on getOwnPropertyDescriptors in objectSpread2 (#10171) 2019-07-07 11:24:36 +02:00
Huáng Jùnliàng
075a50242d fix: register injected importDeclaration (#10172) 2019-07-06 10:44:14 -05:00
Babel Bot
c777e81e06 Add v7.5.1 to CHANGELOG.md [skip ci] 2019-07-06 08:13:08 +00:00
Nicolò Ribaudo
d0519fa907 v7.5.1 2019-07-06 10:07:59 +02:00
Nicolò Ribaudo
019fbca3f6 Update lerna 2019-07-06 09:57:20 +02:00
Nicolò Ribaudo
24dde2e8e8 Fix objectSpread2 backward compatibility (#10170) 2019-07-06 09:48:36 +02:00
Wesley Wolfe
bff79e198a Retain typescript export-from-source (#10167) 2019-07-05 20:47:55 +02:00
Henry Zhu
106bb41d47 change pkg name back from used-by [skip ci] 2019-07-04 12:30:56 -04:00
Babel Bot
d19f053482 Add v7.5.0 to CHANGELOG.md [skip ci] 2019-07-04 13:00:18 +00:00
Nicolò Ribaudo
49da9a07c8 v7.5.0 2019-07-04 14:52:17 +02:00
Lidor Avitan
b06663320e Update babel-preset-stage (0,1,2,3) readme files (#10111) [skip ci]
* chore: update docs babel-preset-stage readme [ci skip]

* fix:  by PR request change [ci skip]
2019-07-04 12:24:42 +02:00
Tan Li Hau
d50e78d45b fix await and yield for do expression (#10072) 2019-07-03 09:54:39 -05:00
Artem Butusov
5b86353b35 Added es3 backward compatibility for react helper code (#10155)
* Added es3 backward compatibility for react helper code

* tweak comment [skip ci]
2019-07-03 16:49:20 +02:00
Tan Li Hau
f588e4ec47 BigInt type for Flow (#10091)
* flow BigIntLiteralTypeAnnotation

* numericSeparator for flow test plugins

* fix flow tuple

* fix code review
2019-07-03 16:48:46 +02:00
Brian Ng
cbb482e2f9 Bump compat-table and update preset-env mappings (#10127) 2019-07-03 09:37:06 -05:00
Sebastian Johansson
595a349174 Fix incorrect usage of $o instead of %o in debug (#10157)
It would end up printing the literal "$o" instead of the directory name.
2019-07-03 16:04:31 +02:00
Min ho Kim
0bf0ae3410 Fix typos (#10153) 2019-07-03 15:51:48 +02:00
Nicolò Ribaudo
ef3f555be9 Add proposal-dynamic-import to preset-env (#10109) 2019-06-30 13:58:50 +02:00
Nicolò Ribaudo
38f8bbac1a Create @babel/plugin-proposal-dynamic-import (#9552)
* Create @babel/plugin-proposal-dynamic-import

* Use airbnb/babel-plugin-dynamic-import-node

Do not duplicate code, which will unavoidably lead
to bugs being fixed in one plugin and not in the other.

* Update error message

* Add error callback to amd interop

* Update babel-plugin-dynamic-import-node
2019-06-30 13:21:46 +02:00
Thiago Arrais
a4170b5e32 Transform for F# Pipeline (#9984)
* Transform for F#-style await

Inludes support for optimizing single-parameter arrow functions

* Wait until optimization before pushing placeholder into scope
2019-06-30 12:53:22 +02:00
James DiGioia
6b8a37c413 Implement f# pipeline in parser (#9450) 2019-06-30 12:53:22 +02:00
Wesley Wolfe
0a98814329 Implement TypeScript namespace support (#9785)
* Add module tests for typescript namespace transform

Fixes #8244, fixes #10038
2019-06-30 12:15:09 +02:00
Nicolò Ribaudo
8bf9714d69 [legacy decorators] Allow decorating generator methods (#9912)
* [legacy decorators] Allow decorating generator methods

The old proposal used LeftHandSideExpression (instead of
AssignmentExpression) to satisfy this usecase:
e240cbc91a

* Update flow whitelist
2019-06-30 11:32:16 +02:00
Nicolò Ribaudo
ca67637da4 [@babel/parser] Add "allowUndeclaredExports" option (#9864)
Ref: https://github.com/babel/notes/blob/master/2019/04/09.md#export-changes-in-scope-pr-break-meteor-issue
2019-06-30 11:16:05 +02:00
Brian Ng
77fd7cd4c4 Allow defaults query in preset-env (#8897) 2019-06-30 11:00:43 +02:00
Tan Li Hau
1d3f9815df fix import typeof in declare module (#10132) 2019-06-26 13:37:16 -05:00
Letladi Sebesho
31fc1d06bc Babel cli test correction (#10128) 2019-06-25 15:38:32 -05:00
Bogdan Savluk
b8bb93a838 fix exportKind declaration in babel-types (#10126)
* fix exportKind types declaration for ExportNamedDeclaration and DeclareExportAllDeclaration in babel-types

* revert `let` in exportKind in babel-parser types
2019-06-25 22:29:38 +02:00
Erik Arvidsson
8f8a457798 Simplify the helpers for classPrivateField{Get,Set} (#10117)
No need to do the hash lookup twice. If the descriptor is not in the
WeakMap `get` returns `undefined`.
2019-06-22 00:23:26 +02:00
Pig Fang
11fa2461ce Disallow "let" as name at lexical bindings (#10099)
* Disallow "let" as name at lexical bindings

* Simplify

* Clean up
2019-06-18 23:17:00 +02:00
Paul Comanici
505b2cc18d Upgrade jest dependency (#10107) 2019-06-18 16:29:51 +02:00
Sven Sauleau
dcdf7c8fdd [skip ci] docs: update readmes (#10103)
Using our READMEs auto generation, two packages were updated.
2019-06-17 10:57:28 +02:00
Tan Li Hau
fdbbb743b6 flow - allow type parameter defaults in function declarations (#10084)
* flow - allow type parameter defaults in function declarations

* fix flow test

* add intern_comments option

* fix flow parser test

* remove allowdefault from flowParseTypeParameterDeclaration

* rename test cases
2019-06-15 12:31:12 +02:00
Letladi Sebesho
6852bf6415 Change duplicate tests for @babel/highlight getChalk method (#10093)
* removed duplicate tests for @babel/highlight getChalk method

* changed second 'getChalk' test case for when colors are not supported
2019-06-15 09:04:35 +02:00
Jamie Kyle
f92c2ae830 Change root package.json#name (#10021)
* Change root package.json#name

I'm pretty sure GitHub's new Dependants feature is based on this package.json. I'm updating it here so it will reflect the new name for the core package.

* Update package.json
2019-06-04 23:57:38 +02:00
Maël Nison
d7801c644c Prevents exception on PnP (#9951) 2019-06-02 00:55:44 +02:00
Mateusz Burzyński
84961ebb05 Refactor isImportTypeOnly helper function (#10047) 2019-05-31 23:54:44 +02:00
Blaine Bublitz
3144ed131a Use FUNDING.yml in babel/.github repo [ci skip] (#10032) 2019-05-30 09:52:43 +02:00
Martin Zlámal
ce4c374924 Fix printer for explicitly inexact Flow types (#10041)
Closes: https://github.com/babel/babel/issues/10040
2019-05-29 21:17:12 +02:00
Wesley Wolfe
8d492b159b Use scope for typescript export removals. Fixes #10033 (#10034)
This also fixes enum not adding the respective declaration to the scope
during the typescript visitation.

Rewrites:

2080042808 #9944

a6392bd636 #10019
2019-05-29 08:36:04 +02:00
Tan Li Hau
b4c9cb0222 Fixed computed keys for class expression (#10029)
* test case for insertBefore for jsx

* fix unshiftContainer and insertBefore

* use path.scope.push

* add test making sure computedKeys var declaration at the right block

* add comment

* nit [skip ci]
2019-05-28 23:07:55 +02:00
Kagami Sascha Rosylight
a596da2822 Retry to fix object spread helper compatibility (#9384)
This reverts commit 43b83f8ed7.

Fix objectSpread helper breaking old codes

remove tests to regenerate later

renamed output

new name

try using word

add comment as requested

revert inline name changes

add 2 for consistency

Update packages/babel-helpers/src/helpers.js

Co-Authored-By: Daniel Tschinder <daniel@tschinder.de>
2019-05-25 12:57:13 +02:00
Daniel Tschinder
1cfb92d66a Create SECURITY.md (#10018) 2019-05-25 12:46:59 +02:00
Nicolò Ribaudo
888b9f6940 Remove unused code in the TS parser plugin (#10025) 2019-05-25 08:46:01 +02:00
Tan Li Hau
b6486a22cb fix destructuring rest with template literal (#10013)
* fix destructuring rest with template literal

* update test
2019-05-24 00:03:27 +02:00
Airat Aminev
a6392bd636 fix(typescript): erase default export if exporting a TS type (#10019) 2019-05-23 16:58:24 -05:00
Henry Zhu
9dd8825eff Create funding.yml [skip ci] (#10016) 2019-05-23 21:02:16 +02:00
Nicolò Ribaudo
ecf4667305 Add "PR: Performance" label for the changelog (#10011) [skip ci] 2019-05-21 23:17:18 -04:00
Nicolò Ribaudo
87fb6c4a8b Use injectInitialization to generate ts parameter properties (#9610) 2019-05-21 22:28:55 +02:00
Brian Ng
58cf1a7d48 Bump deps (#10007) 2019-05-21 15:10:29 -05:00
Sebastian Silbermann
c96aef17e1 Add #9902 to changelog (#10010) [skip ci] 2019-05-21 21:33:27 +02:00
Babel Bot
fc38638aeb Add v7.4.5 to CHANGELOG.md [skip ci] 2019-05-21 17:49:18 +00:00
Nicolò Ribaudo
33ab4f1661 v7.4.5 2019-05-21 19:38:26 +02:00
Daniel Tschinder
54d257c105 Fix location for optional params in arrow functions (#9998)
* Fix location with optional params in arrow functions

* add test

* Ensure rollup replaces NODE_ENV and create sourcemap in dev

* Ensure finishNod*() is never called twice on a node

* Fix check for already finished nodes
2019-05-21 18:53:13 +02:00
Matthew Robertson
9c06e4ed4d avoid exceptions for control flow (#9974)
* avoid exceptions for control flow

* review feedback: remove conditional because we know it is "<"

* drop tsTryParseTypeArguments method
2019-05-21 17:23:53 +02:00
Daniel Tschinder
f5b8140580 Do not use lookahead when parsing construct signature declarations (#9995) 2019-05-20 23:27:41 -07:00
Daniel Tschinder
0430a48775 Update preset-env dependencies and fix fixtures (#10002)
* Fix fixtures after core-js update

* Update core-js, caniuse and compat-table
2019-05-20 23:27:19 -07:00
Matthew Schupack
45ca6751fa use console.warn for warning (#9992)
* use console.warn for warning

* fix tests
2019-05-18 00:36:18 +02:00
Daniel Tschinder
b1826bf0a0 Only compute Position if not already in state (#9989)
* Only compute Position if not already in state

* Prioritize start locations
2019-05-17 15:32:34 -07:00
Airat Aminev
2080042808 fix(typescript): erase type exports (#9944)
* fix(typescript): erase type exports

* use Set instead of array for tracking and checking TS type declarations

* add a test for an interface exported before its declaration
2019-05-17 07:22:52 +02:00
Daniel Tschinder
3f0590de2a Do not use lookahead when parsing jsx expression containers (#9988) 2019-05-16 17:27:07 -07:00
Daniel Tschinder
5661de5908 Do not use lookahead when parsing imports in declare module in flow (#9987) 2019-05-16 02:31:37 -07:00
Daniel Tschinder
c2d303f8be Do not use lookahead when parsing declare module or declare module.exports in flow (#9985)
* Do not use lookahead when parsing declare module or declare module.exports in flow

* Improve code
2019-05-16 02:31:21 -07:00
Daniel Tschinder
4da7a01aa9 Avoid unnecessary work during lookahead (#9982)
* Do not call pushComment when doing lookahead

* Do no updateContext when doing lookahead

* Do not clone contexts anymore
2019-05-15 17:02:12 -07:00
Daniel Tschinder
47eb1ddfe0 Do not use lookahead when parsing dynamic import or import.meta (#9983) 2019-05-15 16:34:16 -07:00
Nicolò Ribaudo
9febf63882 Fix mobile browsers support in preset-env (#9978)
* Fix mobile browsers support in preset-env

* Update fixtures

* Alias other mobile browsers, since they aren't included by compat-table
2019-05-15 14:05:37 +02:00
Daniel Tschinder
85432e2c44 Remove guardedHandlers from ASTs (#9979) 2019-05-15 03:37:22 -07:00
Nicolò Ribaudo
1969e6b6aa Update regenerator-transform (#9941) 2019-05-07 15:42:12 -04:00
Divyam Bhasin
7942dc0f07 Fixed null error in plugin opts and added a test for it (#9945)
* Fixed null error in plugin opts and added a test for it

* Remove !opts and add opts === null check to avoid confusion with false and undefined cases

Co-Authored-By: divbhasin <divbest99@gmail.com>
2019-05-07 16:23:01 +02:00
Tan Li Hau
354666aa17 fix: allow shebang directive (#9922)
* fix: allow shebang directive

* Update packages/babel-parser/src/plugins/flow.js

* chore: prettier
2019-05-07 16:22:25 +02:00
Nicolò Ribaudo
9e9b62f77a Update regexp-tree (#9940) 2019-05-06 20:11:46 +02:00
Nicolò Ribaudo
5da94bff87 [babel-node] Do not hardcode node flags (#9914) 2019-05-04 23:40:06 +02:00
Sebastian Silbermann
eae7a33316 Fix destructuring assignments being transpiled for edge 15 (#9902)
* Current behavior for preset-env destructuring and edge

* fix(preset-env): destructuring transpiled in edge 15
2019-05-03 23:35:28 +02:00
Pablo Navarro
16e17c560b Add missing space in error messages (#9909) 2019-04-29 19:52:13 +02:00
Nicolò Ribaudo
555d50a08c Generate missing test output 2019-04-26 23:57:06 +02:00
Babel Bot
18ace84b88 Add v7.4.4 to CHANGELOG.md [skip ci] 2019-04-26 21:06:49 +00:00
Nicolò Ribaudo
2c88694388 v7.4.4 2019-04-26 23:00:07 +02:00
Nicolò Ribaudo
4b8546c07d Force publish @babel/runtime-corejs3 [skip ci] 2019-04-26 22:58:38 +02:00
Nicolò Ribaudo
c5b5c83398 Disable "Publish to npm" in the Release workflow (#9911) [skip ci]
GitHub actions are too slow for this, it takes more than 15 mins.
Publishing to npm from GH actions is a cool idea, but it's a lot faster to
publish locally.

Also, I think that since when I introduced this action I
always killed it; either because it was to slow or because I had to
make some manual tweaks during the release.
2019-04-26 22:44:29 +02:00
Tan Li Hau
277a2620c6 allow directives and other comments before flow pragma (#9891) 2019-04-26 22:23:35 +02:00
Tan Li Hau
ca3c53ae0b fix flow-comments - class type paramters and implements (#9897) 2019-04-26 22:23:13 +02:00
Tan Li Hau
71013088ef fix flow-comment - object destructuring (#9893) 2019-04-26 22:22:41 +02:00
Nicolò Ribaudo
80a5a2e7dd Allow node 12 and test it (#9907) 2019-04-26 20:57:50 +02:00
Nicolò Ribaudo
8ca323e810 Disable chromeforandroid test in preset-env (#9906) 2019-04-26 20:57:13 +02:00
Nicolò Ribaudo
30d507c915 Add TS support to @babel/parser's Scope (#9766)
* [parser] Allow plugins to extend ScopeHandler

* Directly extend Scope

* Don't use new.target to get the ScopeHandler

* [parser] Add TS enum  support to the Scope

* Remove duplicated options in tests

* Fix

* Fix flow

* Rename tests

* Add tests

* Full typescript support in scope

* Remove BIND_SIMPLE_CATCH

SCOPE_SIMPLE_CATCH was used instead

* Export TS types

* Register function declarations

* Fix body-less functions and namespaces

1) Move this.scope.exit() for functions from parseFunctionBody to the callers.
    Otherwise the scope of body-less functions was never closed.
    Also, it is easier to track scope.exit() if it is near to scope.enter()
2) Register namespace ids for export

* Disallow redeclaration of enum with const enum
2019-04-26 14:19:53 +02:00
Jeff
293f3c98d2 Fix spelling of "Expressions" (#9896) 2019-04-26 11:57:32 +02:00
Nicolò Ribaudo
cf3668779c Always register global bindings as exportable (#9865) 2019-04-26 10:50:12 +02:00
Brian Ng
d7757f6d08 Fix TypeScript readonly error location (#9887) 2019-04-23 10:47:22 -04:00
Daniel Tschinder
bf17871b82 Fix flow types in traverse/path/family and enable flow (#9870) 2019-04-23 10:46:55 -04:00
Tan Li Hau
4198d91b89 Fix: remove constant context type check for TS (#9869) 2019-04-23 10:46:23 -04:00
Devon Govett
338853b5d3 Fix parsing typescript bodiless methods with the estree plugin also enabled (#9890) 2019-04-23 09:20:42 -05:00
Corey Farrell
8ca99b9f09 Fix: PrivateName Identifier should not be isReferenced. (#9861) 2019-04-15 22:05:16 -05:00
Samy Pessé
66be4aa5e3 Prevent JSX pragma detection in transform-typescript from leaking between files (#9798)
This PR fixes a bug in support of JSX pragma in Typescript (introduced in https://github.com/babel/babel/pull/9095).

We've noticed this bug while building a large codebase with webpack+babel+typescript. Some files from our projects are using `/** @jsx h*/` to use a custom function for JSX syntax; and some others are using the React syntax.

We've noticed that our react imports were being removed by babel because the plugin instance was being reused by `babel-loader` and webpack; and it was causing an error :

```
ReferenceError: React is not defined
```

This PR resets the `jsxPragma` being used to the initial value for each new file being processed.

I can't add a unit test for this bug because it requires processing 2 files (one with `/** @jsx something */` then one with the react syntax).

I've tested a build of this PR and it correctly fixes the issue for us.
2019-04-15 22:46:19 +02:00
Corey Farrell
f31c72f310 Fix handling of class property value this in module transforms. (#9857)
Prevent module transforms from rewriting `this` to `void 0` when found in the values of private class properties.  Add tests to prevent regressions.
2019-04-15 22:45:10 +02:00
Nicolò Ribaudo
e4072752bc Transpile babel-polyfill to es5, instead of targeting node 6 (#9812)
* Transpile babel-polyfill to es5, instead of targeting node 6

* Update babel.config.js
2019-04-15 20:01:16 +02:00
E. van der Valk
165ef29416 Fix typo in cloneNode. (#9832) 2019-04-08 08:59:57 -04:00
Ryo Ota
b4224ed8f3 Update homepage and issue link (#9826) [skip ci] 2019-04-05 13:55:05 +02:00
Henry Zhu
9f5f688385 update sponsors links [skip ci] (#9821) 2019-04-04 11:09:35 -04:00
Nicolò Ribaudo
3edd4e1a82 Update CHANGELOG.md [skip ci] 2019-04-02 21:59:20 +02:00
Babel Bot
f994d6f3ae Add v7.4.3 to CHANGELOG.md [skip ci] 2019-04-02 19:39:25 +00:00
Nicolò Ribaudo
508fde4009 v7.4.3 2019-04-02 21:36:09 +02:00
Nicolò Ribaudo
e82169dcab Enforce publish of previously missed packages (#9811)
* Fix versions of packages which haven’t been released.

* Do not ignore package.json
2019-04-02 21:19:59 +02:00
Denis Pushkarev
00cae77ec7 fix #9232, add some missed modules to noConflict (#9780) 2019-04-02 21:19:34 +02:00
Nicolò Ribaudo
e03eb17c08 [runtime-corejs3] Only polyfill instance methods when it might be needed (#9754) 2019-04-02 21:18:59 +02:00
Daniel Tschinder
9a8a7316ae Do not ignore package.json 2019-04-02 12:01:28 -07:00
Daniel Tschinder
557a8af3bc Fix versions of packages which haven’t been released. 2019-04-02 12:01:19 -07:00
Sven Sauleau
53e0622b54 Merge pull request #9808 from babel/fix-noconflict-babel-polyfill
refactor: unify polyfill with noConflict mode
2019-04-02 18:15:24 +02:00
Sven Sauleau
17e10509c0 refactor: unify polyfill with noConflict mode 2019-04-02 14:00:58 +02:00
Daniel Tschinder
491b0a8e33 Update test262 (#9806) 2019-04-01 21:47:07 -07:00
Daniel Tschinder
bac2781a20 Upgrade lodash to 4.17.11 as all the other packages (#9807) 2019-04-01 21:46:29 -07:00
Daniel Tschinder
c7587c016e Don't accept '\08' or '\09' in strict mode (#9769) 2019-04-01 19:41:50 -07:00
Andrew Anikin
123fdfd314 Fix lazy option of babel-plugin-transform-modules-commonjs (#9802)
* Fix lazy mode of babel-plugin-transform-modules-commonjs (#9447)

* Update output snapshots for lazy mode of babel-plugin-transform-modules-commonjs (#9447)
2019-04-01 07:59:12 +02:00
Mattias Buelens
3c11a4a930 Fix super method call in private instance method calling overridden method (#9801)
* Fix super method call in private instance method calling overridden method

* Change return value in test fixtures

* Update tests to verify that overridden method is not called
2019-03-31 18:50:29 -04:00
Denis Pushkarev
ae9b25ac69 Add to preset-env ES3 transforms for ES3 targets (#9781)
* add to preset-env ES3 transforms for ES3 targets

* add `transform-reserved-words`

* fix `transform-reserved-words` plugin in `@babel/standalone`
2019-03-30 23:25:12 +01:00
Moti Zilberman
1f5444e96a Destructuring: Fix handling of impure computed keys with object rest (#9416) 2019-03-26 19:11:44 -07:00
Moti Zilberman
f7bfc774ba Destructuring: Fix array unpacking assignments with holes on RHS (#9412)
This fixes an issue where destructuring assignments eligible for the "array unpacking" optimization would fail to compile when the array literal on the right-hand side of the expression contained holes.

Example input:
```js
[a, b] = [, 2];
; // Avoid completion record special case
```

The error message was `Property right of AssignmentExpression expected node to be of a type ["Expression"] but instead got null`.

Now the above code compiles to:
```js
a = void 0;
b = 2;
;
```

This PR also adds a couple of related test cases that were missing, to ensure the change doesn't regress them:
* Normal assignment expression with unpacking
* Declaration with unpacking and a hole on RHS
2019-03-27 01:14:21 +01:00
Grégoire Geis
72161a64b2 @babel/traverse: Fix NodePath.getData (#9415)
* @babel/traverse: Fix NodePath.getData

Currently, if the obtained value is `false`, it will be replaced by the given default value, which is invalid. This makes sure that we only set the default value when the value is `undefined`, instead of falsy.

* Add test and fix object protoype

* Allow false as default value
2019-03-26 16:58:38 -07:00
Daniel Tschinder
60d7e940e2 Fix merge error 2019-03-26 15:44:16 -07:00
Daniel Tschinder
6bc9e7ebda Correctly check for-in and for-of loop for invalid left-hand side (#9768)
* Correctly check for-in and for-of loop for invalid left-hand side

* Overwrite with env variable
2019-03-26 15:32:14 -07:00
Daniel Tschinder
7f4427432c Parse right-hand-side of for/of as an assignment expression (#9767) 2019-03-25 18:14:56 -07:00
Tan Li Hau
2867bbf195 [typescript] parsing template literal as type (#9748) 2019-03-25 23:21:11 +01:00
Daniel Tschinder
444daf9224 Optimize parseBindingAtom code to get better error messages (#9762) 2019-03-25 14:23:39 -07:00
Daniel Tschinder
d720c6cfff Explicit labels for tokenTypes (#9761)
* Explicit labels for tokenTypes

* Fix test

* Fix test
2019-03-25 14:23:16 -07:00
Daniel Tschinder
aaefc83a6c Allow HTML comments on first line (#9760) 2019-03-25 14:22:57 -07:00
pnowak
3aaafae053 proper feature call isLoose function #9424 2019-03-24 10:21:44 +01:00
Conrad Buck
ff04d3535c Allow coreJS Symbol to be type object (#9756) 2019-03-24 09:47:09 +01:00
Daniel Tschinder
a559397feb Move array reference into for head initializer (#9698)
* Move array reference into for head initializer

* Update packages/babel-plugin-transform-for-of/src/index.js

Co-Authored-By: danez <daniel@tschinder.de>

* Fix tests
2019-03-23 17:57:17 -07:00
Nicolò Ribaudo
d610289812 Set NPM_TOKEN in .npmrc when publishing (#9735) [skip ci]
* Set NPM_TOKEN in .npmrc when publishing [skip ci]

* Update .github/main.workflow
2019-03-24 01:04:44 +01:00
Denis Pushkarev
adb4701e00 Normalize core-js entry points (#9752)
* normalize `core-js` entry points names

* Update packages/babel-preset-env/src/polyfills/corejs3/entry-plugin.js

Co-Authored-By: zloirock <zloirock@zloirock.ru>

* handle windows paths
2019-03-24 01:03:25 +01:00
Daniel Tschinder
ef0722b4b2 Fix compatibility between estree and TS plugin (#9700) 2019-03-23 16:47:50 -07:00
Ludwig Magnusson
419d8052d3 Upgrade browserslist and caniuse in preset-env (#9747) 2019-03-22 12:38:19 -05:00
Maximilian Lackaw
998024e913 Fix wrong minimum dependency version (#9738) 2019-03-21 10:40:55 -07:00
Daniel Tschinder
596eedd3e7 Change babel-boot email 2019-03-21 10:31:52 -07:00
Babel Bot
e93cd9ff50 Add v7.4.2 to CHANGELOG.md [skip ci] 2019-03-21 09:57:37 +00:00
Nicolò Ribaudo
7dea0f23de v7.4.2 2019-03-21 10:55:50 +01:00
Nicolò Ribaudo
de7dd7f015 Mark the core-js warning as such (#9732) 2019-03-21 10:38:21 +01:00
Nicolò Ribaudo
f2c55d01c4 Create drafts instead of finished releases (#9729) [skip ci]
Currently, the "Trigger GitHub release" and "Publish to npm" actions
are run in parallel. Publishing to npm takes about 15 mins (it needs to
run `make bootstrap`), so everyone watching the npm repo for
releases would get the notification before that the new version is
available on npm.

This commit marks the automatically generated GitHub releases as draft,
which then need to be manually "finalized" by real people. This will also
avoid notifying people when for some reason a publish fails.
2019-03-21 08:26:10 +01:00
Nicolò Ribaudo
2201fd839b Modules might be in loose mode when checking for undecl exports (#9725) 2019-03-20 17:57:12 -07:00
Brian Ng
7f8ded9851 Tweak preset-env corejs/useBuiltIns warning and error messages (#9716) 2019-03-20 19:47:30 -05:00
Nicolò Ribaudo
bf94bb9d43 Fix typo in wrapRegExp helper (#9726) 2019-03-21 00:18:43 +01:00
Daniel Tschinder
ab41cb2cda Fix scope checks with enabled flow plugin (#9719) 2019-03-20 16:03:31 -07:00
Denis Pushkarev
92fcd31eac Handle object rest parameters in the corejs3-usage plugin (#9724)
Fixes #9713
2019-03-20 22:29:01 +01:00
Brian Ng
c259ec5408 Bump Babel deps (#9718) 2019-03-20 11:00:58 -05:00
Babel Bot
4cf7d0c828 Add v7.4.1 to CHANGELOG.md [skip ci] 2019-03-19 23:12:21 +00:00
Nicolò Ribaudo
94d1a5e8d7 v7.4.1 2019-03-20 00:10:54 +01:00
Nicolò Ribaudo
6402d8d58c Alias @babel/preset-env/data/built-ins.json.js (#9711)
Fixes vuejs/vue-cli#3671

Even if it has the `.js` extension, `require("@babel/preset-env/data/built-ins.json")` will still work.
2019-03-20 00:09:09 +01:00
Nicolò Ribaudo
c548e789bb Bring back isPluginRequired (#9709) 2019-03-19 23:35:13 +01:00
Babel Bot
8476cf692f Add v7.4.0 to CHANGELOG.md [skip ci] 2019-03-19 20:30:23 +00:00
Nicolò Ribaudo
f1328fb913 v7.4.0 2019-03-19 21:27:16 +01:00
Denis Pushkarev
3303b079c5 Update to core-js@3 (#7646)
### `@babel/runtime`
- Added `@babel/runtime-corejs3` package and `corejs: 3` options to `@babel/plugin-transform-runtime`.
- Added support of instance methods, fixes #8928.
- Added flag `proposals` (in `corejs: { version: 3, proposals: true }` format) for support all proposals polyfills from `core-js`.
- Used separate directories in runtime for `core-js` entry points with proposals and without.
- Used `get-iterator-method` helper for getting iterators, fixes #2500.
- As a cheap bonus, added support of IE8- (except some cases of `regenerator`).

### `@babel/polyfill`
- Should be deprecated in favor of separate usage required features from `core-js` and `regenerator-runtime` with an informative message.

### `@babel/preset-env`
- Uses for built-ins data from [`core-js-compat`](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat) instead of `compat-table` since information from `compat-table` [is not enough](https://github.com/zloirock/core-js/tree/master/packages/core-js-compat).
- `useBuilIns` now requires direct setting of `corejs` version option, without it will be used `2` by default and shown deprecation warning.
- Added support of minor `core-js` versions for simplify updating in the future.
- For preventing some order-related problems, polyfills in the both `core-js@3` plugins added on `post` stage in the order of `core-js-compat` data.
- Divided plugins and polyfills parts of `preset-env`, instead of 2 internal plugins for adding polyfills, we have 6: usage and entry versions of plugins for `core-js@2`, ### Current state:
`core-js@3`, `regenerator-runtime`.
- Added support `samsung` target (for Samsung Internet) since `core-js-compat` and `compat-table` now contains mapping for this, fixes #6602.

#### `useBuilIns: entry` with `corejs: 3`
- No longer transforms `@babel/polyfill`.
- Transforms **all possible** `core-js` entry points to import of related modules (based on data from [`core-js-compat`](https://unpkg.com/core-js-compat@3.0.0-beta.15/entries.json)).
- Since of this, we no longer need `shippedProposals` / `proposals` flags with `useBuilIns: entry`.
- Removes `regenerator-runtime/runtime` import where it's not required.

#### `useBuilIns: usage` with `corejs: 3`
- In addition to `shippedProposals`, added flag `proposals`  (in `corejs: { version: 3, proposals: true }` format) for polyfill all proposals from `core-js`.
- Fixed list of dependencies in built-in definitions.
- Improved the way of determination method / built-in name and source of this method.
- Adds import of required polyfills on `MemberExpression`, `ObjectPattern`, `in` operator.
- Adds import of required polyfills on access to global object properties.
- Adds import of all required common iterators on all syntax features which use iterators protocol (`for-of`, destructuring, spread, `yield` delegation, etc.).
- Adds import of promises on syntax features which use promises (async functions/generators, dynamic import, etc.), fixes #9250, #7402, etc.

### `core-js@2` stuff
I didn't want to tough `core-js@2`-related stuff, however
- Fixed some serious errors in definitions which breaks `Object.getOwnPropertySymbols`, `Symbol.toStringTag` logic, `Promise#finally`, `Array#forEach`, etc.
- `Array#flatMap` and trim methods moved to stable features as a part of ES2019 and loaded by deprecated `@babel/polyfill` and `@babel/preset-env` with `corejs: 2` option.
2019-03-19 21:07:45 +01:00
Nicolò Ribaudo
7df0d16131 Update main.workflow 2019-03-19 19:02:54 +01:00
Nicolò Ribaudo
f2ee84b6a3 Publish to npm using a GitHub action (#9588) 2019-03-19 18:59:35 +01:00
Mattias Buelens
60005b35e4 Update regenerator-runtime to latest version (#9442) 2019-03-19 18:46:47 +01:00
Tim McClure
e068281e28 Fix super Method Calls in Class Private Methods (#9704)
This fixes an issue with the use of super method calls in class private methods. See https://github.com/babel/babel/issues/9580 for more info re: behavior of the bug.
2019-03-19 18:43:02 +01:00
Daniel Tschinder
48d66eb648 Correctly parse TS TypeAssertions around arrow functions (#9699) 2019-03-18 22:18:47 -07:00
Nicolò Ribaudo
c285d5409e Add %%placeholders%% support to @babel/template (#9648)
This is the last step to make https://github.com/babel/babel/pull/9364 usable in Babel. I'm sorry for opening this PR so late, but I hope to get it in v7.4.

In this PR I added a new option to `@babel/template`, `syntacticPlaceholders: ?boolean`, which toggles between `%%foo%%` placeholders (when `true`) and `FOO` placeholders. If it isn't specified, Babel tries to be "smart" to avoid breaking backward compat: if `%%foo%%` is used `syntacticPlaceholders` defaults to `true`, otherwise to `false`.

0e58e252913efe84eba926cc9c9c19fb18d5c620 commit shows how some templates we used could be simplified by using this new placeholders syntax (we can't actually do it yet because we are importing `template` from `@babel/core` which could be an older version).

NOTE: Since I wanted to keep this PR as small as possible to make it easier to review, I didn't migrate `template.ast` to internally use the new syntax. It is an implementation detail, so it will be possible to change it in a patch release.
2019-03-18 21:23:10 +01:00
Daniel Tschinder
f36a6987e4 Correctly preserve reference to array in for-of loop (#9697)
* Correctly preserve reference to array in for-of loop

* Add more tests
2019-03-17 21:41:35 -07:00
Andrew Goldis
efd2ca9040 Move abstract removal ClassDeclaration > Class. (#9693)
Usage of "@babel/plugin-proposal-decorators" with legacy
support causes "abstract" keyword to be preserved.
This fixes it by moving "abstract" node property removal
from "ClassDeclaration" visitor to "Class". Resolves #8172
2019-03-17 20:44:50 +01:00
Pelle Nielsen
a35e5a314a Fix TSFunctionType visitors definition (#9692)
When traversing a tree parsing for TypeScript syntax and hitting a `TSFunctionType` node, the `typeParameters` and `typeAnnotation` fields are correctly visited but the `parameters` field isn't. As a result visitors by default don't visit `foo` below:

```
var x: (foo) => void; // foo is never visited
```
```
module.exports = function() {
  return {
    visitor: {
      Identifier(path) {
        if (path.node.name == "foo") {
          // Never hit because it's nested within TSFunctionType.parameters
          path.node.name = "bar";
        }
      }
    }
  };
}
```

It appears to be a bug in babel-types/src/definitions/typescript.js which omits `parameters` in the visitors list for `fnOrCtr`. Fixed by adding it.
2019-03-16 09:24:23 +01:00
Tan Li Hau
cc45608423 Add readonly to TypeScript type modifier (#9529)
* add readonly to TSTypeOperator

* add more test cases for readonly
2019-03-16 06:41:51 +01:00
Tan Li Hau
25a3825a1d TypeScript Constant contexts (#9534)
* Add as const fixtures

* parse constant context

* parse constant context

* quick check for literal

* code review, better error message, check array elements

* Removed unneeded test cases
2019-03-16 06:40:39 +01:00
Amir Seljubac
0a69b45126 Remove dependency on home-or-tmp package (#9678) 2019-03-13 17:20:29 -05:00
piotr
a64bf63639 [proposal-object-rest-spread] fix templateLiteral in extractNormalizedKeys (#9628)
Added additional check in extractNormalizedKeys function to handle templates differently than string.
2019-03-13 21:39:50 +01:00
Behrang Yarahmadi
29cd27b545 Partial application plugin (#9474)
* add partial application syntax and some tests

remove unnecessary error message and hasPartial function from parseNewArguments

add types for PartialExpression

Update the tests

rename PartialExpression to Partial

move Partial from expressions to types and rename to ArgumentPlaceholder

add tests for ArgumentPlaceholder in babel-generator

rename Partial to ArgumentPlaceholder

update the tests

remove alias from the type and undo changes in generated folder

adds a nice error message

better definition for the type

auto-generated files

update the conditional for allowPlaceholder message and tests

update CallExpression definition to accept ArgumentPlaceholder

change description

clean up

indent ArgumentPlaceholder entry and revert unwanted changes

* add Partial Application Plugin

* update unwrapArguments function and add replacePlaceholders.

* update the tests

* remove unnecessary clone

* update readme and description an package.json

* put options.json one level up and add test for not assigned and chained

* add await to fix the test

* use Promise in the test instead of async await

* remove unnecessary method test [#9474]

* push sequenceExpressions to an array [#9474]
2019-03-13 12:21:10 +01:00
Brian Ng
a6cb24fa1a Merge pull request #9672 from babel/deps 2019-03-12 19:22:34 -05:00
Tim McClure
81c130ffc9 Private Static Class Methods (Stage 3) (#9446) 2019-03-13 00:11:16 +01:00
Brian Ng
db669a0c6e gulp-uglify@3.0.2 2019-03-12 17:09:54 -05:00
Brian Ng
2f9c4d0045 rollup@1.6.0 2019-03-12 17:09:14 -05:00
Brian Ng
0bf6091305 eslint@5.15.1 2019-03-12 17:05:27 -05:00
Brian Ng
ad2c969097 jest@24.5.0 2019-03-12 17:03:45 -05:00
Brian Ng
b7fb71ffe2 regexpu-core@4.5.4 2019-03-12 16:55:57 -05:00
Daniel Tschinder
cf4bd8bb8d Remove input and length from state (#9646) 2019-03-11 00:42:42 -07:00
Daniel Tschinder
ec318d01fa Switch from rollup-stream to rollup and update deps (#9640) 2019-03-11 00:42:25 -07:00
Guy Bedford
a891b73401 System modules - Hoist classes like other variables (#9639) 2019-03-10 23:33:19 +01:00
Jimmy Jia
dd2ffda387 fix: Don't transpile ES2018 symbol properties (#9650)
This is a repeat of #5195 to work around the same upstream issue.
2019-03-10 23:22:59 +01:00
Daniel Tschinder
b2b96e0b15 Add WarningsToErrorsPlugin to webpack to avoid missing build problems on CI (#9647) 2019-03-07 15:44:36 -08:00
Mathias Bynens
7c909e822f Update regexpu-core dependency (#9642)
This should resolve the issue @danez mentions here:
https://github.com/babel/babel/pull/9636#issuecomment-469870217
2019-03-07 16:40:20 +01:00
Nicolò Ribaudo
15dfce33df Add placeholders support to @babel/types and @babel/generator (#9542) 2019-03-07 11:47:39 +01:00
Daniel Tschinder
095e5c0e09 Generate plugins file 2019-03-06 19:34:08 -08:00
Daniel Tschinder
fb81e8f8b4 Make babel-standalone an ESModule and enable flow (#9025)
* Make babel-standalone an ESModule and enable flow

* autogenerate plugin list

* Make config an array
2019-03-06 14:30:43 -08:00
Daniel Tschinder
d8a5329834 Reorganize token types and use a map for them (#9645) 2019-03-06 14:30:04 -08:00
Matt Tingen
e53be4b387 [TS] Allow context type annotation on getters/setters (#9641)
* Allow context type annotation on getters/setters

* Extract getAccessorsExpectedParamCount
2019-03-06 22:54:42 +01:00
Erik Arvidsson
fba5655a44 Parenthesized expressions (#8025)
* Add parser createParenthesizedExpressions option  …

When set to `true` we create `ParenthesizedExpression` nodes instead of
setting `extra.parenthesized`.

* Also update babel-parser.d.ts
2019-03-06 22:43:36 +01:00
Mathias Bynens
28c71e88e2 Fix label name 2019-03-06 11:41:03 +01:00
Daniel Tschinder
29999007f6 Disallow escape sequences in contextual keywords (#9618)
* Disallow escape sequences in async

* Disallow escape sequences in get, set and async in class

* invalid escape tests

* Update whitelist

* tests for async in parens

* Add test for invalid newline between params and arrow

* Move canInsertSemilcolon() into shouldPArseAsyncArrow
2019-03-05 17:20:36 -08:00
Mathias Bynens
349c0d4836 Update babel-plugin-proposal-unicode-property-regex for Unicode v12 (#9636)
https://github.com/tc39/ecma262/issues/1467
https://github.com/tc39/ecma262/pull/1468


Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2019-03-05 18:06:33 +01:00
Mathias Bynens
54ba6d80c0 Update identifier parsing per Unicode v12 (#9637)
https://github.com/tc39/ecma262/issues/1467
https://github.com/tc39/ecma262/pull/1468
2019-03-05 17:05:03 +01:00
Nicolò Ribaudo
d832c0f434 Add parser support for placeholders (#9364) 2019-03-05 00:45:42 +01:00
Behrang Yarahmadi
c60c4dd375 Partial Application Syntax: Stage 1 (#9343)
* add partial application syntax and some tests

* remove unnecessary error message and hasPartial function from parseNewArguments

* add types for PartialExpression

* Update the tests

* rename PartialExpression to Partial

* move Partial from expressions to types and rename to ArgumentPlaceholder

* add tests for ArgumentPlaceholder in babel-generator

* rename Partial to ArgumentPlaceholder

* update the tests

* remove alias from the type and undo changes in generated folder

* adds a nice error message

* better definition for the type

* auto-generated files

* update the conditional for allowPlaceholder message and tests

* update CallExpression definition to accept ArgumentPlaceholder

* change description

* clean up

* indent ArgumentPlaceholder entry and revert unwanted changes
2019-03-05 00:34:02 +01:00
Daniel Tschinder
37a427f692 Update dependencies (#9624) 2019-03-04 14:26:39 -08:00
Daniel Tschinder
38ef4b7467 Add editorconfig for Makefile (#9623) 2019-03-04 14:26:22 -08:00
Nicolò Ribaudo
f195daa092 Don't add params of anonymous exported function decls to the outer scope (#9613)
* Don't add params of anonymous exported function decls to the outer scope

* Test
2019-03-01 00:09:49 +01:00
Daniel Tschinder
17f4195bcc Allow any reserved word in export {} from specifiers (#9616) 2019-02-28 15:07:20 -08:00
Nicolò Ribaudo
f13f4adcbb [TS] Disallow type casts in arrow parameters (#9612) 2019-02-28 23:58:27 +01:00
Evan Henley
d72f3aa758 [plugin-transform-typescript] Strip type imports used in Enums and object types (#9605)
* fix: strip type imports used in Enums and object types

* chore: update failing snapshot

* docs: correct TSPropertySignature comment

* fix: enum value should be considered a reference

* chore: add tests for TSPropertySignature and TSEnumMember
2019-02-28 22:03:12 +01:00
Daniel Tschinder
98ab1b6428 Refactor parsing object members (#9607)
* Refactor parsing object members

* Ensure decorators on rest don’t swallow decorators silently

* Use hasPrecedingLineBreak

* Add test for async with linebreak

* Update flow whitelist
2019-02-28 11:42:12 -08:00
Daniel Tschinder
208195f425 Disallow duplicate params in methods (#9599)
* Disallow duplicate params in methods

* Fix plugins
2019-02-27 15:54:07 -08:00
Daniel Tschinder
5cb280f986 Fix scope check for 2nd+ lexical bindings (#9600) 2019-02-27 15:53:28 -08:00
Nicolò Ribaudo
9aec606c69 Don't loose "this" in helper-call-delegate (#9601) 2019-02-28 00:34:48 +01:00
Nicolò Ribaudo
5c8cc0d536 Mark FOO in "var { x: FOO }˝ as a binding, not as a reference (#9492) 2019-02-27 00:17:11 +01:00
Daniel Tschinder
43eed1ac92 Check exported bindings are defined (#9589)
* Check exported bindings are defined

* Add tests

* Update flow whitelist

* Add tests for builtins
2019-02-26 13:28:10 -08:00
Sven Sauleau
e883ff295d Merge pull request #9597 from danez/Update-charcodes
Update charcodes
2019-02-26 22:17:59 +01:00
Daniel Tschinder
c1e51e08d3 Update charcodes 2019-02-26 12:29:10 -08:00
Justin Ridgewell
039a74a8b9 preset-env: minimally supporting version (#9596)
* preset-env: minimally supporting version

This changes the "does browser support X" algorithm to "lowest version such that all higher versions support it".

Eg, given `{ chrome70: true, chrome60: false, chrome50: true }`, the lowest version is chrome70, not chrome50.

This is done to remove Tagged Template Literal support from Safari, which introduced a bug in Safari 12 but correctly implemented the feature in Safari 11-9.

* Add tests

* Fix tests

* Fix comment
2019-02-26 15:18:52 -05:00
Nicolò Ribaudo
a029071b8f [TS] Correctly forget awaits after parsing async arrows with type args (#9593) 2019-02-26 20:35:18 +01:00
Daniel Tschinder
244e4580e9 Remove always false param allowExpressionBody (#9591) 2019-02-26 11:15:34 -08:00
Justin Ridgewell
e1ff4c47b9 preset-env: Sort versions before determining lowest (#9595)
Likely because of implicit `equals` (ie, Safari 12 support implies iOS Safari 12), the versions in the `res` hash are not always sorted in version order.

Doing a semver sort reveals some builtins have actually been supported a little longer than we thought!
2019-02-26 11:11:49 -08:00
Nicolò Ribaudo
0345c1bc1d Use for..of Object.keys instead of for..in (#9518)
In https://github.com/babel/babel/issues/9511 (and #9495 is another symptom), @PavelKastornyy reported a node crash becaue the JavaScript heap run out of memory. The problem was that their code was adding enumerable properties to `Object.prototype`: it is something that shouldn't be done, but Babel shouldn't make node crash if someone adds them.
I reduced down the problem to `for...in` loops in `@babel/traverse` that grew the memory consumption exponentially because of that unexpected properties.
2019-02-26 20:09:02 +01:00
Brian Ng
f1ab6120d2 Bump Babel deps (#9590) 2019-02-26 11:21:00 -06:00
Florian Adonis
8f26f6df83 change var name for coherence (#9579) 2019-02-26 09:05:43 -06:00
Daniel Tschinder
d0e196d210 Treat for loop body as part of loop scope (#9586) 2019-02-25 18:30:51 -08:00
Daniel Tschinder
e6c1065d19 Fix strict mode prescanning with EmptyStatement (#9585) 2019-02-25 15:20:05 -08:00
Daniel Tschinder
45c96908e9 Update test262 (#9587)
* Update test262

* Also remove unrecognized tests from the whitelist
2019-02-25 15:10:48 -08:00
Brian Ng
434fd32c90 Update esm and electron mappings in preset-env (#9573) 2019-02-25 16:51:38 -06:00
Nicolò Ribaudo
0e3968124c Remove unused file (eslint-local-rules.js) (#9583) 2019-02-25 21:51:17 +01:00
Daniel Tschinder
632552f55d Minify bundles on circle for repl (#9582) 2019-02-25 11:52:40 -08:00
Daniel Tschinder
a7391144b3 Introduce scope tracking in the parser (#9493)
* Introduce scope tracking

* Fix tests

* Add new tests

* Remove constructor-super check from transform as it is now in parser

* Correctly handle class properties and class scope

* Fix duplicate name check

* Convert scope identifier storage to array

* Enter a new scope in typescript module blocks

* Add test for duplicate declaration

* Rename error for duplicate exports

* Treat class declarations as lexical declaration

* Update whitelist

* Add tests

* Fix scope tracking for function declarations

* Migrate try-catch duplicate error

* Fix test

* More tests

* One more test

* Make scope a separate class and fix review comments

* Do not allow new.target in top scope arrow function

* Correctly enter new scope for declare module and treat type aliases as lexical declarations

* Tests for typescript scope tracking to not mark type aliases as duplicate

* Fix flow scope tracking

* Remove ident from test names as redundant

* Add test case for var and function

* Improve error messages

* Improve literal regex
2019-02-25 11:04:52 -08:00
Babel Bot
918f149a63 Add v7.3.4 to CHANGELOG.md [skip ci] 2019-02-25 18:37:14 +00:00
Nicolò Ribaudo
1f6454cc90 v7.3.4 2019-02-25 19:29:12 +01:00
Nicolò Ribaudo
4540f2653b Update CHAMGELOG.md using the "Trigger GitHub release" action (#9561)
Update CHANGELOG.md using the "Trigger GitHub release" action
2019-02-25 19:18:44 +01:00
Justin Ridgewell
fc1ea7f496 Revert "Parenthesized expressions (#8025)"
This reverts commit dd8b700a2c.
2019-02-25 19:03:00 +01:00
Barthélémy Ledoux
9f3457797f Fix TypeScript parsers missing token check (#9571) (#9572)
* Fix TypeScript parsers missing token check (#9571)

* fix unit test
2019-02-24 13:34:38 +01:00
Nicolò Ribaudo
0b01b5217b Use correct "this" in static fields (#9508) 2019-02-24 08:14:49 +01:00
Denis Pushkarev
cade33c647 Update compat-table (#9566)
fix #9465
2019-02-23 12:47:43 +01:00
Erik Arvidsson
dd8b700a2c Parenthesized expressions (#8025)
* Add parser createParenthesizedExpressions option  …

When set to `true` we create `ParenthesizedExpression` nodes instead of
setting `extra.parenthesized`.

* Also update babel-parser.d.ts
2019-02-23 02:45:25 -05:00
Ian Craig
417e72ebfd Fix flow and TS types of babel-types is* type checks to accept null | undefined (#9539)
* babel-types is* type checks accept null | undefiend as value TS type

* Use | null | undefined instead of any, make Flow type nullable

* Also change flow types of generated src
2019-02-22 01:48:27 -08:00
Nicolò Ribaudo
b8d045f5cf Update regenerator-transform (#9558) 2019-02-21 23:24:31 +01:00
Jacob Clark
879a59085b Pull in chokidar 2.0.4 to pull in patched braces (#9550)
chokidar 2.0.3 pulled in an older version of braces which is vulnerable to https://www.npmjs.com/advisories/786, this upgrades chokidar up a patch version where its dependencies have been updated resolving this vulnerability.
2019-02-20 15:07:24 +01:00
Daniel Tschinder
b32d271fee Migrate some duplicate binding tests to traverse (#9532)
* Migrate try-catch duplicate error

* Remove exception for functions and let in the same scope

* Migrate duplicate bindings tests to traverse

* Add test for subscope and let/const

* Add more test cases
2019-02-19 21:25:49 -08:00
Nicolò Ribaudo
21eb0837e8 Update CHANGELOG.md [skip ci] 2019-02-19 23:50:22 +01:00
Daniel Tschinder
b78fdc0cb1 chore: Enable eqeqeq rule in eslint (#9541) 2019-02-18 21:16:42 -08:00
Daniel Tschinder
a1ea765b95 Make tests spec compliant and avoid duplicate declarations in input files (#9522) 2019-02-18 16:14:35 -08:00
Nicolò Ribaudo
39af228ac4 Add import/no-extraneous-dependencies to ESLint (#9533) 2019-02-19 00:48:19 +01:00
Sven Sauleau
7c0549a923 Merge pull request #9536 from irohitb/patch-1
Update SONG.md
2019-02-18 20:56:59 +01:00
Tim McClure
f44b29522c Remove transform-classes from priv method tests (#9537) 2019-02-18 19:57:29 +01:00
Rohit Bhatia
682534e475 Update SONG.md 2019-02-18 23:28:26 +05:30
Tan Li Hau
bbb4d7b6d7 Fix typescript generator params (#9524)
* Fix typescript generator params

* add TSOptionalType, TSRestType, add more test
2019-02-18 08:22:22 +01:00
Tan Li Hau
5bb1bb080f Fix flow babel-generator function parantheses (#9523) 2019-02-18 00:17:52 +01:00
Daniel Tschinder
058f057426 Also check AssignmentPatterns for export name (#9521) 2019-02-15 22:55:03 -08:00
Nicolò Ribaudo
d1fe2d05f4 v7.3.3 2019-02-15 22:06:01 +01:00
Simon Adcock
b9a3806f9e Upgrade to @babel/preset-typescript to use @babel/plugin-transform-typescript@^7.3.2 (#9497) [skip ci]
Bumps to 7.3.2 the version of `@babel/plugin-transform-typescript` used by `@babel/preset-typescript`.

This allows us to use `@babel/preset-typescript` and pick up at least one useful bug fix (#9095).

A similar PR (#9181) was closed as it bumped to a version that didn't have changes. However reading the comments from that PR, I get the sense that bumping the version in this manner should not be necessary, and should be handled by Lerna. Is this correct?

Please let me know if I can make any improvements to this PR, the description or if there's anything else I can do to help.
2019-02-15 21:59:21 +01:00
Nicolò Ribaudo
b25fea49fe Create a new release after a v*.*.* commit instead of the tag (#9470)
* Create a new release after a v*.*.* commit instead of the tag

* Fix bugs

* Avoid matching things like "v2"
2019-02-15 21:42:51 +01:00
Nicolò Ribaudo
83cbc11d46 Correctly output escapes in directives (#9501) 2019-02-15 21:08:45 +01:00
Daniel Tschinder
0f685d9b42 Only allow Identifiers, Patterns and Rest in parameters of FunctionDeclarations 2019-02-15 12:49:36 +01:00
Nicolò Ribaudo
d86b831364 Add duplicate-package-checker-webpack-plugin (#9517)
We are duplicating semver. It's such a small package that I don't think that it is worth spending much time trying to understand why.
2019-02-15 12:28:00 +01:00
Nicolò Ribaudo
0050266a50 Add missing dependencies (#9516) 2019-02-15 08:50:32 +01:00
Nicolò Ribaudo
b6300a0869 Add importKind to ImportDeclaration in babel/types 2019-02-14 21:53:29 +01:00
Daniel Tschinder
4ba998c5db Add importKind to spec 2019-02-14 21:53:29 +01:00
Nicolò Ribaudo
2fb1f9aed3 Add tests for options to babel-node (#9510) 2019-02-14 13:43:30 +01:00
Alec
85ea5b0b50 Version bump of lodash (#9500)
https://tools.cisco.com/security/center/viewAlert.x?alertId=59546
2019-02-13 16:17:39 +01:00
Daniel Tschinder
d349b74a4f Better error output in parser tests (#9491) 2019-02-11 02:13:24 -08:00
Nicolò Ribaudo
3a9743fce4 Show real version instead of core/preset-env versions in standalone pkgs (#9467) 2019-02-09 17:29:45 +01:00
Daniel Tschinder
2817844e89 Fix regression with let (#9477)
* Fix corner cases with let

* Handle generators correctly

* Fix flow plugin

* Fix typescript plugin
2019-02-08 13:36:37 -08:00
Daniel Tschinder
7943a48cc3 Update flow to 0.92.1 and fix related issues (#9468)
* Update flow to 0.92.1 and fix related issues

* Change isThenable check
2019-02-08 13:27:11 -08:00
Nicolò Ribaudo
953182d44a Exclude generate @babel/types files from coverage report (#9469) 2019-02-08 22:25:19 +01:00
Rubén Norte
045d019149 Fix duplicated assertThisInitialized calls in constructors (#9458) 2019-02-07 23:01:46 +01:00
Downpooooour
d1514f57bd Typescript function destructured params (#9431)
* fix typescript funtion destructured params for array

* update type name
2019-02-07 22:59:50 +01:00
Nicolò Ribaudo
fdb65ab8b1 Update publishing command (#9466) [skip ci]
This reflects how I have been releasing the last versions (https://github.com/babel/notes/issues/78#issuecomment-449519007).

In the future, we'll only need to run `make new-version && git push --tags` and it will run `make publish` from CI/Actions.


Co-authored-by: Henry Zhu <hi@henryzoo.com>
2019-02-07 22:15:45 +01:00
Daniel Tschinder
81123fb972 Fix typo in comment 2019-02-06 15:12:35 -08:00
Ilya Lesik
738060ebfa Fix support for Flow's DeclareClass type parameters (#9459) 2019-02-06 08:18:07 -06:00
Brian Ng
07b0f22a3f Fix range for TypeScript optional parameter in arrow function (#9463) 2019-02-06 08:17:32 -06:00
Yifei Fu
e03e5ba01d Add TypeScript definitions for parser plugin options. (#9457) 2019-02-06 10:03:54 +01:00
Nicolò Ribaudo
d896ce2b53 v7.3.2 2019-02-04 23:20:05 +01:00
Nicolò Ribaudo
44d8a59361 Use a GitHub Action to generate the changelog (#9434) [skip ci]
* Use a GitHub Action to generate the changelog

* Update main.workflow [skip ci]
2019-02-04 22:15:44 +01:00
Daniel Tschinder
344d35bbe9 Simplify await and yield tracking in params (#9405) 2019-02-04 22:01:17 +01:00
Thiago Arrais
fe71154626 Support for await and yield in pipelines (#9401) 2019-02-04 21:58:46 +01:00
gverni
65cbbc1ef8 Fix duplicate definition error in private class methods (#9453) 2019-02-04 09:19:04 -06:00
Nicolò Ribaudo
d37c958637 Transform private async and generator functions (#9423) 2019-02-04 15:10:46 +01:00
Daniel Tschinder
9eb010da50 Unify reserved word checking and update error messages (#9402)
* Unify reserved word checking and update error messages

* Fix test
2019-01-31 19:02:32 -08:00
Galymzhan Abdugalimov
7e9029e337 Switched gutil.log to fancyLog due to deprecation (#9432) 2019-01-30 08:23:02 -06:00
Galymzhan Abdugalimov
00c3e3c8e0 Fixed link to @babel/parser's issues in README (#9427) 2019-01-30 08:18:43 -06:00
Nicolò Ribaudo
7192546eb8 Run prettier again 2019-01-30 11:35:42 +01:00
Nicolò Ribaudo
4c4c22a316 Run prettier 2019-01-30 11:30:31 +01:00
Rizky
56044c7851 install polyfill & runtime to dependency instead of devDependency [skip ci] (#9409) 2019-01-29 08:09:08 -06:00
Daniel Tschinder
828169e611 Fix line continuation with Unicode line terminators (#9403) 2019-01-28 13:35:35 -08:00
Moti Zilberman
1452e977a0 Destructuring: Create assignments from ForX non-declaration patterns (#9414) 2019-01-28 09:50:24 +01:00
Brian Ng
ede69eef7f Bump deps (#9417) 2019-01-26 22:49:48 -05:00
Dylan Staley
03230eaa9c Retain JSX pragma if defined as a comment (#9095) 2019-01-26 15:36:10 -06:00
Brian Ng
7dc157f9be Fix location/range on TypeScript ExportNamedDeclarations (#9406) 2019-01-24 19:44:22 -06:00
Yuri Karadzhov
854313a759 Correctly visit param decorators to prevent their imports being removed in typescript transform (#8738)
* Remove types on program exit in typescript transform

* Revert changes to typescript transform

* Correctly add visitors for param decorators

* Fix plugin for node 6
2019-01-24 15:07:56 -08:00
Daniel Tschinder
46ba5940c2 Make yield a contextual keyword (#9400) 2019-01-23 14:33:23 -08:00
Daniel Tschinder
42c5d3fc4b Correctly fail for invalid yield in for (#9398) 2019-01-23 13:39:30 -08:00
Brian Ng
d4e045ac24 Fix support for Flow's QualifiedTypeIdentifier (#9396) 2019-01-23 15:19:17 -06:00
Daniel Tschinder
8bc9f9a05f fix: Allow toplevel await when option true and correctly mark await keyword as unexpected (#9371) 2019-01-22 14:56:30 -08:00
Daniel Tschinder
93e1b5e612 Merge pull request #9375 from danez/contextual-let
Make let a contextual keyword
2019-01-22 14:55:49 -08:00
Daniel Tschinder
4f69699b71 Fix parsing in non-declaration places 2019-01-22 13:12:03 -08:00
Daniel Tschinder
f4f5ca2aaa Parse class name in strict mode
The specification defines that the whole class declaration is parsed in strict mode
2019-01-22 13:12:03 -08:00
Daniel Tschinder
8071dca9ad Disallow const let or let let 2019-01-22 13:12:02 -08:00
Daniel Tschinder
178f2d7949 Make let a contextual keyword 2019-01-22 13:12:02 -08:00
Nicolò Ribaudo
65febdd13a Refactor import and export parsing (#9326)
* [parser] Refactor import parsing

* [parser] Refactor export parsing

* Fix types
2019-01-22 19:52:56 +01:00
Brian Ng
f77c450cda Bump prettier (#9373) 2019-01-22 09:16:32 -06:00
Nicolò Ribaudo
f2af6c1170 v7.3.1 2019-01-22 08:07:23 +01:00
Daniel Tschinder
43b83f8ed7 Revert "Differentiate object spread and non-spread properties (#9341)" (#9379)
This reverts commit 3ae5e79ec8.
2019-01-21 23:03:54 -08:00
Daniel Tschinder
af88e63dff fix new keyword broken by recent refactoring (#9377) 2019-01-21 22:25:37 -08:00
Nicolò Ribaudo
f6ee26c3da v7.3.0 2019-01-21 22:22:39 +01:00
Tim McClure
e8de6fa5d4 Private Class Methods Stage 3: Private Accessors (#9101)
* Add accessor loose support

* Add private accessors spec support

* Fix private dupe name check

* Changes from code review

* Add duplicated names tests

* Add get/set-only tests

* Move accessors tests

* Split out updates tests

* Add helper change tests

* Update test output

* Update test options
2019-01-21 22:05:37 +01:00
Kagami Sascha Rosylight
3ae5e79ec8 Differentiate object spread and non-spread properties (#9341)
* add isSpread field

* use argument

* t.booleanLiteral

* fix typo

* push empty-argument object

* .object

* .value

* object field should be an expression

* lint

* update outputs

* isSpread for the second argument is redundant

* add test

* alternating spread
2019-01-21 22:04:47 +01:00
Thiago Arrais
e9331aa0c0 Transform for the smart pipeline operator proposal (#9179) 2019-01-21 22:04:14 +01:00
Henry Zhu
ba4141934f add v7 downloads [skip ci] (#9370) 2019-01-21 12:48:15 -05:00
Daniel Tschinder
96a7343142 Merge pull request #9348 from danez/perf
Parser Performance Collection
2019-01-21 02:27:42 -08:00
Armano
a2e6d8e968 Disallow usage of invalid keyword after export abstract statement in Typescript (#9336) 2019-01-19 15:48:05 -06:00
Nicolò Ribaudo
4ce37b7aca Update test262 sha (#9365) 2019-01-19 18:10:28 +01:00
Brian Ng
b92ad318f1 Add support for transform-named-capturing-groups-regex in preset-env (#9345) 2019-01-17 19:51:38 -06:00
Daniel Tschinder
2d6231fd3d Update flow whitelist 2019-01-17 16:16:32 -08:00
Daniel Tschinder
4e5e319d5b perf: remove double check for keywords in readWord
Instead of calling isKeyword we simple check directly if the keyword token is available
2019-01-17 16:16:31 -08:00
Daniel Tschinder
b66d921053 perf: Use === or Set.has instead of array.indexOf for keyword checks 2019-01-17 16:16:30 -08:00
Daniel Tschinder
f12905b531 perf: Use for loops while cloning classes 2019-01-17 16:16:29 -08:00
Daniel Tschinder
f216975378 perf: call isLineTerminator as last check 2019-01-17 16:16:28 -08:00
Daniel Tschinder
3a3d5cbe9c perf: Check for plugin only once before looping 2019-01-17 16:16:28 -08:00
Daniel Tschinder
10555c719e Build the parser also for node 6.9 and up 2019-01-17 16:16:27 -08:00
Daniel Tschinder
58768072ef perf: Ensure canInsertSemicolon is always called last
It does a lot of checks and a regex test
2019-01-17 16:16:26 -08:00
Daniel Tschinder
455e003567 perf: Optimize regex
This saves some steps, as the regex parser does not have to backtrack for character classes, but is has to for alternates
2019-01-17 16:15:07 -08:00
Daniel Tschinder
49f7bcf271 perf: Remove unnecessary check for flow plugin inside of flow plugin 2019-01-17 16:15:07 -08:00
Daniel Tschinder
c2e41588aa perf: run flow code in flow plugin 2019-01-17 16:15:05 -08:00
Daniel Tschinder
a1eac37bd2 Generate prettier comments 2019-01-17 16:15:04 -08:00
Daniel Tschinder
0370af58f1 perf: Use strict equals 2019-01-17 16:15:03 -08:00
Daniel Tschinder
8df0500f55 perf: Simplify reading of tokens.
This avoids checking isIdentifierStart for every single token
2019-01-17 16:15:01 -08:00
Daniel Tschinder
e4b8cfc768 perf: use Set instead of string indexOf 2019-01-17 16:15:00 -08:00
Daniel Tschinder
a7757ec4d0 perf: Use increment operator 2019-01-17 16:14:58 -08:00
Daniel Tschinder
25a8db2a29 perf: use normal equality check in stead of indexOf 2019-01-17 16:14:57 -08:00
Daniel Tschinder
48fd387779 perf: precalculate length 2019-01-17 16:14:56 -08:00
Daniel Tschinder
59c4bbb4ab perf: Make plugins a map instead of object
Fix plugin options
2019-01-17 16:14:55 -08:00
Daniel Tschinder
2dc1c91955 perf: Move input to state and precalculate length
This also fixes a bug with async functions
2019-01-17 16:14:54 -08:00
Daniel Tschinder
ae154c86ed perf: Minor optimizations 2019-01-17 16:14:53 -08:00
unconfident
e9588061d7 Copy "optional" property when cloning Identifier node (#9333)
Fixes #9331
2019-01-17 17:12:16 -05:00
Nicolò Ribaudo
0a88230ec4 Disallow async functions as loop bodies (#9314) 2019-01-17 17:07:48 -05:00
Nicolò Ribaudo
a27b9b4299 Add @babel/plugin-transform-named-capturing-groups-regex (#7105)
When the `runtime` flag is on (by default), this plugin adds a new helper which wraps the native `RegExp` class to provide groups support. People nees to use a polyfill (I implemented it in core-js) for browsers that don't support ES6 regexps.
2019-01-15 18:21:17 +01:00
Brian Ng
aaec2cd51d Fix handling newline with TypeScript declare and abstract classes (#9328) 2019-01-15 06:56:52 -06:00
Brian Ng
34c9890f41 Fix range on TypeScript index signature parameters (#9335) 2019-01-15 06:52:33 -06:00
Armano
e8038863c3 Fix range on TypeScript this type predicate (#9339) 2019-01-15 10:35:49 +01:00
Nicolò Ribaudo
694e3fd8cf Merge declaration and init of props in parser's state (#9312)
* Merge declaration and init of props in parser's state

* Move type def
2019-01-13 23:54:44 +01:00
Brian Ng
40ae6568a4 Add support for proposal-json-strings in preset-env (#9323) 2019-01-13 08:32:33 -06:00
Henry Zhu
4944e9e180 update sponsor link again [skip ci] 2019-01-13 08:00:46 -05:00
Nicolò Ribaudo
a24206eb96 Fix error for decorators not enabled (#9321)
* Fix error for decorators not enabled

* Update error message
2019-01-13 00:35:22 +01:00
Henry Zhu
d6b4ab75ee fix sponsor link [skip ci] 2019-01-12 10:41:49 -05:00
Nicolò Ribaudo
3e4b608a80 Parse class heritage as strict mode code (#9315) 2019-01-12 14:54:23 +01:00
Henry Zhu
28319eb07e add sponsor [skip ci] 2019-01-11 13:50:48 -05:00
Nicolò Ribaudo
5889620a6a Disallow new import(x) and import(x,) (#9313)
* Disallow "new import(...)"

* Disallow trailing comma inside dynamic import

* Rename test

* Update error message
2019-01-11 18:59:51 +01:00
Nicolò Ribaudo
9764718c32 Disallow trailing comma after rest (#9311)
* Add new tests

* Use state instead of param and disallow comma in [...a,]=[]

* Unify error messages

* Object destructuring

* Update whitelist
2019-01-11 13:08:38 +01:00
Nicolò Ribaudo
28b70e5910 Generate types for TSImportType 2019-01-11 11:46:15 +01:00
Henry Zhu
4c2f8d9337 @babel/generator: Add emit and builder for TSImportType (#9309) 2019-01-10 13:57:00 -05:00
Armano
2cc0376756 @babel/parser(ts): Add parsing of type import (#9302) 2019-01-10 11:14:48 -05:00
Nicolò Ribaudo
8e051cae46 [decorators] Set method names at compile time instead of at runtime (#9244) 2019-01-10 00:45:02 +01:00
Cameron Martin
778a61a3c2 [@babel/types] Moved generators related to babel-types into the babel-types package directory. (#9245) 2019-01-09 00:14:31 +01:00
Armano
46e3f6df1f @babel/parser: include leading character into range of generic ArrowFunctionExpression (#9295) 2019-01-08 07:19:55 -06:00
Brian Ng
03022d169e Throw error if TypeScript class has empty implements (#9292) 2019-01-07 15:27:27 -06:00
David Laban
9803253363 flow type update: babel-types.isType(?string, string): boolean (#9275) 2019-01-07 08:53:01 -06:00
Brian Ng
a55382e4ad Test262 update (#9288) 2019-01-07 08:52:36 -06:00
Sven Sauleau
b211b810d1 Use 2014-present in license (#9290) 2019-01-07 08:52:11 -06:00
James George
25e880d355 Add follow on twitter badge (#9264) [skip ci] 2019-01-07 09:49:20 -05:00
Daniel Tschinder
e43777bb5f Fix location for typescript type assertions in AST (#9284) 2019-01-06 16:39:14 -08:00
Nicolò Ribaudo
efc60a1703 Add test sources to prettierignore (#9287) [skip ci] 2019-01-06 20:59:02 +01:00
Daniel Tschinder
54f072991d Revert "Revert babel-helper-builder-react-jsx change from #4988" (#9119)
This reverts commit dbc07220ae.

# Conflicts:
#	packages/babel-helper-builder-react-jsx/src/index.js
2019-01-05 22:22:49 -08:00
Brian Ng
a58893d1e3 Ensure modifiers are included in TSParameterProperty ranges (#9276) 2019-01-04 10:02:09 -06:00
Nicolò Ribaudo
865eb93c2d [private methods] Define private methods before executing initializers (#9248) 2019-01-03 20:33:44 +01:00
Berlam Henderson
49f52bbcb3 Bump license years for 2019 (#9271) 2019-01-03 09:12:03 -06:00
Nicolò Ribaudo
9d1d0fe57a Add mixins support to the _decorate helper (#9166) 2018-12-29 22:54:30 +01:00
Brian Ng
ea1c436ea1 Fix handling scoped packages in preset-env include/exclude options (#9219) 2018-12-27 09:54:28 -06:00
David Laban
3f9a1c08cc Add tests for babel-types.isType (#9243) 2018-12-27 12:49:34 +01:00
J. S. Choi
c586d4e8ca parser, smart pipes: Add support for yield in pipeline bodies
Fixes #9178.
2018-12-23 17:09:18 +01:00
J. S. Choi
60ffe1d103 parser, smart pipes: Add test for async–await 2018-12-23 17:09:18 +01:00
Armano
b5177ce290 babel-parser: typescript: add missing bigint keyword (#9230) 2018-12-22 17:18:32 -06:00
Henry Zhu
d1aa665657 update sponsors [skip ci] 2018-12-21 21:39:06 -05:00
Nicolò Ribaudo
f130981546 v7.2.5 2018-12-21 23:32:48 +01:00
Nicolò Ribaudo
bc347bab7a Add @babel/helpers to devDependencies of runtime and runtime-corejs2 (#9222) 2018-12-21 10:08:47 +01:00
Nicolò Ribaudo
21228abfde v7.2.4 2018-12-20 13:08:41 +01:00
Nicolò Ribaudo
e417437355 Minify standalone 2018-12-20 12:50:41 +01:00
Nicolò Ribaudo
0bb720401b v7.2.3 2018-12-20 12:18:31 +01:00
Nicolò Ribaudo
d35f2ad92b Update lerna to v3.6.0
Use forked @lerna/collect-updates to prevent publishing of dependents:
this is the same as Lerna 2's --dangerously-only-publish-explicit-etc option.
2018-12-20 11:46:56 +01:00
Nicolò Ribaudo
57759cb1a1 [lerna] Don't ignore .json data files in preset-env (#9200) 2018-12-20 11:43:40 +01:00
Cameron Martin
9e95da4eaa Added type-level mapping between aliases and nodes that have that alias. (#9110) 2018-12-19 10:57:27 +01:00
Nicolò Ribaudo
911c2d0bf4 Use @babel/eslint-plugin-developement (#9206) 2018-12-18 22:59:43 +01:00
cphamlet
116ca22def Minor typo for -f flag in cli (#9201) 2018-12-17 19:29:23 -08:00
Tan Li Hau
52fb884550 Strips flow directive fully (#9197) 2018-12-17 09:27:56 +01:00
Daniel Tschinder
5cb38995c0 Allow keywords to be used in type annotations (#9184) 2018-12-15 12:51:24 -08:00
Andy Edwards
3c8e15dbc1 don't throw classNameTDZError if referenced identifier is within a TypeAnnotation (#9190)
fix #9189

Obviously this code is intended to throw an error if someone tries to reference a class before it's defined, like:
```js
class Foo {
  someField = Foo;
}
```
But there's no problem with referencing the class in a type annotation before it's defined, and this is often necessary for tree structures:
```js
class Foo {
  [someSymbol]: Foo;
}
```
2018-12-15 15:16:43 +01:00
Nicolò Ribaudo
c1499b13ac v7.2.2 2018-12-15 10:59:56 +01:00
Nicolò Ribaudo
7bcd62cfee Build standalone on prepublish 2018-12-15 10:52:23 +01:00
Daniel Tschinder
47da5cf75a Correctly transform spreads to use proper concat method (#9108)
* Correctly transform spreads to use proper concat method

* Add tests to ensure array spread clones elements
2018-12-13 23:24:43 -08:00
Vikram Rangaraj
72471aff63 Handle flow comments with leading spaces (#9168)
* check for spaces and tabs before a flow comment

* fix issue with using string index and shift interchangably

* update tests

* Use update charcodes version

* Disallow flow-comments in flow-comments and check for unterminated comments
2018-12-13 22:10:01 -08:00
Patrick Eriksson
b9340bc597 Fix package.json repository URLs (#9176) 2018-12-13 21:15:40 +01:00
Thiago Arrais
731182eee4 Types for pipeline operator (smart proposal) (#9122) 2018-12-13 06:58:58 +01:00
Daniel Tschinder
f4eec5ca79 Add new flag that indicates if a module has exports (#9171) 2018-12-12 21:24:44 -08:00
Nicolò Ribaudo
b60adce4cb Update CHANGELOG.md 2018-12-12 23:56:33 +01:00
Henry Zhu
66c4bc8f64 update list of sponsors [skip ci] 2018-12-12 16:07:49 -05:00
Daniel Tschinder
d2dc28ed2b add triage label to new issues [skip ci] (#9158) 2018-12-12 10:23:54 -08:00
Brian Ng
0514a9f903 Update v7 regression issue template link (#9157) 2018-12-10 12:00:52 -06:00
Nicolò Ribaudo
d1d3c823cc Move decorators transform to @babel/helper-create-class-features-plugin (#9059)
* Move decorators to @babel/plugin-class-features

* Minor refactoring

* Use the new helper package
2018-12-09 12:30:25 +01:00
Nicolò Ribaudo
9b005dedfd Fix --root-mode option in babel-node (#9148) 2018-12-07 22:47:56 +01:00
Rubén Norte
4fdb71151f Inherit properties in function from method in loose mode (#9135) 2018-12-07 15:57:48 +01:00
Brian Ng
f611bb016b Bump Babel deps (#9145) 2018-12-07 08:55:06 -06:00
Kagami Sascha Rosylight
4dff205dc1 Disable parameter-destructuring in Edge 18 (#9140) 2018-12-07 08:14:08 -06:00
Kagami Sascha Rosylight
72fd2d192c Add missing colon to issue template (#9143) 2018-12-07 13:32:36 +01:00
Daniel Tschinder
35815832b5 Move to travis vm based builds (#9133) 2018-12-05 15:02:37 -08:00
Daniel Tschinder
9c45b8faf7 Ensure we always use local versions of babel dependencies in tests (#9132) 2018-12-05 14:14:16 -08:00
Daniel Tschinder
ca2918ab13 Test local version of babel/types 2018-12-05 13:34:36 -08:00
Daniel Tschinder
d915f31bcb Add tests for createTypeAnnotationBasedOnTypeof 2018-12-05 13:24:55 -08:00
Daniel Tschinder
4ca35ef8b9 Fix running flow on travis and update flow (#9128)
* Fix running flow on travis and update flow

- ensure bootstrap is run before running flow as we need some generated files for correctly doing typechecks
- ensure that we only ignore the build directory inside the babel folder as currently we ignore everything because travis checks out into ‘/home/travis/build/’

* Fix all flow errors
2018-12-05 12:30:30 -08:00
Henry Zhu
4b73818c87 Update issue templates [skip ci] (#9131) 2018-12-05 13:58:53 -05:00
Joel Denning
d305419da6 Not depending on return value of super(). Fixes #9020. (#9060)
* Not depending on return value of super(). Fixes #9020.

* Feedback from nicolo-ribaudo

* Feedback -- fixing bad call to replaceWithMultiple
2018-12-04 21:50:17 +01:00
Nicolò Ribaudo
8b132c0889 v7.2.1 2018-12-04 16:21:47 +01:00
Nicolò Ribaudo
b927fb2a7e Don't use isClassPrivateMethod because is isn't supported in <7.2.0 (#9121) 2018-12-04 08:35:10 +01:00
3460 changed files with 91875 additions and 19131 deletions

View File

@@ -34,7 +34,7 @@ jobs:
build:
working_directory: ~/babel
docker:
- image: circleci/node:11
- image: circleci/node:12
steps:
- checkout
- restore-cache: *restore-yarn-cache
@@ -42,7 +42,7 @@ jobs:
- run: yarn --version
- run: make test-ci-coverage
# Builds babel-standalone with the regular Babel config
- run: make build
- run: IS_PUBLISH=true make build
# test-ci-coverage doesn't test babel-standalone, as trying to gather coverage
# data for a JS file that's several megabytes large is bound to fail. Here,
# we just run the babel-standalone test separately.

View File

@@ -10,5 +10,8 @@ end_of_line = lf
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab
[*.{md,markdown}]
trim_trailing_whitespace = false

View File

@@ -5,8 +5,8 @@ package.json
lerna.json
packages/babel-runtime
!packages/babel-plugin-transform-runtime/scripts
!packages/babel-runtime-corejs2/core-js.js
packages/babel-runtime-corejs2
packages/babel-runtime-corejs3
packages/*/node_modules
packages/*/lib
packages/*/dist

View File

@@ -1,7 +1,7 @@
{
"root": true,
"plugins": ["prettier", "@babel/development", "import"],
"extends": "babel",
"plugins": ["local-rules", "prettier"],
"rules": {
"prettier/prettier": "error"
},
@@ -12,8 +12,10 @@
{
"files": ["packages/*/src/**/*.js", "codemods/*/src/**/*.js"],
"rules": {
"local-rules/no-undefined-identifier": "error",
"local-rules/no-deprecated-clone": "error"
"@babel/development/no-undefined-identifier": "error",
"@babel/development/no-deprecated-clone": "error",
"import/no-extraneous-dependencies": "error",
"guard-for-in": "error"
}
},
{
@@ -31,7 +33,8 @@
"files": ["packages/babel-plugin-*/src/index.js"],
"excludedFiles": ["packages/babel-plugin-transform-regenerator/**/*.js"],
"rules": {
"local-rules/plugin-name": "error"
"@babel/development/plugin-name": "error",
"eqeqeq": ["error", "always", { "null": "ignore" }]
}
}
]

View File

@@ -1,11 +1,10 @@
[ignore]
.*/build/.*
.*/packages/.*/lib
.*/packages/.*/test
.*/codemods/.*/lib
.*/codemods/.*/test
.*/node_modules/conventional-changelog-core/
.*/node_modules/module-deps/
<PROJECT_ROOT>/build/.*
<PROJECT_ROOT>/packages/.*/lib
<PROJECT_ROOT>/packages/.*/test
<PROJECT_ROOT>/codemods/.*/lib
<PROJECT_ROOT>/codemods/.*/test
<PROJECT_ROOT>/node_modules/module-deps/
[include]
packages/*/src

View File

@@ -84,7 +84,7 @@
* More performance improvements.
* Parsing is now ~30% faster thanks to [marijnh/acorn@7264bc0178e7e6af7cfe02e9e0c6b26ee0e6007f](https://github.com/marijnh/acorn/commit/7264bc0178e7e6af7cfe02e9e0c6b26ee0e6007f).
* **New Feature**
* Optional `es6.blockScopingTDZ` is now completely functional and handles all edgecases.
* Optional `es6.blockScopingTDZ` is now completely functional and handles all edge cases.
* `super` in object literals.
* Tail call optimisation. Thanks [@RReverser](https://github.com/RReverser)!
@@ -474,7 +474,7 @@
* **Polish**
* Rest parameters now allocate the array before populating.
* **Internal**
* `for...in` loops have been changed to optimized `for` loops - better performance and no enumeration of protoype keys.
* `for...in` loops have been changed to optimized `for` loops - better performance and no enumeration of prototype keys.
* Parts of the code generator have now been optimized thanks to [gaearon](https://github.com/gaearon).
## 2.12.3
@@ -643,7 +643,7 @@
* **Bug Fix**
* Better handling of number literal property keys.
* Handle `NewExpression` paren insertion edegcases better.
* Handle `NewExpression` paren insertion edge cases better.
* **Internal**
* Fix incorrect AST node `identifier("this")`.
* Better `toIdentifier` method that handles reserved words.
@@ -850,7 +850,7 @@
## 1.14.10
* Fix let scoping unneccesary override.
* Fix let scoping unnecessary override.
## 1.14.6
@@ -973,7 +973,7 @@
## 1.12.21
* Fix unneccesary let scoping replacement.
* Fix unnecessary let scoping replacement.
* Add `commonInterop` module formatter. Thanks [@Naddiseo](https://github.com/Naddiseo).
* Fix `return` outside of function body bug. Thanks [@brentburg](https://github.com/brentburg).
* Add more flexible option types.
@@ -1020,7 +1020,7 @@
## 1.12.12
* Make scope tracker more reliable to handle all edgecases.
* Make scope tracker more reliable to handle all edge cases.
## 1.12.11

View File

@@ -127,7 +127,7 @@
## 4.6.4
* **Bug Fix**
* Fix `ForOfStatement` not proplery inheriting labels.
* Fix `ForOfStatement` not properly inheriting labels.
* When in closure mode in block scoping transformer, properly check for variable shadowing.
* **New Feature**
* New `utility.inlineEnvironmentVariables` and `utility.inlineExpression` transformers.
@@ -153,7 +153,7 @@
* **Spec Compliancy**
* `for...of` now outputs in a lengthy `try...catch` this is to ensure spec compliancy in regards to iterator returns and abrupt completions. See [google/traceur-compiler#1773](https://github.com/google/traceur-compiler/issues/1773) and [babel/babel/#838](https://github.com/babel/babel/issues/838) for more information.
* **Polish**
* Rest parameters that are only refered to via number properties on member expressions are desugared into a direct `arguments` reference. Thanks [@neVERberleRfellerER](https://github.com/neVERberleRfellerER)!
* Rest parameters that are only referred to via number properties on member expressions are desugared into a direct `arguments` reference. Thanks [@neVERberleRfellerER](https://github.com/neVERberleRfellerER)!
* `$ babel` no longer exits on syntax errors.
* **Internal**
* Upgrade `browserify`.

View File

@@ -262,8 +262,8 @@ Issues with publish process.
* Register labels as bindings to fix undeclared variable checks.
* **Polish**
* Remove unnecessary string binary expressions when transforming template literals.
* Support module live bindings in arbitary positions not in Program statement position.
* Throw error when attemping to replace a `Program` root node with another node not of type `Program`.
* Support module live bindings in arbitrary positions not in Program statement position.
* Throw error when attempting to replace a `Program` root node with another node not of type `Program`.
* Optimise rest parameters in spread element position and allocate rest array at the earliest common ancestor of all references.
* Generate original number representation when value was not changed.
* Check for invalid binding identifiers when generating inferred method names.
@@ -543,12 +543,12 @@ Issues with publish process.
* **Internal**
* Removed native inheritance support from classes.
* Added `replaceWithSourceString` path API.
* Split up `es3.propertyLiterals` and `es3.memberExpressionLiterals` transformers to `minfication.propertyLiterals` and `es3.memberExpressionLiterals`.
* Split up `es3.propertyLiterals` and `es3.memberExpressionLiterals` transformers to `minification.propertyLiterals` and `es3.memberExpressionLiterals`.
## 5.2.6
* **Internal**
* Fix transformer aliases being accidently set as deprecated ones.
* Fix transformer aliases being accidentally set as deprecated ones.
* Expose `Pipeline` as `TransformerPipeline` instead.
## 5.2.5
@@ -824,10 +824,10 @@ Issues with publish process.
* Save register cache on tick instead of `SIGINT`.
* Enable strict mode on babel-node eval flag.
* **Bug Fixes**
* Add support for live bindings. This change also increases the reliablity of export specifier renaming.
* Add support for live bindings. This change also increases the reliability of export specifier renaming.
* Add support for super update and non equals assignment expressions.
* Rename shadow constructor binding in classes.
* Seed next iteration bindings with previous fresh bindings when reassinging loop block scoped variables.
* Seed next iteration bindings with previous fresh bindings when reassigning loop block scoped variables.
* Fix new expression spread referencing the wrong constructor.
* Call `resolveModuleSource` on dynamic imports.
* Added `param` to list of duplicate declaration kinds.
@@ -836,4 +836,3 @@ Issues with publish process.
* ES7 Abstract References have been removed.
* Experimental option has been removed in favor of a stage option.
* Rename `returnUsedHelpers` to `metadataUsedHelpers`.

View File

@@ -19,7 +19,7 @@
## 6.26.0 (2017-08-16)
> Backports for some folks (also other's when we accidently merged PRs from both 6.x/master)
> Backports for some folks (also other's when we accidentally merged PRs from both 6.x/master)
> Lesson learned: just use `master` and backport on another branch.
#### :eyeglasses: Spec Compliancy
@@ -1767,7 +1767,7 @@ typeof Symbol.prototype === 'object'
* [#3456](https://github.com/babel/babel/pull/3456) Use the real sourcemap API and handle input sourcemaps - Fixes [#7259](https://github.com/babel/babel/issues/7259). ([@loganfsmyth](https://github.com/loganfsmyth))
* [#4507](https://github.com/babel/babel/pull/4507) Only set options in cli if different from default. ([@danez](https://github.com/danez))
Fix an issue with defaults not being overidden. This was causing options like `comments: false` not to work correctly.
Fix an issue with defaults not being overridden. This was causing options like `comments: false` not to work correctly.
* [#4508](https://github.com/babel/babel/pull/4508) Support custom ports for V8 --inspect. ([@andykant](https://github.com/andykant))
* [#4562](https://github.com/babel/babel/pull/4562) Fixes [#2299](https://github.com/babel/babel/issues/2299): Prevent REPL from printing implicit 'use strict'. ([@hzoo](https://github.com/hzoo))
@@ -2084,7 +2084,7 @@ Also added more tests and will update Babel to use the new preset options after
## v6.13.1 (2016-08-04)
We had a regression in our new babel-preset-es2015@6.13.0 that made it unexpectedly backward-incompatible. This release introduces a new alternative plugin-options approach that is uglier but supports backward-compatiblity. Ideally new plugins would use the new `module.exports = function(babel, options){ }` approach and simple skip supporting `babel-core@<6.13.x`.
We had a regression in our new babel-preset-es2015@6.13.0 that made it unexpectedly backward-incompatible. This release introduces a new alternative plugin-options approach that is uglier but supports backward-compatibility. Ideally new plugins would use the new `module.exports = function(babel, options){ }` approach and simple skip supporting `babel-core@<6.13.x`.
#### Bug Fix
* `babel-core`, `babel-preset-es2015`
@@ -2092,7 +2092,7 @@ We had a regression in our new babel-preset-es2015@6.13.0 that made it unexpecte
## v6.13.0 (2016-08-04)
> Since the last release we've created https://github.com/babel/notes to track discussions on our slack and high level features/changes that could be added - definetely check it out if you're interested in Babel's development!
> Since the last release we've created https://github.com/babel/notes to track discussions on our slack and high level features/changes that could be added - definitely check it out if you're interested in Babel's development!
Some small but very important additions in this release:
@@ -3817,7 +3817,7 @@ Thanks to @samwgoldman for all the new flow support!
* **New Feature**
* Add support for `function.sent`.
* **Internal**
* Bump `invariant` depenency version.
* Bump `invariant` dependency version.
* **Polish**
* Infer filename from the base directory when resolving plugins and presets.
* Allow JSX pragma to be specified in line comments.
@@ -3887,7 +3887,7 @@ Thanks to @samwgoldman for all the new flow support!
## 6.1.2
* **Bug Fix**
* Fix bug where the parser wouldn't allow typed annotated default parametesr in arrow functions.
* Fix bug where the parser wouldn't allow typed annotated default parameters in arrow functions.
* Add existence check to `NodePath#has` to ensure safeness when making comparisons.
* Protect against replacing a class expression with a name inferred version that would
result in it never being transformed.
@@ -3976,7 +3976,7 @@ Thanks to @samwgoldman for all the new flow support!
* Fix SystemJS module formatter exporting function parameters.
* Ensure that invalid identifier JSX attribute keys are quoted when transforming to calls.
* Fix ES3 property literal plugin.
* Fix parameters after defaults in arrow functions refering to the wrong `arguments`.
* Fix parameters after defaults in arrow functions referring to the wrong `arguments`.
## 6.0.13

View File

@@ -1,6 +1,9 @@
---
name: 🐛 Bug Report
about: If something isn't working as expected 🤔.
name: "\U0001F41B Bug Report"
about: "If something isn't working as expected \U0001F914."
title: ''
labels: 'i: bug, i: needs triage'
assignees: ''
---
@@ -31,7 +34,7 @@ A clear and concise description of what you expected to happen (or code).
- Babel version(s): [e.g. v6.0.0, v7.0.0-beta.34]
- Node/npm version: [e.g. Node 8/npm 5]
- OS: [e.g. OSX 10.13.4, Windows 10]
- Monorepo [e.g. yes/no/Lerna]
- Monorepo: [e.g. yes/no/Lerna]
- How you are using Babel: [e.g. `cli`, `register`, `loader`]
**Possible Solution**

View File

@@ -1,6 +1,9 @@
---
name: 🚀 Feature Request
about: I have a suggestion (and may want to implement it 🙂)!
name: "\U0001F680 Feature Request"
about: "I have a suggestion (and may want to implement it \U0001F642)!"
title: ''
labels: 'i: enhancement, i: needs triage'
assignees: ''
---

View File

@@ -1,12 +1,16 @@
---
name: 💥 v7 Regression
about: Report an unexpected behavior in v7 from v6 (Check the upgrade guide first ✌️)
name: "\U0001F4A5 v7 Regression"
about: Report an unexpected behavior in v7 from v6 (Check the upgrade guide first
✌️)
title: ''
labels: 'i: bug, 7.x: regression, i: needs triage'
assignees: ''
---
# v7 Regression
> First check out: https://new.babeljs.io/docs/en/next/v7-migration.html
> First check out: https://babeljs.io/docs/en/v7-migration
> Also a partial upgrade tool: https://github.com/babel/babel-upgrade
**Potential Commit/PR that introduced the regression**

View File

@@ -1,6 +1,9 @@
---
name: 🤗 Support Question
about: If you have a question 💬, please check out our Slack or StackOverflow!
name: "\U0001F917 Support Question"
about: "If you have a question \U0001F4AC, please check out our Slack or StackOverflow!"
title: ''
labels: 'i: question, i: needs triage'
assignees: ''
---

View File

@@ -1,6 +1,10 @@
---
name: 🤝 Support us on Babel
about: If you would like to support our efforts in maintaining this community-driven project 🙌!
name: "\U0001F91D Support us on Babel"
about: "If you would like to support our efforts in maintaining this community-driven
project \U0001F64C!"
title: ''
labels: ''
assignees: ''
---

View File

@@ -0,0 +1,16 @@
FROM debian:stable-slim
LABEL "name"="create-release-tag"
LABEL "version"="0.0.1"
LABEL "com.github.actions.name"="Create release tag"
LABEL "com.github.actions.description"="Creates a release tag equal to the last commit message"
LABEL "com.github.actions.icon"="tag"
LABEL "com.github.actions.color"="gray-dark"
ADD entrypoint.sh /action/entrypoint.sh
RUN chmod +x /action/entrypoint.sh
RUN apt-get update && apt-get install -y --no-install-recommends git
ENTRYPOINT ["/action/entrypoint.sh"]

View File

@@ -0,0 +1,14 @@
#!/bin/sh
set -e
# GitHub doesn't support running actions on new tags yet: we need to run it on the commit.
# For this reason, we can't be sure that the tag already exists. We can use the commit
# message to create the tag. If the tag already exists locally, they won't conflict because
# they have the same name and are on the same commit.
echo "INFO: Getting release version..."
tag_name=$(git log --oneline --format=%B -1 $GITHUB_SHA)
echo "INFO: Creating new tag..."
(git tag $tag_name $GITHUB_SHA) || echo "INFO: Tag already exists"

View File

@@ -0,0 +1,16 @@
FROM debian:stable-slim
LABEL "name"="filter"
LABEL "version"="1.1.0"
LABEL "com.github.actions.name"="Filter commit message"
LABEL "com.github.actions.description"="Stop a workflow if the message of the current commit doesn't match the pattern"
LABEL "com.github.actions.icon"="filter"
LABEL "com.github.actions.color"="gray-dark"
ADD entrypoint.sh /action/entrypoint.sh
RUN chmod +x /action/entrypoint.sh
RUN apt-get update && apt-get install -y --no-install-recommends git
ENTRYPOINT ["/action/entrypoint.sh"]

View File

@@ -0,0 +1,15 @@
#!/bin/sh
set -e
pattern=$1
message=$(git log --oneline --format=%B -1 $GITHUB_SHA)
if echo "$message" | grep -Pq "$pattern"; then
echo "INFO: $message matches $pattern"
exit 0
else
echo "INFO: $message does not match $pattern"
# 78 is the "neutral" exit status
exit 78
fi

View File

@@ -0,0 +1,19 @@
FROM node:10
LABEL "name" = "trigger-github-release"
LABEL "version" = "0.0.1"
LABEL "com.github.actions.name" = "Trigger GitHub release"
LABEL "com.github.actions.description" = "Trigger a new GitHub release and generate the changelog using lerna-changelog."
LABEL "com.github.actions.icon" = "tag"
LABEL "com.github.actions.color" = "yellow"
ADD entrypoint.sh /action/entrypoint.sh
ADD package.json /action/package.json
ADD package-lock.json /action/package-lock.json
ADD release.js /action/release.js
ADD update-changelog.js /action/update-changelog.js
RUN chmod +x /action/entrypoint.sh
ENTRYPOINT ["/action/entrypoint.sh"]

View File

@@ -0,0 +1,38 @@
#!/bin/sh
set -e
echo "INFO: Installing action dependencies..."
(cd /action; npm ci)
echo "INFO: Getting release version..."
current_tag=$(git describe --abbrev=0 --tags $GITHUB_SHA)
last_tag=$(git describe --abbrev=0 --tags $current_tag^)
echo "INFO: New version is $current_tag; last version is $last_tag."
echo "INFO: Generating the changelog..."
# lerna-changelog expects the token to be provided as GITHUB_AUTH,
# but GitHub actions don't allow to predefine custom env vars prefixed with
# GITHUB_. We need to define it here.
changelog=$(
GITHUB_AUTH="$GITHUB_TOKEN" \
node /action/node_modules/.bin/lerna-changelog --tag-from $last_tag --tag-to $current_tag
)
echo "INFO: Publishing the new GitHub release..."
echo "$changelog" | node /action/release $current_tag
echo "INFO: Updating CHANGELOG.md..."
echo "$changelog" | node /action/update-changelog
echo "INFO: Committing changelog..."
git add CHANGELOG.md
git -c user.name="$COMMIT_AUTHOR_NAME" -c user.email="$COMMIT_AUTHOR_EMAIL" \
commit -m "Add $current_tag to CHANGELOG.md [skip ci]" --no-verify --quiet
echo "INFO: Pushing updates..."
git push "https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" master
echo "INFO: Done! Don't forget to thank new contributors :)"

1415
.github/actions/trigger-github-release/package-lock.json generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
{
"private": true,
"name": "@internal/trigger-github-release",
"version": "0.0.1",
"author": "Nicolò Ribaudo <nicolo.ribaudo@gmail.com>",
"license": "MIT",
"dependencies": {
"@octokit/rest": "^16.3.0",
"get-stdin": "^6.0.0",
"lerna-changelog": "^0.8.2"
}
}

View File

@@ -0,0 +1,26 @@
"use strict";
const [ /* node */, /* file */, tag ] = process.argv;
const getStdin = require("get-stdin");
const octokit = require("@octokit/rest")();
octokit.authenticate({
type: "token",
token: process.env.GITHUB_TOKEN
});
const [ repoOwner, repoName ] = process.env.GITHUB_REPOSITORY.split("/");
getStdin()
.then(changelog => octokit.repos.createRelease({
owner: repoOwner,
repo: repoName,
tag_name: tag,
body: changelog,
draft: true,
}))
.catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -0,0 +1,31 @@
"use strict";
const getStdin = require("get-stdin");
const fs = require("fs").promises;
const path = require("path");
const { GITHUB_WORKSPACE } = process.env;
const INSERTION_POINT = "<!-- insert-new-changelog-here -->";
const CHANGELOG = path.resolve(GITHUB_WORKSPACE, "CHANGELOG.md");
main();
async function main() {
let [stdin, changelog] = await Promise.all([
getStdin(),
fs.readFile(CHANGELOG, "utf8"),
]);
if (!changelog.includes(INSERTION_POINT)) {
throw new Error(`Missing "${INSERTION_POINT}" in CHANGELOG.md`);
}
// Remove committers
stdin = stdin.split("\n\n#### Committers")[0];
changelog = changelog.replace(
INSERTION_POINT,
INSERTION_POINT + "\n" + stdin
);
await fs.writeFile(CHANGELOG, changelog);
}

53
.github/main.workflow vendored Normal file
View File

@@ -0,0 +1,53 @@
workflow "Release" {
on = "push"
resolves = [
"Trigger GitHub release",
# GitHub actions are too slow for this, it takes more than 15 mins.
# Publishing to npm from GH actions is a cool idea, but it's a lot faster to
# publish locally.
# "Publish to npm",
]
}
action "Trigger GitHub release" {
uses = "./.github/actions/trigger-github-release/"
secrets = ["GITHUB_TOKEN"]
env = {
COMMIT_AUTHOR_NAME = "Babel Bot"
COMMIT_AUTHOR_EMAIL = "babel-bot@users.noreply.github.com"
}
needs = ["Create release tag"]
}
action "Publish to npm" {
uses = "docker://node:10"
secrets = ["NPM_TOKEN"]
runs = "make"
args = "publish-ci"
env = {
CI = "true"
}
needs = ["Create release tag"]
}
# When GitHub Actions will support the "release" event for public
# repositories, we won't need this checks anymore.
action "Create release tag" {
uses = "./.github/actions/create-release-tag"
needs = [
"Is version commit",
"On master branch",
]
}
action "Is version commit" {
uses = "./.github/actions/filter-commit-message"
# This regex is run using "grep -P".
# The (-\\S+) part is for 7.0.0-beta.1 releases.
args = "^v(\\d+\\.){2}\\d+(-\\S+)?$"
}
action "On master branch" {
uses = "actions/bin/filter@master"
args = "branch master"
}

9
.gitignore vendored
View File

@@ -1,5 +1,8 @@
.npmrc
.DS_Store
/node_modules
/.github/actions/*/node_modules
/packages/*/node_modules
/packages/*/LICENSE
!/packages/babel-parser/LICENSE
@@ -15,6 +18,7 @@ coverage
dist
/.package.json
package-lock.json
!/.github/actions/*/package-lock.json
/packages/babel-runtime/helpers/*.js
!/packages/babel-runtime/helpers/toArray.js
@@ -36,6 +40,11 @@ package-lock.json
/packages/babel-runtime-corejs2/core-js/**/*.js
!/packages/babel-runtime-corejs2/core-js/map.js
/packages/babel-runtime-corejs3/helpers/*.js
/packages/babel-runtime-corejs3/helpers/esm/*.js
/packages/babel-runtime-corejs3/core-js/**/*.js
/packages/babel-runtime-corejs3/core-js-stable/**/*.js
/packages/babel-register/test/.babel
/packages/babel-cli/test/tmp
/packages/babel-node/test/tmp

View File

@@ -1,2 +1,5 @@
package.json
packages/babel-preset-env/data
packages/*/test/fixtures/**/input.*
packages/*/test/fixtures/**/exec.*
packages/*/test/fixtures/**/output.*

View File

@@ -1,11 +1,11 @@
git:
depth: 5
sudo: false
language: node_js
cache:
yarn: true
node_js:
# We test the latest version on circleci
- '11'
- '10'
- '8'
- '6'
@@ -20,17 +20,18 @@ before_install:
install:
# the `make test-ci` script runs this command already
- if [ "$JOB" != "test" ]; then yarn install; fi
- if [ "$JOB" != "test" ] && [ "$JOB" != "lint" ]; then yarn install; fi
- if [ "$JOB" = "lint" ]; then make bootstrap; fi
before_script:
- 'if [ "$JOB" = "babel-parser-flow-tests" ]; then make bootstrap-flow; fi'
- 'if [ "$JOB" = "babel-parser-test262-tests" ]; then make bootstrap-test262; fi'
- if [ "$JOB" = "babel-parser-flow-tests" ]; then make bootstrap-flow; fi
- if [ "$JOB" = "babel-parser-test262-tests" ]; then make bootstrap-test262; fi
script:
- 'if [ "$JOB" = "test" ]; then make test-ci; fi'
- 'if [ "$JOB" = "lint" ]; then make lint && make flow; fi'
- 'if [ "$JOB" = "babel-parser-flow-tests" ]; then make test-flow-ci; fi'
- 'if [ "$JOB" = "babel-parser-test262-tests" ]; then make test-test262-ci; fi'
- if [ "$JOB" = "test" ]; then make test-ci; fi
- if [ "$JOB" = "lint" ]; then make lint && make flow; fi
- if [ "$JOB" = "babel-parser-flow-tests" ]; then make test-flow-ci; fi
- if [ "$JOB" = "babel-parser-test262-tests" ]; then make test-test262-ci; fi
matrix:
fast_finish: true

View File

@@ -15,6 +15,703 @@ See [CHANGELOG - v4](/.github/CHANGELOG-v4.md), [CHANGELOG - v5](/.github/CHANGE
See [CHANGELOG - 6to5](/.github/CHANGELOG-6to5.md) for the pre-4.0.0 version changelog.
See [Babylon's CHANGELOG](packages/babylon/CHANGELOG.md) for the Babylon pre-7.0.0-beta.29 version changelog.
<!-- DO NOT CHANGE THESE COMMENTS - See .github/actions/trigger-github-release/update-changelog.js -->
<!-- insert-new-changelog-here -->
## v7.5.3 (2019-07-09)
#### :bug: Bug Fix
* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-preset-env`
* [#10180](https://github.com/babel/babel/pull/10180) [_objectSpread2] Do not use hoisted var from prev iteration ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
## v7.5.2 (2019-07-08)
#### :bug: Bug Fix
* `babel-plugin-transform-typescript`
* [#10174](https://github.com/babel/babel/pull/10174) Do not trust Scope when removing TypeScript types ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-preset-env`
* [#10171](https://github.com/babel/babel/pull/10171) Don't rely on getOwnPropertyDescriptors in objectSpread2 ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-plugin-proposal-export-default-from`, `babel-plugin-proposal-export-namespace-from`
* [#10172](https://github.com/babel/babel/pull/10172) fix: register injected importDeclaration ([@JLHwung](https://github.com/JLHwung))
## v7.5.1 (2019-07-06)
#### :bug: Bug Fix
* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`
* [#10170](https://github.com/babel/babel/pull/10170) Fix objectSpread2 backward compatibility ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-plugin-transform-typescript`
* [#10167](https://github.com/babel/babel/pull/10167) Retain typescript export-from-source ([@Wolvereness](https://github.com/Wolvereness))
## v7.5.0 (2019-07-04)
#### :eyeglasses: Spec Compliance
* `babel-parser`
* [#10099](https://github.com/babel/babel/pull/10099) Disallow "let" as name at lexical bindings ([@g-plane](https://github.com/g-plane))
#### :rocket: New Feature
* `babel-parser`
* [#10091](https://github.com/babel/babel/pull/10091) BigInt type for Flow ([@tanhauhau](https://github.com/tanhauhau))
* [#9450](https://github.com/babel/babel/pull/9450) Implement f# pipeline in parser ([@mAAdhaTTah](https://github.com/mAAdhaTTah))
* [#9912](https://github.com/babel/babel/pull/9912) [legacy decorators] Allow decorating generator methods ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9864](https://github.com/babel/babel/pull/9864) [@babel/parser] Add "allowUndeclaredExports" option ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-plugin-proposal-dynamic-import`, `babel-preset-env-standalone`, `babel-preset-env`
* [#10109](https://github.com/babel/babel/pull/10109) Add @babel/plugin-proposal-dynamic-import to @babel/preset-env ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-plugin-proposal-dynamic-import`, `babel-plugin-transform-modules-amd`, `babel-plugin-transform-modules-commonjs`, `babel-plugin-transform-modules-systemjs`
* [#9552](https://github.com/babel/babel/pull/9552) Create @babel/plugin-proposal-dynamic-import ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-plugin-proposal-pipeline-operator`, `babel-plugin-syntax-pipeline-operator`
* [#9984](https://github.com/babel/babel/pull/9984) Transform for F# Pipeline ([@thiagoarrais](https://github.com/thiagoarrais))
* `babel-plugin-transform-typescript`, `babel-types`
* [#9785](https://github.com/babel/babel/pull/9785) Implement TypeScript namespace support ([@Wolvereness](https://github.com/Wolvereness))
#### :bug: Bug Fix
* `babel-plugin-proposal-do-expressions`, `babel-traverse`
* [#10072](https://github.com/babel/babel/pull/10072) fix await and yield for do expression ([@tanhauhau](https://github.com/tanhauhau))
* `babel-helpers`, `babel-plugin-transform-react-constant-elements`
* [#10155](https://github.com/babel/babel/pull/10155) Added es3 backward compatibility for react helper code ([@sormy](https://github.com/sormy))
* `babel-preset-env`
* [#10127](https://github.com/babel/babel/pull/10127) Bump compat-table and updating preset-env mappings ([@existentialism](https://github.com/existentialism))
* [#8897](https://github.com/babel/babel/pull/8897) Allow `defaults` query in preset-env ([@existentialism](https://github.com/existentialism))
* `babel-parser`
* [#10132](https://github.com/babel/babel/pull/10132) fix import typeof in declare module ([@tanhauhau](https://github.com/tanhauhau))
* [#10084](https://github.com/babel/babel/pull/10084) flow - allow type parameter defaults in function declarations ([@tanhauhau](https://github.com/tanhauhau))
* `babel-types`
* [#10126](https://github.com/babel/babel/pull/10126) fix exportKind declaration in babel-types ([@zxbodya](https://github.com/zxbodya))
* `babel-node`
* [#9951](https://github.com/babel/babel/pull/9951) Prevents exception on PnP ([@arcanis](https://github.com/arcanis))
* `babel-generator`
* [#10041](https://github.com/babel/babel/pull/10041) Fix printer for explicitly inexact Flow types ([@mrtnzlml](https://github.com/mrtnzlml))
* `babel-plugin-transform-typescript`
* [#10034](https://github.com/babel/babel/pull/10034) Use scope for typescript export removals ([@Wolvereness](https://github.com/Wolvereness))
* [#10019](https://github.com/babel/babel/pull/10019) fix(typescript): erase default export if exporting a TS type ([@airato](https://github.com/airato))
* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-class-properties`, `babel-traverse`
* [#10029](https://github.com/babel/babel/pull/10029) Fixed computed keys for class expression ([@tanhauhau](https://github.com/tanhauhau))
* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-preset-env`
* [#9384](https://github.com/babel/babel/pull/9384) Retry to fix object spread helper compatibility ([@saschanaz](https://github.com/saschanaz))
* `babel-plugin-transform-destructuring`
* [#10013](https://github.com/babel/babel/pull/10013) fix destructuring rest with template literal ([@tanhauhau](https://github.com/tanhauhau))
* `babel-helper-create-class-features-plugin`, `babel-plugin-transform-typescript`
* [#9610](https://github.com/babel/babel/pull/9610) Use `injectInitialization` to generate ts parameter properties ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
#### :nail_care: Polish
* `babel-core`
* [#10157](https://github.com/babel/babel/pull/10157) Fix incorrect usage of $o instead of %o in debug ([@ChlorideCull](https://github.com/ChlorideCull))
* `babel-helpers`
* [#10117](https://github.com/babel/babel/pull/10117) Simplify the helpers for classPrivateField{Get,Set} ([@arv](https://github.com/arv))
* `babel-plugin-transform-typescript`
* [#10047](https://github.com/babel/babel/pull/10047) Refactor isImportTypeOnly helper function ([@Andarist](https://github.com/Andarist))
#### :memo: Documentation
* `babel-plugin-proposal-partial-application`, `babel-plugin-syntax-partial-application`
* [#10103](https://github.com/babel/babel/pull/10103) docs: update readmes ([@xtuc](https://github.com/xtuc))
## v7.4.5 (2019-05-21)
#### :bug: Bug Fix
* `babel-parser`
* [#9998](https://github.com/babel/babel/pull/9998) Fix location for optional params in arrow functions ([@danez](https://github.com/danez))
* [#9982](https://github.com/babel/babel/pull/9982) Avoid unnecessary work during lookahead ([@danez](https://github.com/danez))
* [#9922](https://github.com/babel/babel/pull/9922) fix: allow shebang directive ([@tanhauhau](https://github.com/tanhauhau))
* `babel-preset-env`
* [#10002](https://github.com/babel/babel/pull/10002) Update preset-env dependencies and fix fixtures ([@danez](https://github.com/danez))
* [#9978](https://github.com/babel/babel/pull/9978) Fix mobile browsers support in preset-env ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9902](https://github.com/babel/babel/pull/9902) Fix destructuring assignments being transpiled for edge 15 ([@eps1lon](https://github.com/eps1lon))
* `babel-plugin-transform-typescript`
* [#9944](https://github.com/babel/babel/pull/9944) fix(typescript): erase type exports ([@airato](https://github.com/airato))
#### :nail_care: Polish
* `babel-parser`
* [#9995](https://github.com/babel/babel/pull/9995) Do not use lookahead when parsing construct signature declarations in TS ([@danez](https://github.com/danez))
* [#9989](https://github.com/babel/babel/pull/9989) Only compute Position if not already in state ([@danez](https://github.com/danez))
* [#9988](https://github.com/babel/babel/pull/9988) Do not use lookahead when parsing jsx expression containers ([@danez](https://github.com/danez))
* [#9987](https://github.com/babel/babel/pull/9987) Do not use lookahead when parsing imports in declare module in flow ([@danez](https://github.com/danez))
* [#9985](https://github.com/babel/babel/pull/9985) Do not use lookahead when parsing declare module or declare module.exports in flow ([@danez](https://github.com/danez))
* [#9983](https://github.com/babel/babel/pull/9983) Do not use lookahead when parsing dynamic import or import.meta ([@danez](https://github.com/danez))
* [#9979](https://github.com/babel/babel/pull/9979) Remove guardedHandlers from ASTs ([@danez](https://github.com/danez))
* `babel-preset-env`
* [#9992](https://github.com/babel/babel/pull/9992) use console.warn for warning ([@schu34](https://github.com/schu34))
* `babel-core`
* [#9945](https://github.com/babel/babel/pull/9945) Fixed null error in plugin opts and added a test for it ([@divbhasin](https://github.com/divbhasin))
* `babel-core`, `babel-traverse`
* [#9909](https://github.com/babel/babel/pull/9909) Add missing space in error messages ([@pnavarrc](https://github.com/pnavarrc))
#### :house: Internal
* `babel-node`
* [#9914](https://github.com/babel/babel/pull/9914) [babel-node] Do not hardcode node flags ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
## v7.4.4 (2019-04-26)
#### :bug: Bug Fix
* `babel-plugin-transform-flow-comments`
* [#9897](https://github.com/babel/babel/pull/9897) fix flow-comments - class type paramters and implements ([@tanhauhau](https://github.com/tanhauhau))
* [#9893](https://github.com/babel/babel/pull/9893) fix flow-comment - object destructuring ([@tanhauhau](https://github.com/tanhauhau))
* `babel-parser`
* [#9766](https://github.com/babel/babel/pull/9766) Add TS support to @babel/parser's Scope ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9865](https://github.com/babel/babel/pull/9865) Always register global bindings as exportable ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9887](https://github.com/babel/babel/pull/9887) Fix TypeScript readonly error location ([@existentialism](https://github.com/existentialism))
* [#9869](https://github.com/babel/babel/pull/9869) ! remove constant context assertions ([@tanhauhau](https://github.com/tanhauhau))
* [#9890](https://github.com/babel/babel/pull/9890) Fix parsing typescript bodiless methods with the estree plugin also enabled ([@devongovett](https://github.com/devongovett))
* `babel-traverse`
* [#9870](https://github.com/babel/babel/pull/9870) Fix flow types in traverse/path/family and enable flow ([@danez](https://github.com/danez))
* `babel-plugin-proposal-class-properties`, `babel-plugin-transform-modules-commonjs`, `babel-types`
* [#9861](https://github.com/babel/babel/pull/9861) Fix: PrivateName Identifier should not be isReferenced. ([@coreyfarrell](https://github.com/coreyfarrell))
* `babel-types`
* [#9832](https://github.com/babel/babel/pull/9832) Fix typo in cloneNode. ([@evandervalk](https://github.com/evandervalk))
## v7.4.3 (2019-04-02)
#### :eyeglasses: Spec Compliance
* `babel-parser`
* [#9769](https://github.com/babel/babel/pull/9769) Don't accept '\08' or '\09' in strict mode. ([@danez](https://github.com/danez))
* [#9768](https://github.com/babel/babel/pull/9768) Correctly check for-in and for-of loop for invalid left-hand side. ([@danez](https://github.com/danez))
* [#9767](https://github.com/babel/babel/pull/9767) Parse right-hand-side of for/of as an assignment expression. ([@danez](https://github.com/danez))
* [#9748](https://github.com/babel/babel/pull/9748) [typescript] parsing template literal as type . ([@tanhauhau](https://github.com/tanhauhau))
#### :rocket: New Feature
* `babel-plugin-transform-runtime`
* [#9754](https://github.com/babel/babel/pull/9754) [runtime-corejs3] Only polyfill instance methods when it might be needed. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
#### :bug: Bug Fix
* `babel-polyfill`
* [#9780](https://github.com/babel/babel/pull/9780) Closes [#9232](https://github.com/babel/babel/issues/9232), add some missed modules to `@babel/polyfill/noConflict`. ([@zloirock](https://github.com/zloirock))
* `babel-cli`
* [#9807](https://github.com/babel/babel/pull/9807) Upgrade lodash to 4.17.11. ([@danez](https://github.com/danez))
* `babel-helper-module-transforms`, `babel-plugin-transform-modules-commonjs`
* [#9802](https://github.com/babel/babel/pull/9802) Fix lazy option of babel-plugin-transform-modules-commonjs. ([@AndreasCag](https://github.com/AndreasCag))
* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-private-methods`
* [#9801](https://github.com/babel/babel/pull/9801) Fix super method call in private instance method calling overridden method. ([@MattiasBuelens](https://github.com/MattiasBuelens))
* `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-destructuring`
* [#9416](https://github.com/babel/babel/pull/9416) Destructuring: Fix handling of impure computed keys with object rest. ([@motiz88](https://github.com/motiz88))
* `babel-plugin-transform-destructuring`
* [#9412](https://github.com/babel/babel/pull/9412) Destructuring: Fix array unpacking assignments with holes on RHS. ([@motiz88](https://github.com/motiz88))
* `babel-traverse`
* [#9415](https://github.com/babel/babel/pull/9415) @babel/traverse: Fix NodePath.getData. ([@71](https://github.com/71))
* `babel-parser`
* [#9760](https://github.com/babel/babel/pull/9760) Allow HTML comments on first line. ([@danez](https://github.com/danez))
* [#9700](https://github.com/babel/babel/pull/9700) Fix compatibility between estree and TS plugin. ([@danez](https://github.com/danez))
* `babel-helpers`
* [#9756](https://github.com/babel/babel/pull/9756) Allow coreJS Symbol to be type object. ([@conartist6](https://github.com/conartist6))
* `babel-preset-env`
* [#9752](https://github.com/babel/babel/pull/9752) Normalize `core-js` entry points. ([@zloirock](https://github.com/zloirock))
#### :nail_care: Polish
* `babel-parser`
* [#9762](https://github.com/babel/babel/pull/9762) Optimize parseBindingAtom code to get better error messages. ([@danez](https://github.com/danez))
* `babel-core`, `babel-plugin-transform-for-of`
* [#9698](https://github.com/babel/babel/pull/9698) Move array reference into `for` head initializer. ([@danez](https://github.com/danez))
#### :house: Internal
* Other
* [#9806](https://github.com/babel/babel/pull/9806) Update test262. ([@danez](https://github.com/danez))
* `babel-parser`, `babel-preset-typescript`
* [#9761](https://github.com/babel/babel/pull/9761) Explicit labels for tokenTypes. ([@danez](https://github.com/danez))
## v7.4.2 (2019-03-21)
#### :bug: Bug Fix
* `babel-parser`
* [#9725](https://github.com/babel/babel/pull/9725) Modules might be in loose mode when checking for undecl exports ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9719](https://github.com/babel/babel/pull/9719) Fix scope checks with enabled flow plugin ([@danez](https://github.com/danez))
* `babel-helpers`, `babel-plugin-transform-named-capturing-groups-regex`
* [#9726](https://github.com/babel/babel/pull/9726) Fix typo in wrapRegExp helper ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-preset-env`
* [#9724](https://github.com/babel/babel/pull/9724) Closes [#9713](https://github.com/babel/babel/issues/9713) ([@zloirock](https://github.com/zloirock))
#### :nail_care: Polish
* `babel-preset-env`
* [#9732](https://github.com/babel/babel/pull/9732) Mark the core-js warning as such ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9716](https://github.com/babel/babel/pull/9716) Tweak preset-env corejs/useBuiltIns warning and error messages ([@existentialism](https://github.com/existentialism))
#### :house: Internal
* [#9718](https://github.com/babel/babel/pull/9718) Bump Babel deps ([@existentialism](https://github.com/existentialism))
## v7.4.1 (2019-03-20)
#### :bug: Bug Fix
* `babel-preset-env`
* [#9711](https://github.com/babel/babel/pull/9711) Alias @babel/preset-env/data/built-ins.json.js ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9709](https://github.com/babel/babel/pull/9709) Bring back isPluginRequired ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
## v7.4.0 (2019-03-19)
#### :eyeglasses: Spec Compliance
* `babel-parser`
* [#9529](https://github.com/babel/babel/pull/9529) Add `readonly` to TypeScript type modifier ([@tanhauhau](https://github.com/tanhauhau))
* [#9534](https://github.com/babel/babel/pull/9534) TypeScript Constant contexts ([@tanhauhau](https://github.com/tanhauhau))
* [#9637](https://github.com/babel/babel/pull/9637) Update identifier parsing per Unicode v12 ([@mathiasbynens](https://github.com/mathiasbynens))
* [#9616](https://github.com/babel/babel/pull/9616) Allow any reserved word in `export {} from` specifiers ([@danez](https://github.com/danez))
* [#9612](https://github.com/babel/babel/pull/9612) [TS] Disallow type casts in arrow parameters ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9607](https://github.com/babel/babel/pull/9607) Refactor parsing object members ([@danez](https://github.com/danez))
* [#9599](https://github.com/babel/babel/pull/9599) Disallow duplicate params in methods ([@danez](https://github.com/danez))
* [#9586](https://github.com/babel/babel/pull/9586) Treat for loop body as part of loop scope ([@danez](https://github.com/danez))
* `babel-parser`, `babel-plugin-transform-typescript`
* [#9641](https://github.com/babel/babel/pull/9641) Allow context type annotation on getters/setters ([@matt-tingen](https://github.com/matt-tingen))
* `babel-plugin-proposal-unicode-property-regex`, `babel-plugin-transform-dotall-regex`, `babel-plugin-transform-unicode-regex`
* [#9636](https://github.com/babel/babel/pull/9636) Update babel-plugin-proposal-unicode-property-regex for Unicode v12 ([@mathiasbynens](https://github.com/mathiasbynens))
* `babel-generator`, `babel-parser`, `babel-plugin-transform-flow-strip-types`, `babel-plugin-transform-modules-systemjs`
* [#9589](https://github.com/babel/babel/pull/9589) Check exported bindings are defined ([@danez](https://github.com/danez))
* `babel-generator`, `babel-parser`, `babel-plugin-transform-classes`, `babel-plugin-transform-flow-comments`, `babel-plugin-transform-flow-strip-types`, `babel-plugin-transform-new-target`
* [#9493](https://github.com/babel/babel/pull/9493) Introduce scope tracking in the parser ([@danez](https://github.com/danez))
#### :rocket: New Feature
* `babel-helpers`, `babel-plugin-proposal-class-properties`, `babel-plugin-proposal-decorators`, `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-runtime`, `babel-plugin-transform-typescript`, `babel-polyfill`, `babel-preset-env`, `babel-register`, `babel-runtime-corejs2`, `babel-runtime-corejs3`
* [#7646](https://github.com/babel/babel/pull/7646) Update to `core-js@3` ([@zloirock](https://github.com/zloirock))
* `babel-template`
* [#9648](https://github.com/babel/babel/pull/9648) Add %%placeholders%% support to @babel/template ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-parser`, `babel-plugin-proposal-partial-application`
* [#9474](https://github.com/babel/babel/pull/9474) Partial application plugin ([@byara](https://github.com/byara))
* `babel-generator`, `babel-helper-create-class-features-plugin`, `babel-helpers`, `babel-plugin-proposal-private-methods`
* [#9446](https://github.com/babel/babel/pull/9446) Private Static Class Methods (Stage 3) ([@tim-mc](https://github.com/tim-mc))
* `babel-generator`, `babel-types`
* [#9542](https://github.com/babel/babel/pull/9542) Add placeholders support to @babel/types and @babel/generator ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-parser`
* [#9364](https://github.com/babel/babel/pull/9364) Add parser support for placeholders ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-generator`, `babel-parser`, `babel-plugin-syntax-partial-application`, `babel-types`
* [#9343](https://github.com/babel/babel/pull/9343) Partial Application Syntax: Stage 1 ([@byara](https://github.com/byara))
#### :bug: Bug Fix
* `babel-helper-create-class-features-plugin`, `babel-helper-replace-supers`, `babel-plugin-proposal-private-methods`
* [#9704](https://github.com/babel/babel/pull/9704) Fix `super` Method Calls in Class Private Methods ([@tim-mc](https://github.com/tim-mc))
* `babel-parser`
* [#9699](https://github.com/babel/babel/pull/9699) Correctly parse TS TypeAssertions around arrow functions ([@danez](https://github.com/danez))
* [#9600](https://github.com/babel/babel/pull/9600) Fix scope check for 2nd+ lexical bindings ([@danez](https://github.com/danez))
* [#9593](https://github.com/babel/babel/pull/9593) [TS] Correctly forget `await`s after parsing async arrows with type args ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9585](https://github.com/babel/babel/pull/9585) Fix strict mode prescanning with EmptyStatement ([@danez](https://github.com/danez))
* `babel-core`, `babel-plugin-transform-for-of`
* [#9697](https://github.com/babel/babel/pull/9697) Correctly preserve reference to array in for-of loop ([@danez](https://github.com/danez))
* `babel-plugin-transform-typescript`
* [#9693](https://github.com/babel/babel/pull/9693) [plugin-transform-typescript] Fix transpiling of TS abstract classes with decorators ([@agoldis](https://github.com/agoldis))
* `babel-traverse`, `babel-types`
* [#9692](https://github.com/babel/babel/pull/9692) Fix TSFunctionType visitors definition ([@penielse](https://github.com/penielse))
* `babel-plugin-proposal-object-rest-spread`
* [#9628](https://github.com/babel/babel/pull/9628) [proposal-object-rest-spread] fix templateLiteral in extractNormalizedKeys ([@pnowak](https://github.com/pnowak))
* `babel-plugin-transform-modules-systemjs`
* [#9639](https://github.com/babel/babel/pull/9639) System modules - Hoist classes like other variables ([@guybedford](https://github.com/guybedford))
* `babel-generator`, `babel-parser`
* [#9618](https://github.com/babel/babel/pull/9618) Disallow escape sequences in contextual keywords ([@danez](https://github.com/danez))
* `babel-helper-split-export-declaration`, `babel-plugin-transform-modules-commonjs`, `babel-traverse`
* [#9613](https://github.com/babel/babel/pull/9613) Don't add params of anonymous exported function decls to the outer scope ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-plugin-transform-parameters`, `babel-plugin-transform-typescript`, `babel-types`
* [#9605](https://github.com/babel/babel/pull/9605) [plugin-transform-typescript] Strip type imports used in Enums and object types ([@echenley](https://github.com/echenley))
* `babel-helper-call-delegate`, `babel-plugin-transform-parameters`
* [#9601](https://github.com/babel/babel/pull/9601) Don't loose "this" in helper-call-delegate ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-modules-commonjs`, `babel-traverse`, `babel-types`
* [#9492](https://github.com/babel/babel/pull/9492) Mark FOO in "var { x: FOO }˝ as a binding, not as a reference ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-preset-env`
* [#9595](https://github.com/babel/babel/pull/9595) preset-env: Sort versions before determining lowest ([@jridgewell](https://github.com/jridgewell))
* `babel-helper-define-map`, `babel-helper-hoist-variables`, `babel-parser`, `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-block-scoping`, `babel-plugin-transform-destructuring`, `babel-plugin-transform-modules-systemjs`, `babel-traverse`, `babel-types`
* [#9518](https://github.com/babel/babel/pull/9518) Use `for..of Object.keys` instead of `for..in` ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
#### :nail_care: Polish
* `babel-parser`
* [#9646](https://github.com/babel/babel/pull/9646) Remove input and length from state ([@danez](https://github.com/danez))
* [#9645](https://github.com/babel/babel/pull/9645) Reorganize token types and use a map for them ([@danez](https://github.com/danez))
* [#9591](https://github.com/babel/babel/pull/9591) Remove always false param allowExpressionBody ([@danez](https://github.com/danez))
* `babel-standalone`, `babel-types`
* [#9025](https://github.com/babel/babel/pull/9025) Make babel-standalone an ESModule and enable flow ([@danez](https://github.com/danez))
* `babel-generator`
* [#9579](https://github.com/babel/babel/pull/9579) change var name for coherence ([@tanohzana](https://github.com/tanohzana))
#### :house: Internal
* Other
* [#9588](https://github.com/babel/babel/pull/9588) Publish to npm using a GitHub action ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9640](https://github.com/babel/babel/pull/9640) Switch from rollup-stream to rollup ([@danez](https://github.com/danez))
* [#9647](https://github.com/babel/babel/pull/9647) Add WarningsToErrorsPlugin to webpack to avoid missing build problems on CI ([@danez](https://github.com/danez))
* [#9624](https://github.com/babel/babel/pull/9624) Update dependencies ([@danez](https://github.com/danez))
* [#9623](https://github.com/babel/babel/pull/9623) Add editorconfig for Makefile ([@danez](https://github.com/danez))
* [#9587](https://github.com/babel/babel/pull/9587) Update test262 ([@danez](https://github.com/danez))
* [#9582](https://github.com/babel/babel/pull/9582) Minify bundles on circle for repl ([@danez](https://github.com/danez))
* `babel-register`
* [#9678](https://github.com/babel/babel/pull/9678) Remove dependency on home-or-tmp package ([@AmirS](https://github.com/AmirS))
## v7.3.4 (2019-02-25)
#### :bug: Bug Fix
* `babel-parser`
* [#9572](https://github.com/babel/babel/pull/9572) Fix TypeScript parsers missing token check (#9571) ([@elevatebart](https://github.com/elevatebart))
* [#9521](https://github.com/babel/babel/pull/9521) Also check AssignmentPatterns for duplicate export name ([@danez](https://github.com/danez))
* `babel-helper-create-class-features-plugin`, `babel-helper-replace-supers`, `babel-plugin-proposal-class-properties`, `babel-traverse`
* [#9508](https://github.com/babel/babel/pull/9508) Use correct "this" in static fields ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-preset-env`
* [#9566](https://github.com/babel/babel/pull/9566) Closes [#9465](https://github.com/babel/babel/issues/9465) ([@zloirock](https://github.com/zloirock))
* `babel-types`
* [#9539](https://github.com/babel/babel/pull/9539) babel-types is* type checks accept null | undefiend as value TS type ([@ian-craig](https://github.com/ian-craig))
* `babel-plugin-transform-block-scoping`, `babel-traverse`
* [#9532](https://github.com/babel/babel/pull/9532) Migrate some duplicate binding tests to traverse ([@danez](https://github.com/danez))
* `babel-generator`
* [#9524](https://github.com/babel/babel/pull/9524) Fix typescript generator params ([@tanhauhau](https://github.com/tanhauhau))
* [#9523](https://github.com/babel/babel/pull/9523) Fix flow babel-generator function parantheses ([@tanhauhau](https://github.com/tanhauhau))
#### :house: Internal
* Other
* [#9561](https://github.com/babel/babel/pull/9561) Update CHANGELOG.md using the "Trigger GitHub release" action ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-modules-systemjs`
* [#9541](https://github.com/babel/babel/pull/9541) Enable eqeqeq rule in eslint ([@danez](https://github.com/danez))
* `babel-generator`, `babel-parser`, `babel-plugin-transform-flow-strip-types`, `babel-traverse`
* [#9522](https://github.com/babel/babel/pull/9522) Make tests spec compliant by avoiding duplicate declarations in input files ([@danez](https://github.com/danez))
* `babel-plugin-transform-proto-to-assign`
* [#9533](https://github.com/babel/babel/pull/9533) Add import/no-extraneous-dependencies to ESLint ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
## v7.3.3 (2019-02-15)
#### :eyeglasses: Spec Compliancy
* `babel-generator`
* [#9501](https://github.com/babel/babel/pull/9501) Correctly output escapes in directives ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
#### :bug: Bug Fix
* `babel-parser`
* [#9477](https://github.com/babel/babel/pull/9477) Fix regression with let ([@danez](https://github.com/danez))
* [#9431](https://github.com/babel/babel/pull/9431) Typescript function destructured params ([@mhcgrq](https://github.com/mhcgrq))
* [#9463](https://github.com/babel/babel/pull/9463) Fix range for TypeScript optional parameter in arrow function ([@existentialism](https://github.com/existentialism))
#### :nail_care: Polish
* `babel-plugin-proposal-class-properties`, `babel-plugin-transform-classes`, `babel-plugin-transform-parameters`
* [#9458](https://github.com/babel/babel/pull/9458) Fix duplicated assertThisInitialized calls in constructors ([@rubennorte](https://github.com/rubennorte))
#### :house: Internal
* Other
* [#9517](https://github.com/babel/babel/pull/9517) Add duplicate-package-checker-webpack-plugin ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9469](https://github.com/babel/babel/pull/9469) Exclude generate @babel/types files from coverage report ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-parser`
* [#9491](https://github.com/babel/babel/pull/9491) Better error output in parser tests ([@danez](https://github.com/danez))
## v7.3.2 (2019-02-04)
Various spec compliancy fixes and better support for smart pipelines and private methods.
Thanks @gverni, @naffiq, @spondbob and @dstaley for their first PRs!
#### :eyeglasses: Spec Compliancy
* `babel-parser`
* [#9403](https://github.com/babel/babel/pull/9403) Fix line continuation with Unicode line terminators. ([@danez](https://github.com/danez))
* [#9400](https://github.com/babel/babel/pull/9400) Make yield a contextual keyword. ([@danez](https://github.com/danez))
* [#9398](https://github.com/babel/babel/pull/9398) Correctly fail for invalid yield in for. ([@danez](https://github.com/danez))
* [#9375](https://github.com/babel/babel/pull/9375) Make let a contextual keyword. ([@danez](https://github.com/danez))
#### :rocket: New Feature
* `babel-plugin-proposal-pipeline-operator`
* [#9401](https://github.com/babel/babel/pull/9401) Support for await and yield in pipelines. ([@thiagoarrais](https://github.com/thiagoarrais))
#### :bug: Bug Fix
* `babel-plugin-proposal-private-methods`, `babel-types`
* [#9453](https://github.com/babel/babel/pull/9453) Fix duplicate definition error in private class methods. ([@gverni](https://github.com/gverni))
* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-private-methods`
* [#9423](https://github.com/babel/babel/pull/9423) Transform private async and generator functions. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-plugin-proposal-object-rest-spread`, `babel-plugin-transform-destructuring`
* [#9414](https://github.com/babel/babel/pull/9414) Destructuring: Create assignments from ForX non-declaration patterns. ([@motiz88](https://github.com/motiz88))
* `babel-plugin-transform-typescript`
* [#9095](https://github.com/babel/babel/pull/9095) Retain JSX pragma if defined as a comment. ([@dstaley](https://github.com/dstaley))
* `babel-parser`
* [#9406](https://github.com/babel/babel/pull/9406) Fix location/range on TypeScript ExportNamedDeclarations. ([@existentialism](https://github.com/existentialism))
* [#9371](https://github.com/babel/babel/pull/9371) Allow toplevel await with option and correctly mark await keyword as unexpected. ([@danez](https://github.com/danez))
* `babel-plugin-transform-typescript`, `babel-types`
* [#8738](https://github.com/babel/babel/pull/8738) Fix typescript side effects. ([@yuri-karadzhov](https://github.com/yuri-karadzhov))
* `babel-generator`, `babel-types`
* [#9396](https://github.com/babel/babel/pull/9396) Fix support for Flow's QualifiedTypeIdentifier. ([@existentialism](https://github.com/existentialism))
#### :nail_care: Polish
* `babel-parser`
* [#9405](https://github.com/babel/babel/pull/9405) Simplify await and yield tracking in params. ([@danez](https://github.com/danez))
* `babel-parser`, `babel-preset-typescript`
* [#9402](https://github.com/babel/babel/pull/9402) Unify reserved word checking and update error messages. ([@danez](https://github.com/danez))
## v7.3.1 (2019-01-22)
This release fixes some regressions introduced in v7.3.0
#### :bug: Bug Fix
* `babel-helpers`, `babel-plugin-proposal-object-rest-spread`, `babel-preset-env`
* [#9379](https://github.com/babel/babel/pull/9379) Revert "Differentiate object spread and non-spread properties (#9341)". ([@danez](https://github.com/danez))
* `babel-parser`
* [#9377](https://github.com/babel/babel/pull/9377) fix new keyword broken by recent refactoring. ([@danez](https://github.com/danez))
## v7.3.0 (2019-01-21)
Thanks to @jamesgeorge007 and @armano2 for their first PR!
#### :eyeglasses: Spec Compliancy
* `babel-parser`
* [#9314](https://github.com/babel/babel/pull/9314) Disallow async functions as loop body. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9315](https://github.com/babel/babel/pull/9315) Parse class heritage as strict mode code. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9313](https://github.com/babel/babel/pull/9313) Disallow `new import(x)` and `import(x,)`. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9311](https://github.com/babel/babel/pull/9311) Disallow trailing comma after rest. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
#### :rocket: New Feature
* `babel-helper-create-class-features-plugin`, `babel-helpers`, `babel-plugin-proposal-private-methods`
* [#9101](https://github.com/babel/babel/pull/9101) Private Class Methods Stage 3: Private Accessors. ([@tim-mc](https://github.com/tim-mc))
* `babel-plugin-proposal-pipeline-operator`, `babel-plugin-syntax-pipeline-operator`
* [#9179](https://github.com/babel/babel/pull/9179) Transform for the smart pipeline operator proposal. ([@thiagoarrais](https://github.com/thiagoarrais))
* `babel-preset-env-standalone`, `babel-preset-env`
* [#9345](https://github.com/babel/babel/pull/9345) Add support for transform-named-capturing-groups-regex in preset-env. ([@existentialism](https://github.com/existentialism))
* `babel-helpers`, `babel-plugin-transform-named-capturing-groups-regex`
* [#7105](https://github.com/babel/babel/pull/7105) Add @babel/plugin-transform-named-capturing-groups-regex. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-preset-env`
* [#9323](https://github.com/babel/babel/pull/9323) Add support for proposal-json-strings in preset-env. ([@existentialism](https://github.com/existentialism))
* `babel-generator`, `babel-types`
* [#9309](https://github.com/babel/babel/pull/9309) Add emit and builder for TSImportType. ([@hzoo](https://github.com/hzoo))
* `babel-parser`
* [#9302](https://github.com/babel/babel/pull/9302) @babel/parser(ts): Add parsing of type import. ([@armano2](https://github.com/armano2))
#### :bug: Bug Fix
* `babel-parser`
* [#9336](https://github.com/babel/babel/pull/9336) Disallow usage of invalid keyword after export abstract statement in Typescript. ([@armano2](https://github.com/armano2))
* [#9328](https://github.com/babel/babel/pull/9328) Fix handling newline with TypeScript declare and abstract classes. ([@existentialism](https://github.com/existentialism))
* [#9335](https://github.com/babel/babel/pull/9335) Fix range on TypeScript index signature parameters. ([@existentialism](https://github.com/existentialism))
* [#9292](https://github.com/babel/babel/pull/9292) Throw error if TypeScript class has empty implements. ([@existentialism](https://github.com/existentialism))
* [#9284](https://github.com/babel/babel/pull/9284) Fix location for typescript type assertions in AST. ([@danez](https://github.com/danez))
* [#9276](https://github.com/babel/babel/pull/9276) Ensure modifiers are included in TSParameterProperty ranges. ([@existentialism](https://github.com/existentialism))
* [#9230](https://github.com/babel/babel/pull/9230) babel-parser: typescript: add missing bigint keyword. ([@armano2](https://github.com/armano2))
* `babel-types`
* [#9333](https://github.com/babel/babel/pull/9333) Copy "optional" property when cloning Identifier node. ([@unconfident](https://github.com/unconfident))
* `babel-helper-create-class-features-plugin`, `babel-helpers`, `babel-plugin-proposal-decorators`
* [#9244](https://github.com/babel/babel/pull/9244) [decorators] Set method names at compile time instead of at runtime. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-helper-builder-react-jsx`, `babel-plugin-transform-react-jsx`
* [#9119](https://github.com/babel/babel/pull/9119) Revert "Revert babel-helper-builder-react-jsx change from #4988". ([@danez](https://github.com/danez))
* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-private-methods`
* [#9248](https://github.com/babel/babel/pull/9248) [private methods] Define private methods before executing initializers. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-preset-env`
* [#9219](https://github.com/babel/babel/pull/9219) Fix handling scoped packages in preset-env include/exclude options. ([@existentialism](https://github.com/existentialism))
#### :nail_care: Polish
* `babel-parser`
* [#9348](https://github.com/babel/babel/pull/9348) Parser Performance Collection. ([@danez](https://github.com/danez))
#### :memo: Documentation
* [#9370](https://github.com/babel/babel/pull/9370) add v7 downloads [skip ci]. ([@hzoo](https://github.com/hzoo))
#### :house: Internal
* `babel-parser`
* [#9312](https://github.com/babel/babel/pull/9312) Merge declaration and init of props in parser's state. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-types`
* [#9245](https://github.com/babel/babel/pull/9245) [@babel/types] Moved generators related to babel-types into the babel-types package directory.. ([@cameron-martin](https://github.com/cameron-martin))
* Other
* [#9288](https://github.com/babel/babel/pull/9288) Test262 update. ([@existentialism](https://github.com/existentialism))
* [#9290](https://github.com/babel/babel/pull/9290) Use 2014-present in license. ([@xtuc](https://github.com/xtuc))
* [#9271](https://github.com/babel/babel/pull/9271) Bump license years for 2019. ([@berlamhenderson](https://github.com/berlamhenderson))
* `babel-helpers`
* [#9166](https://github.com/babel/babel/pull/9166) Add mixins support to the _decorate helper. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
## v7.2.5 (2018-12-21)
`@babel/polyfill` didn't get published correctly in v7.2.3 (#9227).
## v7.2.4 (2018-12-20)
Minify `@babel/standalone` and `@babel/preset-env-standalone`.
## v7.2.3 (2018-12-20)
This is a small release, mainly to test Lerna 3.
We force-published `@babel/polyfill` and `@babel/preset-env`, since they should have been released respectively in v7.1.0 and v7.2.2 but for different reasons they didn't get updated.
Half of the commits in this release are made by first time contributors! Thanks to @cameron-martin, @cphamlet, @tanhauhau and @jedwards1211. :tada:
#### :rocket: New Feature
* [#9110](https://github.com/babel/babel/pull/9110) Added type-level mapping between aliases and nodes that have that alias. ([@cameron-martin](https://github.com/cameron-martin))
#### :bug: Bug Fix
* `babel-plugin-transform-flow-strip-types`
* [#9197](https://github.com/babel/babel/pull/9197) Strips flow directive fully. ([@tanhauhau](https://github.com/tanhauhau))
* `babel-parser`
* [#9184](https://github.com/babel/babel/pull/9184) Allow keywords to be used in type annotations. ([@danez](https://github.com/danez))
#### :house: Internal
* `babel-plugin-proposal-class-properties`, `babel-plugin-proposal-decorators`, `babel-plugin-proposal-private-methods`, `babel-traverse`
* [#9206](https://github.com/babel/babel/pull/9206) Use @babel/eslint-plugin-developement. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
## v7.2.2 (2018-12-15)
Mostly bug fixes and internal changes.
Thanks to @paleite, @saschanaz and @joeldenning for their first PRs!
#### :bug: Bug Fix
* `babel-plugin-transform-destructuring`, `babel-plugin-transform-spread`
* [#9108](https://github.com/babel/babel/pull/9108) Correctly transform spreads to use proper concat method. ([@danez](https://github.com/danez))
* `babel-parser`
* [#9168](https://github.com/babel/babel/pull/9168) [parser] Handle flow comments with leading spaces. ([@vikr01](https://github.com/vikr01))
* `babel-helper-module-transforms`, `babel-plugin-transform-modules-commonjs`
* [#9171](https://github.com/babel/babel/pull/9171) Fix transforming empty export statement. ([@danez](https://github.com/danez))
* `babel-node`
* [#9148](https://github.com/babel/babel/pull/9148) Fix --root-mode option in babel-node. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-plugin-transform-classes`
* [#9135](https://github.com/babel/babel/pull/9135) Inherit properties in function from method in loose mode. ([@rubennorte](https://github.com/rubennorte))
* `babel-preset-env`
* [#9140](https://github.com/babel/babel/pull/9140) Disable parameter-destructuring in Edge 18. ([@saschanaz](https://github.com/saschanaz))
* `babel-plugin-transform-arrow-functions`, `babel-traverse`
* [#9060](https://github.com/babel/babel/pull/9060) Not depending on return value of super(). Closes [#9020](https://github.com/babel/babel/issues/9020).. ([@joeldenning](https://github.com/joeldenning))
#### :house: Internal
* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-nullish-coalescing-operator`, `babel-plugin-syntax-bigint`, `babel-plugin-transform-dotall-regex`
* [#9176](https://github.com/babel/babel/pull/9176) Fix package.json repository URLs. ([@paleite](https://github.com/paleite))
* Other
* [#9158](https://github.com/babel/babel/pull/9158) add triage label to new issues [skip ci]. ([@danez](https://github.com/danez))
* [#9143](https://github.com/babel/babel/pull/9143) Fix a typo from the issue template for bugs. ([@saschanaz](https://github.com/saschanaz))
* [#9133](https://github.com/babel/babel/pull/9133) Move to travis vm based builds. ([@danez](https://github.com/danez))
* [#9132](https://github.com/babel/babel/pull/9132) Ensure we always use repository versions of babel dependencies in tests. ([@danez](https://github.com/danez))
* [#9131](https://github.com/babel/babel/pull/9131) Update issue templates [skip ci]. ([@hzoo](https://github.com/hzoo))
* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-class-properties`, `babel-plugin-proposal-decorators`
* [#9059](https://github.com/babel/babel/pull/9059) Move decorators transform to @babel/helper-create-class-features-plugin. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-core`, `babel-parser`, `babel-template`
* [#9128](https://github.com/babel/babel/pull/9128) Fix running flow on travis and update flow. ([@danez](https://github.com/danez))
## v7.2.1 (2018-12-04)
This release fixes a regression introduced in v7.2.0 (https://github.com/babel/babel/issues/9120)
#### :bug: Bug Fix
* `babel-helper-create-class-features-plugin`
* [#9121](https://github.com/babel/babel/pull/9121) Don't use isClassPrivateMethod because it isn't supported in <7.2.0. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
## v7.2.0 (2018-12-03)
You can read more about this release at https://babeljs.io/blog/2018/12/03/7.2.0.
#### :rocket: New Feature
* `babel-parser`
* [#8289](https://github.com/babel/babel/pull/8289) Implement Smart Pipeline proposal in @babel/parser. ([@mAAdhaTTah](https://github.com/mAAdhaTTah))
* `babel-core`
* [#8986](https://github.com/babel/babel/pull/8986) Export @babel/parser#tokTypes in @babel/core. ([@kaicataldo](https://github.com/kaicataldo))
* `babel-node`
* [#9078](https://github.com/babel/babel/pull/9078) Pass `rootMode` from `@babel/node`.. ([@wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg))
* `babel-generator`, `babel-helpers`, `babel-plugin-class-features`, `babel-plugin-proposal-private-methods`, `babel-plugin-syntax-class-properties`, `babel-types`
* [#8654](https://github.com/babel/babel/pull/8654) Private class methods stage 3. ([@tim-mc](https://github.com/tim-mc))
* `babel-preset-env`
* [#9048](https://github.com/babel/babel/pull/9048) Update mappings for node 10 in preset-env. ([@existentialism](https://github.com/existentialism))
#### :bug: Bug Fix
* `babel-parser`
* [#9114](https://github.com/babel/babel/pull/9114) Parse non-octals with leading zeros in non strict mode correctly. ([@danez](https://github.com/danez))
* [#9074](https://github.com/babel/babel/pull/9074) Disallow await inside arrow functions. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9069](https://github.com/babel/babel/pull/9069) [flow] Allow type casts in array patterns inside arrow parameters. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#9058](https://github.com/babel/babel/pull/9058) Fix compatibility between typescript and jsx plugins in interface declarations. ([@danez](https://github.com/danez))
* [#9055](https://github.com/babel/babel/pull/9055) Fix bug with parsing TS generic async arrow function. ([@existentialism](https://github.com/existentialism))
* [#9035](https://github.com/babel/babel/pull/9035) Fix parsing typescript function types with destructuring. ([@danez](https://github.com/danez))
* `babel-helper-fixtures`, `babel-parser`
* [#9113](https://github.com/babel/babel/pull/9113) Ignore empty fixture directories and fix fixtures in the parser. ([@danez](https://github.com/danez))
* `babel-preset-env`
* [#9091](https://github.com/babel/babel/pull/9091) Update mapping for regex unicode plugin in preset-env. ([@existentialism](https://github.com/existentialism))
* `babel-plugin-transform-destructuring`
* [#8916](https://github.com/babel/babel/pull/8916) Fix destructuring assignment in arrow functions without block. ([@RubenVerborgh](https://github.com/RubenVerborgh))
* `babel-plugin-proposal-optional-chaining`
* [#9073](https://github.com/babel/babel/pull/9073) Microbouji patch/8136. ([@jridgewell](https://github.com/jridgewell))
* `babel-core`, `babel-helper-wrap-function`, `babel-plugin-proposal-async-generator-functions`, `babel-plugin-proposal-function-sent`, `babel-plugin-transform-async-to-generator`, `babel-plugin-transform-classes`
* [#9039](https://github.com/babel/babel/pull/9039) Fix recursive async function expressions. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-core`
* [#9034](https://github.com/babel/babel/pull/9034) Normalize presets before merging config with others.. ([@loganfsmyth](https://github.com/loganfsmyth))
#### :nail_care: Polish
* `babel-generator`
* [#9089](https://github.com/babel/babel/pull/9089) Remove unused variable. ([@Gcaufy](https://github.com/Gcaufy))
* `babel-node`
* [#9079](https://github.com/babel/babel/pull/9079) Move `fs-readdir-recursive` and `output-file-sync` to `devDependencies` for `@babel/node`.. ([@wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg))
* `babel-parser`
* [#9046](https://github.com/babel/babel/pull/9046) a better error message for disallowed trailing commas/additional parameters after rest elements in function params. ([@morozRed](https://github.com/morozRed))
* `babel-*`
* [#8769](https://github.com/babel/babel/pull/8769) Add plugins name. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
#### :house: Internal
* `babel-helper-create-class-features-plugin`, `babel-plugin-proposal-class-properties`, `babel-plugin-proposal-private-methods`
* [#9083](https://github.com/babel/babel/pull/9083) Make @babel/plugin-class-features a normal helper package. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* Other
* [#9096](https://github.com/babel/babel/pull/9096) Add node 11 to CI and remove node 9. ([@danez](https://github.com/danez))
* [#9094](https://github.com/babel/babel/pull/9094) Skip minifying standalone in non-publish runs. ([@danez](https://github.com/danez))
* `babel-types`
* [#9093](https://github.com/babel/babel/pull/9093) Fix warning when using prettier in code generators. ([@danez](https://github.com/danez))
* `babel-generator`
* [#9089](https://github.com/babel/babel/pull/9089) Remove unused variable. ([@Gcaufy](https://github.com/Gcaufy))
## v7.1.6 (2018-11-13)
#### :bug: Bug Fix
* `babel-generator`
* [#9003](https://github.com/babel/babel/pull/9003) Fix retainLines regression for arrow functions. ([@loganfsmyth](https://github.com/loganfsmyth))
* `babel-types`
* [#8997](https://github.com/babel/babel/pull/8997) Fix cloneNode with typeAnnotation.. ([@neoziro](https://github.com/neoziro))
* `babel-plugin-transform-flow-strip-types`, `babel-plugin-transform-react-jsx`
* [#8701](https://github.com/babel/babel/pull/8701) Fix "TypeError: comments is not iterable". ([@AlicanC](https://github.com/AlicanC))
* `babel-core`
* [#9004](https://github.com/babel/babel/pull/9004) Fix browser files to have the same API as the nodejs ones. ([@danez](https://github.com/danez))
* Other
* [#9007](https://github.com/babel/babel/pull/9007) [Types] fix generated TS/Flow comment types. ([@ljqx](https://github.com/ljqx))
* `babel-preset-env`
* [#8555](https://github.com/babel/babel/pull/8555) preset-env: fix `opera` from `esmodules` target and Browserslist not used. ([@ylemkimon](https://github.com/ylemkimon))
* `babel-plugin-proposal-decorators`, `babel-traverse`
* [#8970](https://github.com/babel/babel/pull/8970) [decorators] Correctly insert `_initialize(this)` after `super()`.. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-parser`
* [#8972](https://github.com/babel/babel/pull/8972) Fix several edge cases with context expression state. ([@danez](https://github.com/danez))
#### :nail_care: Polish
* `babel-parser`
* [#8984](https://github.com/babel/babel/pull/8984) Rename primitive types to reserved types. ([@danez](https://github.com/danez))
#### :house: Internal
* [#8982](https://github.com/babel/babel/pull/8982) fix publish command [skip ci]. ([@hzoo](https://github.com/hzoo))
* [#8988](https://github.com/babel/babel/pull/8988) Remove definition of micromatch which was removed.. ([@danez](https://github.com/danez))
## v7.1.5 (2018-11-06)
#### :eyeglasses: Spec Compliancy
* `babel-parser`, `babylon`
* [#7727](https://github.com/babel/babel/pull/7727) Fix await in function name and parameters. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
#### :rocket: New Feature
* `babel-parser`
* [#8828](https://github.com/babel/babel/pull/8828) Typescript: Validate tuple type element positions. ([@Retsam](https://github.com/Retsam))
* [#8883](https://github.com/babel/babel/pull/8883) [flow] Add support for parsing `_` as implicit instantiation in call/new. ([@jbrown215](https://github.com/jbrown215))
* `babel-core`, `babel-generator`, `babel-parser`, `babel-plugin-syntax-typescript`, `babel-traverse`
* [#8448](https://github.com/babel/babel/pull/8448) Remove Babylon plugins for features already merged to the ECMAScript spec. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* `babel-parser`, `babel-types`
* [#8884](https://github.com/babel/babel/pull/8884) [flow] Explicit inexact objects with `...`. ([@jbrown215](https://github.com/jbrown215))
* `babel-preset-env`
* [#8898](https://github.com/babel/babel/pull/8898) Update preset-env data. ([@existentialism](https://github.com/existentialism))
#### :bug: Bug Fix
* `babel-parser`
* [#8956](https://github.com/babel/babel/pull/8956) Do not allow TypeCastExpressions w/o parens . ([@danez](https://github.com/danez))
* [#8954](https://github.com/babel/babel/pull/8954) Allow function types in type params within arrow return types. ([@danez](https://github.com/danez))
* [#8866](https://github.com/babel/babel/pull/8866) Closes [#8865](https://github.com/babel/babel/issues/8865). ([@byronluk](https://github.com/byronluk))
* `babel-core`
* [#8910](https://github.com/babel/babel/pull/8910) Resolve babel.config.js 'babelrcRoots' values relative to the config file.. ([@loganfsmyth](https://github.com/loganfsmyth))
* [#8950](https://github.com/babel/babel/pull/8950) Fix message when plugin of a wrong type is passed. ([@everdimension](https://github.com/everdimension))
* `babel-plugin-transform-block-scoping`
* [#8937](https://github.com/babel/babel/pull/8937) rename colliding let bindings with for loop init. ([@byronluk](https://github.com/byronluk))
* [#8914](https://github.com/babel/babel/pull/8914) Treat break inside block inside loop. ([@thiagoarrais](https://github.com/thiagoarrais))
* `babel-preset-env`
* [#8926](https://github.com/babel/babel/pull/8926) preset-env: Edge support for arrow param destructuring. ([@benmosher](https://github.com/benmosher))
* `babel-generator`
* [#8868](https://github.com/babel/babel/pull/8868) fix single-arg async arrows when retainLines=true. ([@ryanwmarsh](https://github.com/ryanwmarsh))
* `babel-traverse`
* [#8880](https://github.com/babel/babel/pull/8880) fix: Expression x === 'y' && '' should not evaluate to undefined.. ([@Cyp](https://github.com/Cyp))
#### :nail_care: Polish
* [#8873](https://github.com/babel/babel/pull/8873) fixed an extra word. ([@vvyomjjain](https://github.com/vvyomjjain))
## v7.1.4 (2018-10-11)
Just re-published `@babel/traverse` without `**` so that it works in Node 6.
## v7.1.3 (2018-10-11)
#### :bug: Bug Fix
* `babel-generator`, `babel-parser`, `babel-plugin-transform-typescript`, `babel-types`
* [#8720](https://github.com/babel/babel/pull/8720) Typescript - Tuple elements can be optional. ([@Retsam](https://github.com/Retsam))
* `babel-traverse`
* [#8833](https://github.com/babel/babel/pull/8833) Insertafter jsx fix. ([@kevintab95](https://github.com/kevintab95))
* `babel-parser`
* [#8830](https://github.com/babel/babel/pull/8830) Correct handling of newline after async with paren-less arrow func. ([@Retsam](https://github.com/Retsam))
* [#8756](https://github.com/babel/babel/pull/8756) class private methods and properties: should not allow spaces between # and identifier. ([@macabeus](https://github.com/macabeus))
* [#8804](https://github.com/babel/babel/pull/8804) Fix parsing of slash after class expression. ([@existentialism](https://github.com/existentialism))
* [#8767](https://github.com/babel/babel/pull/8767) [decorators] [typescript] Parse type parameters. ([@nicolo-ribaudo](https://github.com/nicolo-ribaudo))
* [#8792](https://github.com/babel/babel/pull/8792) Fix perf issue in typescript parser plugin. ([@matthewrobertson](https://github.com/matthewrobertson))
* `babel-generator`, `babel-parser`, `babel-plugin-transform-typescript`, `babel-types`
* [#8805](https://github.com/babel/babel/pull/8805) Typescript - Tuples can include rest elements. ([@Retsam](https://github.com/Retsam))
* `babel-types`
* [#8791](https://github.com/babel/babel/pull/8791) types: allow jsxEmptyExpression inside jsxExpressionContainer. ([@tvooo](https://github.com/tvooo))
* `babel-plugin-transform-modules-systemjs`
* [#8820](https://github.com/babel/babel/pull/8820) System module format - fixes function hoisting failure case. ([@guybedford](https://github.com/guybedford))
* `babel-plugin-transform-destructuring`
* [#8793](https://github.com/babel/babel/pull/8793) Ensure destructuring's computed key handling matches object-rest-spread. ([@existentialism](https://github.com/existentialism))
## 7.1.2 (2018-09-28)
Same as v7.1.1, except compiled against Node 6 instead of Node 8 by accident (e.g had `async functions`).
@@ -166,7 +863,7 @@ No change from rc.4. Finally released as https://babeljs.io/blog/2018/08/27/7.0.
## v7.0.0-rc.2 (2018-08-21)
A notable change is the addition of https://github.com/babel/babel/pull/8485 which enables https://github.com/babel/babel-loader/pull/660 (automatically doing `modules: false` for `@babel/preset-env` when using `babel-loader`.
A notable change is the addition of https://github.com/babel/babel/pull/8485 which enables https://github.com/babel/babel-loader/pull/660 (automatically doing `modules: false` for `@babel/preset-env` when using `babel-loader`.
#### :boom: Breaking Change
* `babel-core`
@@ -321,7 +1018,7 @@ Breaking Change in beta:
## v7.0.0-beta.53 (2018-07-11)
- Fix for regression with paths on windows due to micromatch upgrade, remove yearly presets (not published)
- (There was an issue with the Stage presets in this release, but it is also deprecated)
- (There was an issue with the Stage presets in this release, but it is also deprecated)
#### :boom: Breaking Change
* `babel-*`
@@ -1975,7 +2672,7 @@ Initial release of typescript equivalent of how Babel handles flow with a new `b
* `babel-plugin-check-es2015-constants`
* [#5930](https://github.com/babel/babel/pull/5930) Spec compliancy of check-es2015-constants plugin. ([@maurobringolf](https://github.com/maurobringolf))
> Instead of throwing a compile time error when const is violated, Babel should insert a throw statement before the violation.
> Instead of throwing a compile time error when const is violated, Babel should insert a throw statement before the violation.
#### :boom: Breaking Change
* `babel-plugin-transform-flow-comments`

View File

@@ -6,19 +6,17 @@ const chalk = require("chalk");
const newer = require("gulp-newer");
const babel = require("gulp-babel");
const gulpWatch = require("gulp-watch");
const gutil = require("gulp-util");
const fancyLog = require("fancy-log");
const filter = require("gulp-filter");
const gulp = require("gulp");
const path = require("path");
const webpack = require("webpack");
const merge = require("merge-stream");
const rollup = require("rollup-stream");
const source = require("vinyl-source-stream");
const buffer = require("vinyl-buffer");
const rollup = require("rollup");
const rollupBabel = require("rollup-plugin-babel");
const rollupNodeResolve = require("rollup-plugin-node-resolve");
const registerStandalonePackageTask = require("./scripts/gulp-tasks")
.registerStandalonePackageTask;
const rollupReplace = require("rollup-plugin-replace");
const { registerStandalonePackageTask } = require("./scripts/gulp-tasks");
const sources = ["codemods", "packages"];
@@ -36,13 +34,9 @@ function getIndexFromPackage(name) {
return `${name}/src/index.js`;
}
function compilationLogger(rollup) {
function compilationLogger() {
return through.obj(function(file, enc, callback) {
gutil.log(
`Compiling '${chalk.cyan(file.relative)}'${
rollup ? " with rollup " : ""
}...`
);
fancyLog(`Compiling '${chalk.cyan(file.relative)}'...`);
callback(null, file);
});
}
@@ -50,7 +44,7 @@ function compilationLogger(rollup) {
function errorsLogger() {
return plumber({
errorHandler(err) {
gutil.log(err.stack);
fancyLog(err.stack);
},
});
}
@@ -91,32 +85,40 @@ function buildBabel(exclude) {
}
function buildRollup(packages) {
return merge(
return Promise.all(
packages.map(pkg => {
return rollup({
input: getIndexFromPackage(pkg),
format: "cjs",
plugins: [
rollupBabel({
envName: "babel-parser",
}),
rollupNodeResolve(),
],
})
.pipe(source("index.js"))
.pipe(buffer())
.pipe(errorsLogger())
.pipe(compilationLogger(/* rollup */ true))
.pipe(gulp.dest(path.join(pkg, "lib")));
const input = getIndexFromPackage(pkg);
fancyLog(`Compiling '${chalk.cyan(input)}' with rollup ...`);
return rollup
.rollup({
input,
plugins: [
rollupReplace({
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
}),
rollupBabel({
envName: "babel-parser",
}),
rollupNodeResolve(),
],
})
.then(bundle => {
return bundle.write({
file: path.join(pkg, "lib/index.js"),
format: "cjs",
name: "babel-parser",
sourcemap: process.env.NODE_ENV !== "production",
});
});
})
);
}
gulp.task("build", function() {
const bundles = ["packages/babel-parser"];
const bundles = ["packages/babel-parser"];
return merge([buildBabel(/* exclude */ bundles), buildRollup(bundles)]);
});
gulp.task("build-rollup", () => buildRollup(bundles));
gulp.task("build-babel", () => buildBabel(/* exclude */ bundles));
gulp.task("build", gulp.parallel("build-rollup", "build-babel"));
gulp.task("default", gulp.series("build"));
@@ -138,7 +140,7 @@ registerStandalonePackageTask(
"babel",
"Babel",
path.join(__dirname, "packages"),
require("./packages/babel-core/package.json").version
require("./packages/babel-standalone/package.json").version
);
const presetEnvWebpackPlugins = [
@@ -167,6 +169,6 @@ registerStandalonePackageTask(
"babel-preset-env",
"babelPresetEnv",
path.join(__dirname, "packages"),
require("./packages/babel-preset-env/package.json").version,
require("./packages/babel-preset-env-standalone/package.json").version,
presetEnvWebpackPlugins
);

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
Copyright (c) 2014-present Sebastian McKenzie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -1,6 +1,6 @@
MAKEFLAGS = -j1
FLOW_COMMIT = e192e1a4793dd8e43415fbfe8046d832cb513c8b
TEST262_COMMIT = 238c88d4a084d9928372954e2fec54af2c951281
FLOW_COMMIT = 09669846b7a7ca5a6c23c12d56bb3bebdafd67e9
TEST262_COMMIT = de567d3aa5de4eaa11e00131d26b9fe77997dfb0
# Fix color output until TravisCI fixes https://github.com/travis-ci/travis-ci/issues/7967
export FORCE_COLOR = true
@@ -11,12 +11,13 @@ SOURCES = packages codemods
build: clean clean-lib
./node_modules/.bin/gulp build
node ./packages/babel-standalone/scripts/generate.js
node ./packages/babel-types/scripts/generateTypeHelpers.js
# call build again as the generated files might need to be compiled again.
./node_modules/.bin/gulp build
# generate flow and typescript typings
node scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
node scripts/generators/typescript.js > ./packages/babel-types/lib/index.d.ts
node packages/babel-types/scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
node packages/babel-types/scripts/generators/typescript.js > ./packages/babel-types/lib/index.d.ts
ifneq ("$(BABEL_COVERAGE)", "true")
make build-standalone
make build-preset-env-standalone
@@ -28,6 +29,12 @@ build-standalone:
build-preset-env-standalone:
./node_modules/.bin/gulp build-babel-preset-env-standalone
prepublish-build-standalone:
BABEL_ENV=production IS_PUBLISH=true ./node_modules/.bin/gulp build-babel-standalone
prepublish-build-preset-env-standalone:
BABEL_ENV=production IS_PUBLISH=true ./node_modules/.bin/gulp build-babel-preset-env-standalone
build-dist: build
cd packages/babel-polyfill; \
scripts/build-dist.sh
@@ -40,7 +47,8 @@ watch: clean clean-lib
# development too.
BABEL_ENV=development ./node_modules/.bin/gulp build-no-bundle
node ./packages/babel-types/scripts/generateTypeHelpers.js
node scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
node packages/babel-types/scripts/generators/flow.js > ./packages/babel-types/lib/index.js.flow
node packages/babel-types/scripts/generators/typescript.js > ./packages/babel-types/lib/index.d.ts
BABEL_ENV=development ./node_modules/.bin/gulp watch
flow:
@@ -56,6 +64,7 @@ fix-json:
./node_modules/.bin/prettier "{packages,codemod}/*/test/fixtures/**/options.json" --write --loglevel warn
clean: test-clean
rm -f .npmrc
rm -rf packages/babel-polyfill/browser*
rm -rf packages/babel-polyfill/dist
rm -rf coverage
@@ -96,7 +105,7 @@ test-flow-update-whitelist:
bootstrap-test262:
rm -rf ./build/test262
mkdir -p ./build
git clone --branch=master --single-branch --shallow-since=2018-11-01 https://github.com/tc39/test262.git ./build/test262
git clone --branch=master --single-branch --shallow-since=2019-01-01 https://github.com/tc39/test262.git ./build/test262
cd build/test262 && git checkout $(TEST262_COMMIT)
test-test262:
@@ -115,22 +124,39 @@ prepublish-build:
rm -rf packages/babel-runtime/helpers
rm -rf packages/babel-runtime-corejs2/helpers
rm -rf packages/babel-runtime-corejs2/core-js
BABEL_ENV=production IS_PUBLISH=true make build-dist
NODE_ENV=production BABEL_ENV=production make build-dist
make clone-license
prepublish:
git pull --rebase
make bootstrap-only
make prepublish-build
make test
new-version:
git pull --rebase
./node_modules/.bin/lerna version --force-publish="@babel/runtime,@babel/runtime-corejs2,@babel/runtime-corejs3,@babel/standalone,@babel/preset-env-standalone"
# NOTE: Run make new-version first
publish: prepublish
# --only-explicit-updates
./node_modules/.bin/lerna publish --force-publish="@babel/runtime,@babel/runtime-corejs2" --dangerously-only-publish-explicit-updates-this-is-a-custom-flag-for-babel-and-you-should-not-be-using-it-just-deal-with-more-packages-being-published-it-is-not-a-big-deal
./node_modules/.bin/lerna publish from-git --require-scripts
make clean
bootstrap: clean-all
publish-ci: prepublish
ifneq ("$(NPM_TOKEN)", "")
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
else
echo "Missing NPM_TOKEN env var"
exit 1
endif
./node_modules/.bin/lerna publish from-git --require-scripts --yes
rm -f .npmrc
make clean
bootstrap-only: clean-all
yarn --ignore-engines
./node_modules/.bin/lerna bootstrap -- --ignore-engines
bootstrap: bootstrap-only
make build
cd packages/babel-plugin-transform-runtime; \
node scripts/build-dist.js

View File

@@ -8,12 +8,16 @@
The compiler for writing next generation JavaScript.
</p>
<p align="center">
<a href="https://www.npmjs.com/package/@babel/core"><img alt="v7 npm Downloads" src="https://img.shields.io/npm/dm/@babel/core.svg?maxAge=43200&label=v7%20downloads"></a>
<a href="https://www.npmjs.com/package/babel-core"><img alt="v6 npm Downloads" src="https://img.shields.io/npm/dm/babel-core.svg?maxAge=43200&label=v6%20downloads"></a>
</p>
<p align="center">
<a href="https://travis-ci.org/babel/babel"><img alt="Travis Status" src="https://img.shields.io/travis/babel/babel/master.svg?label=travis&maxAge=43200"></a>
<a href="https://circleci.com/gh/babel/babel"><img alt="CircleCI Status" src="https://img.shields.io/circleci/project/github/babel/babel/master.svg?label=circle&maxAge=43200"></a>
<a href="https://codecov.io/github/babel/babel"><img alt="Coverage Status" src="https://img.shields.io/codecov/c/github/babel/babel/master.svg?maxAge=43200"></a>
<a href="https://slack.babeljs.io/"><img alt="Slack Status" src="https://slack.babeljs.io/badge.svg"></a>
<a href="https://www.npmjs.com/package/babel-core"><img alt="npm Downloads" src="https://img.shields.io/npm/dm/babel-core.svg?maxAge=43200"></a>
<a href="https://twitter.com/intent/follow?screen_name=babeljs"><img alt="Follow on Twitter" src="https://img.shields.io/twitter/follow/babeljs.svg?style=social&label=Follow"></a>
</p>
<h2 align="center">Supporting Babel</h2>
@@ -27,11 +31,11 @@
Babel (pronounced ["babble"](https://soundcloud.com/sebmck/how-to-pronounce-babel)) is a community-driven project used by many companies and projects, and is maintained by a group of [volunteers](https://babeljs.io/team). If you'd like to help support the future of the project, please consider:
- Giving developer time on the project. (Message us on [Twitter](https://twitter.com/babeljs) or [Slack](https://slack.babeljs.io/) for guidance!)
- Giving funds by becoming a sponsor (see below)!
- Giving funds by becoming a sponsor on [Open Collective](https://opencollective.com/babel) or [Patreon](https://www.patreon.com/henryzhu)!
## Open Collective Sponsors
## Sponsors
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/babel#sponsor)]
Our top sponsors are shown below! [[Become a sponsor](https://opencollective.com/babel#sponsor)]
<a href="https://opencollective.com/babel/sponsor/0/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/1/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/1/avatar.svg"></a>
@@ -48,35 +52,6 @@ Become a sponsor and get your logo on our README on Github with a link to your s
<a href="https://opencollective.com/babel/sponsor/12/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/13/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/14/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/15/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/15/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/16/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/16/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/17/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/17/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/18/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/18/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/19/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/19/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/20/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/20/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/21/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/21/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/22/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/22/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/23/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/23/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/24/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/24/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/25/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/25/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/26/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/26/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/27/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/27/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/28/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/28/avatar.svg"></a>
<a href="https://opencollective.com/babel/sponsor/29/website" target="_blank"><img src="https://opencollective.com/babel/sponsor/29/avatar.svg"></a>
## Patreon Sponsors
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://www.patreon.com/henryzhu)]
## Silver
<a href="https://issue.sh/?utm_medium=github&utm_campaign=babel" target="_blank"><img src="https://user-images.githubusercontent.com/5557143/43912065-c8cdff78-9c33-11e8-829a-0b4166ccc215.png"></a>
## Bronze
<a href="http://teamextension.io/" target="_blank"><img src="https://teamextension.io/dist/img/logo/te-logo-compact.png" height="64"></a>
<a href="https://webflow.com/" target="_blank"><img src="https://opencollective.com/proxy/images/?src=https%3A%2F%2Fopencollective-production.s3-us-west-1.amazonaws.com%2F4a5024b0-8cf2-11e7-b1a2-b30b1de1463c.png&height=64"></a>
<p><a href="https://twitter.com/mikesherov">Mike Sherov</a></p>
## Intro
@@ -103,7 +78,7 @@ Try it out at our [REPL](https://babeljs.io/repl/build/master#?code_lz=NoRgNATGD
### Who maintains Babel?
Mostly a handful of volunteers! Please check out our [team page](https://babeljs.io/team)!
Mostly a handful of volunteers, funded by you! Please check out our [team page](https://babeljs.io/team)!
### Looking for support?

19
SECURITY.md Normal file
View File

@@ -0,0 +1,19 @@
# Security Policy
## Supported Versions
This is the list of versions of `babel` which are
currently being supported with security updates.
| Version | Supported |
| -------- | ------------------ |
| 7.x | :white_check_mark: |
| 6.26.x | :white_check_mark: |
| < 6.26.0 | :x: |
## Reporting a Vulnerability
To report a vulnerability please send an email with the details to security@babeljs.io.
This will help us to assess the risk and start the necessary steps.
Thanks for helping to keep babel secure.

23
SONG.md
View File

@@ -19,7 +19,8 @@ Generators, const and let
I used them all without regret
And its a terse and a destructured Hallelujah
Hallelujah etc.
Hallelujah, Hallelujah
Hallelujah, Hallelujah
Well my faith was strong but I needed proof
The standard was my source of truth
@@ -28,7 +29,9 @@ So even though you werent impressed
I checked the build against the spec
And its a more-or-less compliant Hallelujah
Hallelujah etc.
Hallelujah, Hallelujah
Hallelujah, Hallelujah
Now you say the build steps too complex
And you claim no need for ES Next
@@ -37,7 +40,9 @@ But your code grows older with each line
Its a joyless dirge on a withered vine
Its a threnody for a bygone Hallelujah
Hallelujah etc.
Hallelujah, Hallelujah
Hallelujah, Hallelujah
Yes I learned about the danger signs
How theyd polyfilled a thousand lines
@@ -46,7 +51,9 @@ Still I disregarded common sense
Now my source is small but the builds immense
And its a slow and unresponsive Hallelujah
Hallelujah etc.
Hallelujah, Hallelujah
Hallelujah, Hallelujah
There was a time when they let me know
Whats really going on below
@@ -55,7 +62,9 @@ And debuggings not a progress march
Its a frenzied fumble in the dark
Its a labyrinthine search for Hallelujah
Hallelujah etc.
Hallelujah, Hallelujah
Hallelujah, Hallelujah
Well, maybe theres a god up there
But all I ever got from prayers
@@ -64,6 +73,8 @@ And that anguished cry you hear at night
Is the plugin I forgot to write
Its a cold and its a broken Hallelujah
Hallelujah etc.
Hallelujah, Hallelujah
Hallelujah, Hallelujah
[Angus Croll](https://github.com/angus-c)

View File

@@ -5,21 +5,26 @@ module.exports = function(api) {
const includeCoverage = process.env.BABEL_COVERAGE === "true";
const envOpts = {
const envOptsNoTargets = {
loose: true,
modules: false,
exclude: ["transform-typeof-symbol"],
};
const envOpts = Object.assign({}, envOptsNoTargets);
let convertESM = true;
let ignoreLib = true;
let includeRuntime = false;
const nodeVersion = "6.9";
switch (env) {
// Configs used during bundling builds.
case "babel-parser":
convertESM = false;
ignoreLib = false;
envOpts.targets = {
node: nodeVersion,
};
break;
case "standalone":
convertESM = false;
@@ -29,7 +34,7 @@ module.exports = function(api) {
case "production":
// Config during builds before publish.
envOpts.targets = {
node: "6.9",
node: nodeVersion,
};
break;
case "development":
@@ -93,6 +98,11 @@ module.exports = function(api) {
convertESM ? "@babel/transform-modules-commonjs" : null,
].filter(Boolean),
},
{
test: "./packages/babel-polyfill",
presets: [["@babel/env", envOptsNoTargets]],
plugins: [["@babel/transform-modules-commonjs", { lazy: false }]],
},
{
// The vast majority of our src files are modules, but we use
// unambiguous to keep things simple until we get around to renaming
@@ -111,9 +121,11 @@ module.exports = function(api) {
"packages/babel-runtime",
/[\\/]node_modules[\\/](?:@babel\/runtime|babel-runtime|core-js)[\\/]/,
],
plugins: [includeRuntime ? "@babel/transform-runtime" : null].filter(
Boolean
),
plugins: [
includeRuntime
? ["@babel/transform-runtime", { version: "7.4.4" }]
: null,
].filter(Boolean),
},
].filter(Boolean),
};

View File

@@ -8,3 +8,5 @@ coverage:
target: "80%"
patch:
enabled: false
ignore:
- packages/babel-types/src/*/generated/index.js

View File

@@ -1,5 +0,0 @@
try {
throw 0;
} catch (e) {
let e = new TypeError('Duplicate variable declaration; will throw an error.');
}

View File

@@ -1,4 +0,0 @@
{
"plugins": ["../../../../lib"],
"throws": "Duplicate declaration \"e\""
}

View File

@@ -1,11 +0,0 @@
"use strict";
const noDeprecatedClone = require("./scripts/eslint_rules/no-deprecated-clone");
const noUndefinedIdentifier = require("./scripts/eslint_rules/no-undefined-identifier");
const pluginName = require("./scripts/eslint_rules/plugin-name");
module.exports = {
"no-deprecated-clone": noDeprecatedClone,
"no-undefined-identifier": noUndefinedIdentifier,
"plugin-name": pluginName,
};

View File

@@ -1,34 +1,34 @@
{
"lerna": "2.11.0",
"version": "7.2.0",
"version": "7.5.4",
"changelog": {
"repo": "babel/babel",
"cacheDir": ".changelog",
"labels": {
"PR: Spec Compliancy :eyeglasses:": ":eyeglasses: Spec Compliancy",
"PR: Spec Compliance :eyeglasses:": ":eyeglasses: Spec Compliance",
"PR: Breaking Change :boom:": ":boom: Breaking Change",
"PR: New Feature :rocket:": ":rocket: New Feature",
"PR: Bug Fix :bug:": ":bug: Bug Fix",
"PR: Polish :nail_care:": ":nail_care: Polish",
"PR: Docs :memo:": ":memo: Documentation",
"PR: Internal :house:": ":house: Internal"
"PR: Internal :house:": ":house: Internal",
"PR: Performance :running_woman:": ":running_woman: Performance"
}
},
"commands": {
"command": {
"publish": {
"ignore": [
"ignoreChanges": [
"*.md",
"*.json",
"*.txt",
"test/**",
"codemods/**",
"package.json"
"# We ignore every JSON file, except for built-in-modules, built-ins and plugins defined in babel-preset-env/data.",
"@(!(built-in-modules|built-ins|plugins|package)).json"
]
}
},
"packages": [
"packages/*",
"codemods/*"
"codemods/*",
"packages/*"
],
"npmClient": "yarn",
"npmClientArgs": [

View File

@@ -27,16 +27,31 @@ declare module "lodash/merge" {
}
declare module "semver" {
declare class SemVer {
build: Array<string>;
loose: ?boolean;
major: number;
minor: number;
patch: number;
prerelease: Array<string | number>;
raw: string;
version: string;
constructor(version: string | SemVer): SemVer;
}
declare module.exports: {
valid(v: string): boolean;
SemVer: SemVer;
coerce(version: string | SemVer): SemVer | null;
gt(v1: string, v2: string): boolean;
intersects(r1: string, r2: string): boolean;
lt(v1: string, v2: string): boolean;
major(v: string): number;
minor(v: string): number;
patch(v: string): number;
satisfies(v1: string, r1: string): boolean;
intersects(r1: string, r2: string): boolean;
valid(v: string): boolean;
}
}
@@ -180,3 +195,13 @@ declare module "js-levenshtein" {
(string, string): number,
};
}
declare module "core-js-compat/data" {
declare type Target = "node" | "chrome" | "opera" | "edge" | "firefox" | "safari" | "ie" | "ios" | "android" | "electron" | "samsung";
declare module.exports: {
[key: string]: {
[target: Target]: string;
}
}
}

View File

@@ -9,68 +9,72 @@
"test": "make test"
},
"devDependencies": {
"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.6",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
"@babel/plugin-transform-modules-commonjs": "^7.1.0",
"@babel/plugin-transform-runtime": "^7.1.0",
"@babel/preset-env": "^7.1.6",
"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/eslint-plugin-development": "^1.0.1",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/plugin-proposal-export-namespace-from": "^7.2.0",
"@babel/plugin-proposal-numeric-separator": "^7.2.0",
"@babel/plugin-transform-modules-commonjs": "^7.4.4",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-env": "^7.4.5",
"@babel/preset-flow": "^7.0.0",
"@babel/register": "^7.0.0",
"@babel/runtime": "^7.1.5",
"babel-core": "^7.0.0-0",
"babel-eslint": "^10.0.1",
"babel-jest": "^23.6.0",
"babel-loader": "^8.0.4",
"babel-plugin-transform-charcodes": "^0.1.0",
"browserify": "^16.2.2",
"@babel/register": "^7.4.4",
"@babel/runtime": "^7.4.5",
"babel-eslint": "^11.0.0-beta.0",
"babel-jest": "^24.8.0",
"babel-loader": "^8.0.6",
"babel-plugin-transform-charcodes": "^0.2.0",
"browserify": "^16.2.3",
"bundle-collapser": "^1.2.1",
"chalk": "^2.3.2",
"charcodes": "^0.1.0",
"chalk": "^2.4.2",
"charcodes": "^0.2.0",
"derequire": "^2.0.2",
"duplicate-package-checker-webpack-plugin": "^2.1.0",
"enhanced-resolve": "^3.0.0",
"eslint": "^5.9.0",
"eslint-config-babel": "^8.0.2",
"eslint-plugin-flowtype": "^3.2.0",
"eslint-plugin-local-rules": "0.1.0",
"eslint-plugin-prettier": "^3.0.0",
"flow-bin": "^0.82.0",
"graceful-fs": "^4.1.11",
"gulp": "^4.0.0",
"eslint": "^5.16.0",
"eslint-config-babel": "^9.0.0",
"eslint-plugin-flowtype": "^3.8.2",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-prettier": "^3.1.0",
"fancy-log": "^1.3.3",
"flow-bin": "^0.94.0",
"graceful-fs": "^4.1.15",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-filter": "^5.1.0",
"gulp-newer": "^1.0.0",
"gulp-plumber": "^1.2.0",
"gulp-plumber": "^1.2.1",
"gulp-rename": "^1.4.0",
"gulp-uglify": "^3.0.1",
"gulp-util": "^3.0.7",
"gulp-uglify": "^3.0.2",
"gulp-watch": "^5.0.1",
"husky": "^1.2.0",
"jest": "^23.6.0",
"lerna": "^2.11.0",
"husky": "^2.3.0",
"jest": "^24.8.0",
"lerna": "^3.14.2",
"lerna-changelog": "^0.5.0",
"lint-staged": "^8.1.0",
"lodash": "^4.17.10",
"lint-staged": "^8.1.7",
"lodash": "^4.17.11",
"merge-stream": "^1.0.1",
"output-file-sync": "^2.0.0",
"prettier": "^1.15.2",
"prettier": "^1.17.1",
"pump": "^3.0.0",
"rimraf": "^2.4.3",
"rollup-plugin-babel": "^4.0.0-beta.0",
"rollup-plugin-node-resolve": "^3.0.2",
"rollup-stream": "^1.24.1",
"rimraf": "^2.6.3",
"rollup": "^1.12.0",
"rollup-plugin-babel": "^4.0.0",
"rollup-plugin-node-resolve": "^5.0.0",
"rollup-plugin-replace": "^2.2.0",
"test262-stream": "^1.2.0",
"through2": "^2.0.0",
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0",
"warnings-to-errors-webpack-plugin": "^2.0.0",
"webpack": "^3.4.1",
"webpack-dependency-suite": "^2.4.4",
"webpack-stream": "^4.0.0"
},
"resolutions": {
"@lerna/**/@lerna/collect-updates": "https://github.com/nicolo-ribaudo/lerna.git#babel-collect-updates"
},
"engines": {
"node": ">= 6.9.0 < 12.0.0",
"node": ">= 6.9.0 < 13.0.0",
"npm": ">= 3.x <= 6.x",
"yarn": ">=0.27.5 || >=1.0.0-20170811"
},
@@ -105,7 +109,9 @@
"_browser\\.js"
],
"testEnvironment": "node",
"setupTestFrameworkScriptFile": "<rootDir>/test/testSetupFile.js",
"setupFilesAfterEnv": [
"<rootDir>/test/testSetupFile.js"
],
"transformIgnorePatterns": [
"/node_modules/",
"<rootDir>/packages/babel-standalone/babel(\\.min)?\\.js",
@@ -124,6 +130,10 @@
"/test/tmp/",
"/test/__data__/",
"<rootDir>/build/"
]
}
],
"moduleNameMapper": {
"^@babel/([a-zA-Z0-9_-]+)$": "<rootDir>/packages/babel-$1/"
}
},
"dependencies": {}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/cli",
"version": "7.2.0",
"version": "7.5.0",
"description": "Babel command line.",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
@@ -23,21 +23,21 @@
"convert-source-map": "^1.1.0",
"fs-readdir-recursive": "^1.1.0",
"glob": "^7.0.0",
"lodash": "^4.17.10",
"lodash": "^4.17.11",
"mkdirp": "^0.5.1",
"output-file-sync": "^2.0.0",
"slash": "^2.0.0",
"source-map": "^0.5.0"
},
"optionalDependencies": {
"chokidar": "^2.0.3"
"chokidar": "^2.0.4"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.2.0",
"@babel/helper-fixtures": "^7.2.0"
"@babel/core": "^7.5.0",
"@babel/helper-fixtures": "^7.4.4"
},
"bin": {
"babel": "./bin/babel.js",

View File

@@ -22,7 +22,7 @@ commander.option(
"comma-separated list of plugin names",
collect,
);
commander.option("--config-file [path]", "Path a to .babelrc file to use");
commander.option("--config-file [path]", "Path to a .babelrc file to use");
commander.option(
"--env-name [name]",
"The name of the 'env' to use when loading configs and plugins. " +

View File

@@ -86,7 +86,7 @@ const assertTest = function(stdout, stderr, opts, cwd) {
}
if (opts.outFiles) {
const actualFiles = readDir(path.join(tmpLoc), fileFilter);
const actualFiles = readDir(tmpLoc, fileFilter);
Object.keys(actualFiles).forEach(function(filename) {
if (
@@ -171,12 +171,12 @@ const buildTest = function(binName, testName, opts) {
};
fs.readdirSync(fixtureLoc).forEach(function(binName) {
if (binName[0] === ".") return;
if (binName.startsWith(".")) return;
const suiteLoc = path.join(fixtureLoc, binName);
describe("bin/" + binName, function() {
fs.readdirSync(suiteLoc).forEach(function(testName) {
if (testName[0] === ".") return;
if (testName.startsWith(".")) return;
const testLoc = path.join(suiteLoc, testName);

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/core",
"version": "7.2.0",
"version": "7.5.4",
"description": "Babel compiler core.",
"main": "lib/index.js",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
@@ -34,22 +34,22 @@
},
"dependencies": {
"@babel/code-frame": "^7.0.0",
"@babel/generator": "^7.2.0",
"@babel/helpers": "^7.2.0",
"@babel/parser": "^7.2.0",
"@babel/template": "^7.1.2",
"@babel/traverse": "^7.1.6",
"@babel/types": "^7.2.0",
"@babel/generator": "^7.5.0",
"@babel/helpers": "^7.5.4",
"@babel/parser": "^7.5.0",
"@babel/template": "^7.4.4",
"@babel/traverse": "^7.5.0",
"@babel/types": "^7.5.0",
"convert-source-map": "^1.1.0",
"debug": "^4.1.0",
"json5": "^2.1.0",
"lodash": "^4.17.10",
"lodash": "^4.17.11",
"resolve": "^1.3.2",
"semver": "^5.4.1",
"source-map": "^0.5.0"
},
"devDependencies": {
"@babel/helper-transform-fixture-test-runner": "^7.0.0",
"@babel/register": "^7.0.0"
"@babel/helper-transform-fixture-test-runner": "^7.5.0",
"@babel/register": "^7.4.4"
}
}

View File

@@ -54,6 +54,7 @@ function makeCachedFunction<
ArgT,
ResultT,
SideChannel,
// $FlowIssue https://github.com/facebook/flow/issues/4528
Cache: CacheMap<ArgT, ResultT, SideChannel>,
>(
callCache: Cache,

View File

@@ -10,7 +10,7 @@ import {
makeWeakCache,
type CacheConfigurator,
} from "../caching";
import makeAPI from "../helpers/config-api";
import makeAPI, { type PluginAPI } from "../helpers/config-api";
import { makeStaticFileCache } from "./utils";
import pathPatternToRegex from "../pattern-to-regex";
import type { FilePackageData, RelativeConfig, ConfigFile } from "./types";
@@ -114,7 +114,7 @@ export function findRootConfig(
const conf = readConfig(filepath, envName, caller);
if (conf) {
debug("Found root config %o in $o.", BABEL_CONFIG_JS_FILENAME, dirname);
debug("Found root config %o in %o.", BABEL_CONFIG_JS_FILENAME, dirname);
}
return conf;
}
@@ -132,7 +132,7 @@ export function loadConfig(
throw new Error(`Config file ${filepath} contains no configuration data`);
}
debug("Loaded config %o from $o.", name, dirname);
debug("Loaded config %o from %o.", name, dirname);
return conf;
}
@@ -150,7 +150,7 @@ const LOADING_CONFIGS = new Set();
const readConfigJS = makeStrongCache(
(
filepath,
filepath: string,
cache: CacheConfigurator<{
envName: string,
caller: CallerMetadata | void,
@@ -193,7 +193,7 @@ const readConfigJS = makeStrongCache(
}
if (typeof options === "function") {
options = options(makeAPI(cache));
options = ((options: any): (api: PluginAPI) => {})(makeAPI(cache));
if (!cache.configured()) throwConfigError();
}

View File

@@ -202,7 +202,7 @@ const loadDescriptor = makeWeakCache(
if (typeof item.then === "function") {
throw new Error(
`You appear to be using an async plugin, ` +
`which your current version of Babel does not support.` +
`which your current version of Babel does not support. ` +
`If you're using a published plugin, ` +
`you may need to upgrade your @babel/core version.`,
);

View File

@@ -231,7 +231,7 @@ function assertIgnoreItem(loc: GeneralPath, value: mixed): IgnoreItem {
throw new Error(
`${msg(
loc,
)} must be an array of string/Funtion/RegExp values, or undefined`,
)} must be an array of string/Function/RegExp values, or undefined`,
);
}
return value;
@@ -337,7 +337,7 @@ function assertPluginItem(loc: GeneralPath, value: mixed): PluginItem {
if (
opts !== undefined &&
opts !== false &&
(typeof opts !== "object" || Array.isArray(opts))
(typeof opts !== "object" || Array.isArray(opts) || opts === null)
) {
throw new Error(
`${msg(access(loc, 1))} must be an object, false, or undefined`,

View File

@@ -350,7 +350,7 @@ function validateNested(loc: NestingPath, opts: {}) {
NONPRESET_VALIDATORS[key] ||
BABELRC_VALIDATORS[key] ||
ROOT_VALIDATORS[key] ||
throwUnknownError;
(throwUnknownError: Validator<void>);
validator(optLoc, opts[key]);
});

View File

@@ -183,7 +183,7 @@ export default class File {
// and this fails because a prerelease version can only satisfy a range
// if it is a prerelease within the same major/minor/patch range.
//
// Note: If this is found to have issues, please also revist the logic in
// Note: If this is found to have issues, please also revisit the logic in
// transform-runtime's definitions.js file.
if (semver.valid(versionRange)) versionRange = `^${versionRange}`;

View File

@@ -93,7 +93,7 @@ function transformFile(file: File, pluginPasses: PluginPasses): void {
if (isThenable(result)) {
throw new Error(
`You appear to be using an plugin with an async .pre, ` +
`which your current version of Babel does not support.` +
`which your current version of Babel does not support. ` +
`If you're using a published plugin, you may need to upgrade ` +
`your @babel/core version.`,
);
@@ -117,7 +117,7 @@ function transformFile(file: File, pluginPasses: PluginPasses): void {
if (isThenable(result)) {
throw new Error(
`You appear to be using an plugin with an async .post, ` +
`which your current version of Babel does not support.` +
`which your current version of Babel does not support. ` +
`If you're using a published plugin, you may need to upgrade ` +
`your @babel/core version.`,
);
@@ -131,6 +131,7 @@ function isThenable(val: mixed): boolean {
return (
!!val &&
(typeof val === "object" || typeof val === "function") &&
!!val.then &&
typeof val.then === "function"
);
}

View File

@@ -2,8 +2,8 @@ function foo() {
var input = ['a', 'b', 'c'];
var output = {};
for (var _i = 0; _i < input.length; _i++) {
var c = input[_i];
for (var _i = 0, _input = input; _i < _input.length; _i++) {
var c = _input[_i];
var name = c;
output[name] = name;
}

View File

@@ -3,7 +3,7 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports["default"] = void 0;
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
@@ -40,7 +40,7 @@ function () {
return _context.stop();
}
}
}, _callee, this);
}, _callee);
}));
function bar() {
@@ -54,7 +54,7 @@ function () {
return Foo;
}();
exports.default = Foo;
exports["default"] = Foo;
function foo() {
return _foo.apply(this, arguments);
@@ -86,7 +86,7 @@ function _foo() {
return _context2.stop();
}
}
}, _callee2, this);
}, _callee2);
}));
return _bar2.apply(this, arguments);
};
@@ -100,7 +100,7 @@ function _foo() {
return _context3.stop();
}
}
}, _callee3, this);
}, _callee3);
}));
return _foo.apply(this, arguments);
}

View File

@@ -38,6 +38,17 @@ describe("option-manager", () => {
expect(calls).toEqual([]);
});
it("throws for null options", () => {
const { calls, plugin } = makePlugin();
expect(() => {
loadOptions({
plugins: [[plugin, null]],
}).toThrow(/.plugins[0][1] must be an object, false, or undefined/);
});
expect(calls).toEqual([]);
});
it("should not throw if a repeated plugin has a different name", () => {
const { calls: calls1, plugin: plugin1 } = makePlugin();
const { calls: calls2, plugin: plugin2 } = makePlugin();
@@ -87,7 +98,6 @@ describe("option-manager", () => {
expect(calls1).toEqual([{ arg: 1 }]);
expect(calls2).toEqual([{ arg: 2 }]);
});
it("should merge .env[] presets with parent presets", () => {
const { calls: calls1, plugin: preset1 } = makePlugin();
const { calls: calls2, plugin: preset2 } = makePlugin();

View File

@@ -1,6 +1,6 @@
{
"name": "@babel/generator",
"version": "7.2.0",
"version": "7.5.0",
"description": "Turns an AST into code.",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"homepage": "https://babeljs.io/",
@@ -14,14 +14,14 @@
"lib"
],
"dependencies": {
"@babel/types": "^7.2.0",
"@babel/types": "^7.5.0",
"jsesc": "^2.5.1",
"lodash": "^4.17.10",
"lodash": "^4.17.11",
"source-map": "^0.5.0",
"trim-right": "^1.0.1"
},
"devDependencies": {
"@babel/helper-fixtures": "^7.2.0",
"@babel/parser": "^7.2.0"
"@babel/helper-fixtures": "^7.4.4",
"@babel/parser": "^7.5.0"
}
}

View File

@@ -235,7 +235,7 @@ export default class Buffer {
source(prop: string, loc: Location, force?: boolean): void {
if (prop && !loc) return;
// Since this is called extremly often, we re-use the same _sourcePosition
// Since this is called extremely often, we re-use the same _sourcePosition
// object for the whole lifetime of the buffer.
this._normalizePosition(prop, loc, this._sourcePosition, force);
}

View File

@@ -50,8 +50,45 @@ export function Directive(node: Object) {
this.semicolon();
}
// These regexes match an even number of \ followed by a quote
const unescapedSingleQuoteRE = /(?:^|[^\\])(?:\\\\)*'/;
const unescapedDoubleQuoteRE = /(?:^|[^\\])(?:\\\\)*"/;
export function DirectiveLiteral(node: Object) {
const raw = this.getPossibleRaw(node);
if (raw != null) {
this.token(raw);
return;
}
const { value } = node;
// NOTE: In directives we can't change escapings,
// because they change the behavior.
// e.g. "us\x65 string" (\x65 is e) is not a "use strict" directive.
if (!unescapedDoubleQuoteRE.test(value)) {
this.token(`"${value}"`);
} else if (!unescapedSingleQuoteRE.test(value)) {
this.token(`'${value}'`);
} else {
throw new Error(
"Malformed AST: it is not possible to print a directive containing" +
" both unescaped single and double quotes.",
);
}
}
export function InterpreterDirective(node: Object) {
this.token(`#!${node.value}\n`);
}
export { StringLiteral as DirectiveLiteral } from "./types";
export function Placeholder(node: Object) {
this.token("%%");
this.print(node.name);
this.token("%%");
if (node.expectedNode === "Statement") {
this.semicolon();
}
}

View File

@@ -409,7 +409,7 @@ export function ObjectTypeAnnotation(node: Object) {
indent: true,
statement: true,
iterator: () => {
if (props.length !== 1) {
if (props.length !== 1 || node.inexact) {
this.token(",");
this.space();
}
@@ -419,6 +419,15 @@ export function ObjectTypeAnnotation(node: Object) {
this.space();
}
if (node.inexact) {
this.indent();
this.token("...");
if (props.length) {
this.newline();
}
this.dedent();
}
if (node.exact) {
this.token("|}");
} else {

View File

@@ -7,6 +7,10 @@ export function Identifier(node: Object) {
});
}
export function ArgumentPlaceholder() {
this.token("?");
}
export function RestElement(node: Object) {
this.token("...");
this.print(node.argument, node);
@@ -151,3 +155,15 @@ export function BigIntLiteral(node: Object) {
}
this.token(node.value);
}
export function PipelineTopicExpression(node: Object) {
this.print(node.expression, node);
}
export function PipelineBareFunction(node: Object) {
this.print(node.callee, node);
}
export function PipelinePrimaryTopicReference() {
this.token("#");
}

View File

@@ -231,7 +231,7 @@ export function tsPrintBraced(members, node) {
}
export function TSArrayType(node) {
this.print(node.elementType);
this.print(node.elementType, node);
this.token("[]");
}
@@ -476,6 +476,21 @@ export function TSModuleBlock(node) {
this.tsPrintBraced(node.body, node);
}
export function TSImportType(node) {
const { argument, qualifier, typeParameters } = node;
this.word("import");
this.token("(");
this.print(argument, node);
this.token(")");
if (qualifier) {
this.token(".");
this.print(qualifier, node);
}
if (typeParameters) {
this.print(typeParameters, node);
}
}
export function TSImportEqualsDeclaration(node) {
const { isExport, id, moduleReference } = node;
if (isExport) {

View File

@@ -35,7 +35,16 @@ export function NullableTypeAnnotation(node: Object, parent: Object): boolean {
return t.isArrayTypeAnnotation(parent);
}
export { NullableTypeAnnotation as FunctionTypeAnnotation };
export function FunctionTypeAnnotation(node: Object, parent: Object): boolean {
return (
// (() => A) | (() => B)
t.isUnionTypeAnnotation(parent) ||
// (() => A) & (() => B)
t.isIntersectionTypeAnnotation(parent) ||
// (() => A)[]
t.isArrayTypeAnnotation(parent)
);
}
export function UpdateExpression(node: Object, parent: Object): boolean {
return (
@@ -127,6 +136,18 @@ export function TSTypeAssertion() {
return true;
}
export function TSUnionType(node: Object, parent: Object): boolean {
return (
t.isTSArrayType(parent) ||
t.isTSOptionalType(parent) ||
t.isTSIntersectionType(parent) ||
t.isTSUnionType(parent) ||
t.isTSRestType(parent)
);
}
export { TSUnionType as TSIntersectionType };
export function BinaryExpression(node: Object, parent: Object): boolean {
// let i = (1 in []);
// for ((1 in []);;);

View File

@@ -367,7 +367,7 @@ export default class Printer {
const loc = t.isProgram(node) || t.isFile(node) ? null : node.loc;
this.withSource("start", loc, () => {
this[node.type](node, parent);
printMethod.call(this, node, parent);
});
this._printTrailingComments(node);

View File

@@ -0,0 +1,12 @@
// One
(1);
/* Two */
(2);
(
// Three
3
);
(/* Four */ 4);

View File

@@ -0,0 +1,3 @@
{
"parserOpts": {"createParenthesizedExpressions": true}
}

View File

@@ -0,0 +1,10 @@
// One
(1);
/* Two */
(2);
( // Three
3);
(
/* Four */
4);

View File

@@ -4,7 +4,7 @@ function foo(l) {
);
}
function foo() {
function foo2() {
return (
1 && 2
) || 3;

View File

@@ -4,7 +4,7 @@ function foo(l) {
}
function foo() {
function foo2() {
return (
1 && 2 ||
3);

View File

@@ -2,8 +2,8 @@ var fn = async (
arg
) => {}
async (x)
=> {}
async (x) =>
{}
async x => {}

View File

@@ -0,0 +1,3 @@
{
"strictMode": false
}

View File

@@ -1 +1,2 @@
0; // Not a directive
"©";

View File

@@ -1 +1,2 @@
0;// Not a directive
"\u00A9";

View File

@@ -17,6 +17,7 @@ declare export * from 'asd';
declare export { a, b };
declare export {};
declare export { c, d } from 'bar';
var a, b;
declare module B {
declare export type B = {};
@@ -24,9 +25,9 @@ declare module B {
}
declare module "foo" { declare export type * from "bar"; }
declare export opaque type Foo;
declare export opaque type Foo1;
declare export opaque type Bar<T>;
declare export opaque type Baz: Foo;
declare export opaque type Foo<T>: Bar<T>;
declare export opaque type Foo<T>: Bar;
declare export opaque type Foo: Bar<T>;
declare export opaque type Foo3<T>: Bar<T>;
declare export opaque type Foo4<T>: Bar;
declare export opaque type Foo5: Bar<T>;

View File

@@ -26,6 +26,7 @@ declare export * from 'asd';
declare export { a, b };
declare export {};
declare export { c, d } from 'bar';
var a, b;
declare module B {
declare export type B = {};
declare export interface Moon {}
@@ -33,9 +34,9 @@ declare module B {
declare module "foo" {
declare export type * from "bar";
}
declare export opaque type Foo;
declare export opaque type Foo1;
declare export opaque type Bar<T>;
declare export opaque type Baz: Foo;
declare export opaque type Foo<T>: Bar<T>;
declare export opaque type Foo<T>: Bar;
declare export opaque type Foo: Bar<T>;
declare export opaque type Foo3<T>: Bar<T>;
declare export opaque type Foo4<T>: Bar;
declare export opaque type Foo5: Bar<T>;

View File

@@ -1,10 +1,10 @@
class C1<+T, -U> {}
function f<+T, -U>() {}
type T<+T, -U> = {};
type T = { +p: T };
type T = { -p: T };
type T = { +[k:K]: V };
type T = { -[k:K]: V };
type T2 = { +p: T };
type T3 = { -p: T };
type T4 = { +[k:K]: V };
type T5 = { -[k:K]: V };
interface I { +p: T }
interface I { -p: T }
interface I { +[k:K]: V }

View File

@@ -3,16 +3,16 @@ class C1<+T, -U> {}
function f<+T, -U>() {}
type T<+T, -U> = {};
type T = {
type T2 = {
+p: T
};
type T = {
type T3 = {
-p: T
};
type T = {
type T4 = {
+[k: K]: V
};
type T = {
type T5 = {
-[k: K]: V
};
interface I {

View File

@@ -1,5 +1,5 @@
class A implements B {}
class A implements B, C {}
declare class A implements B {}
declare class A mixins B implements C {}
declare class A implements B, C {}
class A1 implements B {}
class A2 implements B, C {}
declare class A3 implements B {}
declare class A4 mixins B implements C {}
declare class A5 implements B, C {}

View File

@@ -1,7 +1,7 @@
class A implements B {}
class A1 implements B {}
class A implements B, C {}
class A2 implements B, C {}
declare class A implements B {}
declare class A mixins B implements C {}
declare class A implements B, C {}
declare class A3 implements B {}
declare class A4 mixins B implements C {}
declare class A5 implements B, C {}

View File

@@ -1,3 +1,4 @@
type A = interface { p: string };
type B = interface extends X { p: string };
type C = interface extends X, Y { p: string };
type D = interface extends X.Y<Z> { p: string };

View File

@@ -6,4 +6,7 @@ type B = interface extends X {
};
type C = interface extends X, Y {
p: string
};
};
type D = interface extends X.Y<Z> {
p: string
};

View File

@@ -1,9 +1,9 @@
interface A {}
interface A extends B {}
interface A<T> extends B<T>, C<T> {}
interface A { foo: () => number; }
interface A1 {}
interface A2 extends B {}
interface A3<T> extends B<T>, C<T> {}
interface A4 { foo: () => number; }
interface Dictionary { [index: string]: string; length: number; }
class Foo implements Bar {}
class Foo extends Bar implements Bat, Man<number> {}
class Foo extends class Bar implements Bat {} {}
class Foo extends class Bar implements Bat {} implements Man {}
class Foo1 implements Bar {}
class Foo2 extends Bar implements Bat, Man<number> {}
class Foo3 extends class Bar implements Bat {} {}
class Foo4 extends class Bar implements Bat {} implements Man {}

View File

@@ -1,7 +1,7 @@
interface A {}
interface A extends B {}
interface A<T> extends B<T>, C<T> {}
interface A {
interface A1 {}
interface A2 extends B {}
interface A3<T> extends B<T>, C<T> {}
interface A4 {
foo: () => number
}
interface Dictionary {
@@ -9,10 +9,10 @@ interface Dictionary {
[index: string]: string,
}
class Foo implements Bar {}
class Foo1 implements Bar {}
class Foo extends Bar implements Bat, Man<number> {}
class Foo2 extends Bar implements Bat, Man<number> {}
class Foo extends class Bar implements Bat {} {}
class Foo3 extends class Bar implements Bat {} {}
class Foo extends class Bar implements Bat {} implements Man {}
class Foo4 extends class Bar implements Bat {} implements Man {}

View File

@@ -1,7 +1,7 @@
declare class C { static [[foo]]: T }
declare class C { [[foo]]: T }
interface T { [[foo]]: X }
interface T { [[foo]](): X }
type T = { [[foo]]: X }
type T = { [[foo]](): X }
type T = { [[foo]]?: X }
interface I { [[foo]]: X }
interface I { [[foo]](): X }
type T1 = { [[foo]]: X }
type T2 = { [[foo]](): X }
type T3 = { [[foo]]?: X }

View File

@@ -4,18 +4,18 @@ declare class C {
declare class C {
[[foo]]: T
}
interface T {
interface I {
[[foo]]: X
}
interface T {
interface I {
[[foo]]() => X
}
type T = {
type T1 = {
[[foo]]: X
};
type T = {
type T2 = {
[[foo]]() => X
};
type T = {
type T3 = {
[[foo]]?: X
};
};

View File

@@ -0,0 +1,4 @@
type T1 = { ... };
type T2 = { a: { b: { c: {...}, ... }, ... } }
type T3 = { foo: number, ... };
type T4 = { foo: number, bar: string, ... };

View File

@@ -0,0 +1,3 @@
{
"compact": true
}

View File

@@ -0,0 +1 @@
type T1={...};type T2={a:{b:{c:{...},...},...}};type T3={foo:number,...};type T4={foo:number,bar:string,...};

View File

@@ -1,11 +1,15 @@
type U = {};
type V = {};
type T = { ...U, };
type T = { ...U, ...V };
type T = { p: V, ...U };
type T = { ...U, p: V, };
type T = { ...{}|{ p: V, }};
type T = { foo(): number }
type T = { foo: () => number }
type T = { [string]: U };
type T = { [param: string]: U };
type T1 = { ...U, };
type T2 = { ...U, ...V };
type T3 = { p: V, ...U };
type T4 = { ...U, p: V, };
type T5 = { ...{}|{ p: V, }};
type T6 = { foo(): number }
type T7 = { foo: () => number }
type T8 = { [string]: U };
type T9 = { [param: string]: U };
type T10 = { ... };
type T11 = { a: { b: { c: {...}, ... }, ... } }
type T12 = { foo: number, ... };
type T13 = { foo: number, bar: string, ... };

View File

@@ -1,30 +1,49 @@
type U = {};
type V = {};
type T = { ...U
type T1 = { ...U
};
type T = { ...U,
type T2 = { ...U,
...V,
};
type T = {
type T3 = {
p: V,
...U,
};
type T = { ...U,
type T4 = { ...U,
p: V,
};
type T = { ...{} | {
type T5 = { ...{} | {
p: V
}
};
type T = {
type T6 = {
foo(): number
};
type T = {
type T7 = {
foo: () => number
};
type T = {
type T8 = {
[string]: U
};
type T = {
type T9 = {
[param: string]: U
};
};
type T10 = {...};
type T11 = {
a: {
b: {
c: {...},
...
},
...
}
};
type T12 = {
foo: number,
...
};
type T13 = {
foo: number,
bar: string,
...
};

View File

@@ -1,7 +1,7 @@
opaque type ID = string;
opaque type Foo<T> = Bar<T>;
opaque type Maybe<T> = _Maybe<T, *>;
export opaque type Foo = number;
export opaque type Foo2 = number;
opaque type union =
| {type: "A"}

View File

@@ -1,10 +1,10 @@
opaque type ID = string;
opaque type Foo<T> = Bar<T>;
opaque type Maybe<T> = _Maybe<T, *>;
export opaque type Foo = number;
export opaque type Foo2 = number;
opaque type union = {
type: "A"
} | {
type: "B"
};
opaque type overloads = (x: string) => number & (x: number) => string;
opaque type overloads = ((x: string) => number) & ((x: number) => string);

View File

@@ -0,0 +1,3 @@
type A = (<T>(T) => $Foo<T>) & (<T>(T) => $Foo<T>);
type B = (<T>(T) => $Foo<T>) | (<T>(T) => $Foo<T>);
type C = (<T>(T) => $Foo<T>)[];

View File

@@ -0,0 +1,3 @@
type A = (<T>(T) => $Foo<T>) & (<T>(T) => $Foo<T>);
type B = (<T>(T) => $Foo<T>) | (<T>(T) => $Foo<T>);
type C = (<T>(T) => $Foo<T>)[];

View File

@@ -12,6 +12,6 @@ function is_string(x): boolean %checks {
var f = (x: mixed): %checks => typeof x === "string";
const foo = (x: mixed): boolean %checks => typeof x === "string";
const foo2 = (x: mixed): boolean %checks => typeof x === "string";
(x): %checks => x !== null;

View File

@@ -12,6 +12,6 @@ function is_string(x): boolean %checks {
var f = (x: mixed): %checks => typeof x === "string";
const foo = (x: mixed): boolean %checks => typeof x === "string";
const foo2 = (x: mixed): boolean %checks => typeof x === "string";
x: %checks => x !== null;

View File

@@ -1,2 +1,2 @@
function createElement(tagName: "div"): HTMLDivElement {}
function createElement(tagName: 'div'): HTMLDivElement {}
function createElement1(tagName: "div"): HTMLDivElement {}
function createElement2(tagName: 'div'): HTMLDivElement {}

View File

@@ -1,3 +1,3 @@
function createElement(tagName: "div"): HTMLDivElement {}
function createElement1(tagName: "div"): HTMLDivElement {}
function createElement(tagName: 'div'): HTMLDivElement {}
function createElement2(tagName: 'div'): HTMLDivElement {}

View File

@@ -1,7 +1,7 @@
type FBID = number;
type Foo<T> = Bar<T>;
type Maybe<T> = _Maybe<T, *>;
export type Foo = number;
export type Foo2 = number;
type union =
| {type: "A"}
@@ -14,3 +14,5 @@ type overloads =
;
type func = string => string;
type D = X.Y<Z>;

Some files were not shown because too many files have changed in this diff Show More