12476 Commits

Author SHA1 Message Date
Nicolò Ribaudo
2c88694388
v7.4.4 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