Nicolò Ribaudo
911c2d0bf4
Use @babel/eslint-plugin-developement ( #9206 )
2018-12-18 22:59:43 +01: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
b706e34fc8
[decorators] Correctly insert _initialize(this) after super(). ( #8970 )
...
* [decorators] Correctly insert `_initialize(this)` after `super()`.
This commit fixes to problem:
1) After `super();` statements, `_initialize(this)` was inserted without
a trailing semicolon.
2) `(0, super())` causes an infinite recursion.
* Fix tests
* Add test
2018-11-06 21:58:09 -08:00
Cyp
e541d6031a
fix: Expression x === 'y' && '' should not evaluate to undefined. ( #8880 )
...
Fixes https://github.com/babel/minify/issues/908 .
2018-10-16 21:25:49 +02:00
Kevin Thomas
842c164be5
Insertafter jsx fix ( #8833 )
...
* Add check for JSXElement
* Add test
2018-10-10 10:10:20 -06:00
Logan Smyth
b04de1196a
Rename exported functions where name conflicts with param. ( #8505 )
2018-08-21 13:54:29 -07:00
Yongxu Ren
0fd3da110d
Rewrite Hub as interface #5047
2018-08-20 19:30:29 +02:00
Logan Smyth
2854a187be
Remove dependency on barely-used package.
2018-07-14 12:41:36 -07:00
Nicolò Ribaudo
3c46e75b8f
Don't split an exported class when renaming an inner binding ( #8051 )
2018-06-12 13:45:21 -04:00
Nicolò Ribaudo
387cda8fbb
isConstantExpression should return true for immuable bindings ( #8122 )
...
* isConstantExpression should return true for immuable bindings
* New test
* Don't return undefined
2018-06-12 13:40:52 -04:00
Brian Ng
5895277b32
Bump prettier to v1.13.2
2018-06-03 07:54:39 -05:00
Chaitanya Kumar Kamatham
daf0ca8680
Rename "babylon" to "@babel/parser" ( #7937 ) 🎉
2018-05-19 00:03:05 -04:00
Rubén Norte
bc6f0f989d
Re-add support for local Flow bindings (TypeAlias, OpaqueTypeAlias and Interface) ( #7900 )
2018-05-17 10:54:14 -07:00
Justin Ridgewell
21c7ff3f37
Classes cleanup ( #7737 )
...
* Cleanup
* Move verifyConstructorVisitor out of closure
2018-04-17 17:52:43 -04:00
Justin Ridgewell
668358c4d0
Fix class properties after nested class' bare super ( #7671 )
...
* Fix class properties after nested class' bare super
Fixes #7371 .
* Fix node 4 test
* This damn node 4 test
* All of the ClassBody, but not the methods or field inits
* tmp
* tmp
* Use common class environment visitor
* Tests
* Use skipKey to avoid recursive traversal
* Remove old state
* Use jest expect
2018-04-14 13:48:38 -04:00
Justin Ridgewell
7ae724f553
Add Path#isInStrictMode ( #7712 )
...
* Add Path#isInStrictMode
* Fix undefined directives
* Explicitly return for arrow expressions
2018-04-11 09:13:38 -04:00
Devon Govett
6a8c4ab433
Make babel-types type checking functions 36% faster ( #7685 )
...
* Precompile 25% faster type checking functions
* Pre-fetch type-check function when generating NodePath methods
Additional ~11% speed improvement.
* Slightly faster assert calls
2018-04-09 15:11:04 -04:00
Justin Ridgewell
43040a4181
Private Properties phase 1 ( #7666 )
...
* Private Properties phase 1
Co-authored-by: CodingItWrong
* Private fields are optional
* Docs update
2018-04-05 11:17:34 +01:00
Logan Smyth
4d76d5dddc
Refactor Babel's helpers into smaller functions.
2018-03-05 09:32:39 -08:00
Mateusz Burzyński
d283324f8a
Mark hoisted react constant elements as #__PURE__ ( #7372 )
2018-02-21 18:58:56 +01:00
Mateusz Burzyński
4d164bd8e6
Added babel-helper-split-export-declaration ( #7313 )
2018-02-13 16:44:05 +01:00
Nicolò Ribaudo
4887d81929
Remove bindings of removed paths from scope
2018-02-06 23:59:12 +01:00
Kai Cataldo
7234442fde
Add location information to parsing errors ( #7314 )
2018-02-04 13:00:03 -06:00
Logan Smyth
278cd5e572
Preserve identifier location information when mapping this and arguments. ( #7312 )
2018-02-01 18:54:15 -08:00
Nicolò Ribaudo
252ea5a966
Fix reused nodes - part 2 ( #7149 )
2018-01-29 22:59:06 +01:00
Mateusz Burzyński
912bcc186d
Fix reused nodes - part 1 ( #7149 )
2018-01-29 22:59:06 +01:00
Brian Ng
064c17e03f
Bump prettier and related deps ( #7244 )
2018-01-20 17:00:21 +01:00
Luca
5ac8ba19a4
Fix typo [skip ci] ( #7229 )
2018-01-17 13:43:59 -05:00
Mateusz Burzyński
0a517b51cd
Added custom NodePath.prototype.toString method as debug utility ( #7218 )
2018-01-15 13:07:05 +01:00
Mateusz Burzyński
79c84f2f9b
Fixed _containerInsertAfter setting path key as stringified index ( #7213 )
2018-01-15 08:08:42 +01:00
Nicolò Ribaudo
2297e2d764
Fix a regression introduced in #7040 ( #7116 )
2017-12-28 22:15:53 +01:00
Nicolò Ribaudo
68476b6ddd
Make .insert{Before,After} work by default when the parent is an eport declaration ( #7040 )
2017-12-19 00:05:29 +01:00
Brian Ng
c7980b2b90
Bump prettier ( #6991 )
2017-12-07 17:36:49 -05:00
Nicolò Ribaudo
a2aabbd33d
Generate better builder names for JSX* and TS* ( #6967 )
...
e.g. JSXIdentifier -> jsxIdentifier.
The jSXIdentifier alias isn't removed, so this commit doesn't introduce breaking changes.
2017-12-07 12:17:40 +01:00
Daniel Tschinder
9206df964d
Use only imports in babel-traverse and remove double exports ( #6881 )
2017-11-23 20:59:54 +01:00
Brian Ng
c583a04a55
Fix setting deopt properly after evaluating multiple expressions ( #6882 )
2017-11-22 20:06:57 -05:00
Logan Smyth
0e88156d0c
Add warnings to places where we might allow promises to be returned in later minors.
2017-11-13 11:58:30 -08:00
Nicolò Ribaudo
9a231c5671
Remove support for flow bindings ( #6528 )
...
Flow bindings have been deprecated for a while.
The reason behind this change is that `declare var foo`
doesn't introduce a new local binding, but it represents
a global one.
2017-11-09 12:29:04 -08:00
Diogo Franco
81811bf1b9
Fix transform-arrow-functions in { spec: true } shadowing ( #6760 )
...
* Fix transform-arrow-functions in { spec: true } shadowing
The function name matching the variable declaration name could
shadow the actual function object inside the generated function,
leading to invalid behavior due to holding a reference to the
original unbound function.
* Combine it with transform-function-name just to be sure in spec: false
* Revert "Fix transform-arrow-functions in { spec: true } shadowing"
This reverts commit 1cafe2561d0b0ddd181b956a85eb074621da12e8.
* Much simpler version of the above fix
* Missing fixture updates
* Avoid using rest/spread to make the tests pass on node 4
* ...actually update _all_ the fixtures
2017-11-08 17:21:30 -05:00
Mateusz Burzyński
a1c7449a92
Fixed incorrect static class field initialization order ( #6530 )
2017-10-30 16:32:45 -04:00
Benedikt Meurer
f9e0643460
Fix path.popContext() to not try to load "-1" from contexts array. ( #6580 )
...
* Fix path.popContext() to not try to load "-1" from contexts array.
The current implement of popContext does
```js
this.setContext(this.contexts[this.contexts.length - 1]);
```
even if `this.contexts` can be empty, which causes it to lookup the
property `"-1"`, which is not found on the array itself and obviously
also not in the `Object.prototype` and the `Array.prototype`. However
since `"-1"` is not a valid array index, but has a valid integer
representation, this is a very expensive lookup in V8 (and probably
other engines too, but that is probably less relevant, since Babel
most often runs on Node nowadays).
* Make zero check explicit (for readability).
2017-10-28 16:17:05 -04:00
Mateusz Burzyński
859ea4b175
Scoped: updated numerous docs with scoped packages change [skip ci]
2017-10-16 22:49:57 -04:00
Henry Zhu
cde0054227
Scoped: change src imports to @babel/ [skip ci]
2017-10-16 22:49:56 -04:00
William
36d8a13f4d
Fix catch error on do expression and add tests ( #6372 )
...
Fixes #6331
2017-10-04 18:19:54 +02:00
Logan Smyth
eae76e5b89
Break apart the File class into multiple files and add type definitions.
2017-10-02 13:55:37 -07:00
Logan Smyth
c1df126b83
Remove wrap function and calculate code frames earlier.
2017-10-02 13:48:02 -07:00
Justin Ridgewell
73fba55c9f
Requeueing sometimes has wrong scope ( #6351 )
...
This prevents a requeued path from inheriting a totally wrong scope later on. I can't find exactly where this is happening, but either way a path should only inherit scope from it's ancestors.
2017-10-02 15:26:10 -04:00
Henry Zhu
6816b26994
Merge pull request #6356 from JeromeFitz/babel-messages-inline
...
Remove babel-messages and inline the usages
2017-09-30 23:25:06 -04:00
JeromeFitz
ae168edcfa
Remove babel-messages ( #6347 ), continuation of #6352
...
package.json "babel-messages" removed:
- babel-core
- babel-helper-replace-supers
- babel-plugin-transform-es2015-classes
- babel-traverse
"messages" remove from:
- babel-plugin-check-es2015-constants/src/index.js
- babel-plugin-transform-es2015-for-of/src/index.js
export "babel-messages" removed from:
- babel-core/src/index.js
import "babel-messages" removed from:
- babel-generator/src/index.js
- babel-helper-replace-supers/src/index.js
- babel-traverse/src/index.js
- babel-traverse/src/scope/index.js
- babel-traverse/src/visitors.js
package "babel-messages" removed completely.
💯 ️ All tests pass.
2017-09-30 09:31:53 -04:00
Abhilash Singh
6230855b71
unshiftContainer seems to incorrectly handle function params #6150 ( #6354 )
2017-09-30 09:14:51 -04:00