11661 Commits

Author SHA1 Message Date
Justin Ridgewell
2afe9404fe
Use Object Spread Syntax (#7777)
* Use Object Spread Syntax

* Nits
2018-04-23 21:44:27 -04:00
Henry Zhu
037fee8ffb
Target Node 6 in production (#7782) 2018-04-23 17:20:48 -04:00
Logan Smyth
3a2aa9b862 v7.0.0-beta.46 v7.0.0-beta.46 2018-04-22 21:29:42 -07:00
Logan Smyth
c8b57f777a
Ensure that the internal plugin load does not read the user's config. (#7783) 2018-04-22 20:32:52 -07:00
Henry Zhu
b414387bb1 v7.0.0-beta.45 v7.0.0-beta.45 2018-04-22 21:55:16 -04:00
Evan Scott
0bb71caad3 Add noConflict entry mode to @babel/polyfill + change error to warning (#6371)
* feat: add noConflict polyfill entry
* use a warning
2018-04-22 19:11:50 -04:00
Logan Smyth
d6dcbdad48
Merge pull request #7358 from loganfsmyth/babelrc-resolution-changes
Allow more flexible file-based configuration while preventing .babelrcs from breaking things
2018-04-22 13:28:05 -07:00
Logan Smyth
8606b76438 Split babelrc option into babelrcRoots. 2018-04-22 13:00:28 -07:00
Justin Ridgewell
34d73ebef0
Correct update expression Number coercion (#7766)
* Correct update expression Number coercion

You have to `ToNumber` whatever the `UpdateExpression` argument is.

* Fix systemjs update expression
2018-04-22 13:50:11 -04:00
Justin Ridgewell
890a45216f
Update super property get/set/call in loose mode (#7774)
* Update super property get/set/call in loose mode

Follows the plan laid out in https://github.com/babel/babel/pull/7553#issuecomment-381434519.

With #7691, this closes #7553, closes #4312.

* Post #7772

* Memoized property
2018-04-22 13:49:19 -04:00
Justin Ridgewell
0a257e8972
Move more class state out of replaceSupers (#7750)
Yes, the output is uglier. But, this is necessary for me to refactor
`replaceSupers` for #7733, which is necessary for both #7555 and
https://github.com/babel/babel/pull/7553#issuecomment-381434519.

I'm still in the middle of cleaning up all this code. Don't expect
`transformClass` to survive much longer as it's written currently.
2018-04-21 22:56:14 -04:00
Justin Ridgewell
3616137864
Memoize computed super properties (#7776)
Fixes #7775.
2018-04-21 22:15:02 -04:00
Justin Ridgewell
f8ab9466d3
Move subclass inheritance to end (#7772)
We were using `Object.create` to setup the prototype chain at the start of the class definition, which lead to #7771.

I was a bit worried about a speed hit, but it seems everyone optimizes the two patterns the same way.
https://jsbench.github.io/#f9fca52407643d96458a35763b201215

Fixes #7771.
2018-04-21 17:31:44 -04:00
Justin Ridgewell
8f24f91166
Implement MemberExpressionToFunctions helper (#7763)
* Implement MemberExpressionToFunctions helper

Fixes #7733.

This will also be used to simplify the Private Fields transform, which had [almost the same code](ccd941057a/packages/babel-plugin-proposal-class-properties/src/index.js (L114-L217)) hand written.

* Cleanup

* Little more comment cleanup

* Use unary plus

This can't be redefined, unlike the `Number` identifier.

* Review comments

* Remove unused deps
2018-04-21 13:13:42 -04:00
Henry Zhu
dbdce0e4e4
add overwrite for tests [skip ci] 2018-04-21 11:46:15 -04:00
Vinh Le
4595c7fdfd Correct test running command (#7768) [skip ci]
* Correct test running command

* Also refine test/index.js content
2018-04-21 11:35:48 -04:00
Yosuke Kurami
1f97b91655 fix: don't write ': ' token when name is null (#7769) 2018-04-21 11:34:24 -04:00
Christopher Hiller
b0e1e84471 drop support for Node.js v4 (#7755)
* drop support for Node.js v4; closes #7753

- remove version 4 from Travis build matrix
- update environment support doc
- update `CONTRIBUTING.md`
- update `engines` field of root `package.json`

Signed-off-by: Christopher Hiller <boneskull@boneskull.com>

* update engines for babylon

Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
2018-04-21 01:09:10 -04:00
Logan Smyth
f7c26bf2bf Add some docs for config searching. 2018-04-20 17:00:54 -07:00
Logan Smyth
a67eb25547 Only search for .babelrc files in the 'root' package by default. 2018-04-20 17:00:53 -07:00
Logan Smyth
485e37fcb0 Support a babel.config.fs file in a 'root' directory. 2018-04-20 17:00:53 -07:00
Logan Smyth
f013dab5fb Restrict .babelrc resolution to within a given package. 2018-04-20 17:00:53 -07:00
Brian Ng
e45b58dcb1
Fix small typo with decorators legacy option [skip ci] (#7762) 2018-04-19 20:26:54 -05:00
Henry Zhu
339dfddca5
Merge pull request #7734 from nicolo-ribaudo/decorators-legacy-option
Decorators legacy option
2018-04-19 14:36:18 -04:00
Brian Ng
0cd868a5f2
fixup tests 2018-04-19 09:17:33 -05:00
Nicolò Ribaudo
29db23ed87
Remove old comment 2018-04-19 09:08:15 -05:00
Nicolò Ribaudo
2679d6775c
Add "decoratorsLegacy" to presets 2018-04-19 09:08:15 -05:00
Nicolò Ribaudo
96316dcf88
Add legacy option to plugin-proposal-decorators. 2018-04-19 09:08:14 -05:00
Logan Smyth
42244123e1 Update the docs to correctly reflect default value changed in #7436. [skip ci] 2018-04-18 23:33:34 -07:00
Andy
4b97e837ea Fix type error (#7752) 2018-04-18 15:31:15 -04:00
Brian Ng
3299086955
Add support for flow implements (#7741) 2018-04-18 08:54:30 -05:00
Jason Quense
2bded404f3 Improve asyncIterator error (#7745)
* Improve asyncIterator error

When an object is has neither asyncIterator or iterator defined, throw the "not an async iterable" error

* Correct logic

* reduce access

* Update helpers.js
2018-04-17 21:02:53 -05:00
Justin Ridgewell
21c7ff3f37
Classes cleanup (#7737)
* Cleanup

* Move verifyConstructorVisitor out of closure
2018-04-17 17:52:43 -04:00
Nicolò Ribaudo
341bdab90c Update decorators parsing (#7719)
* Update decorators parsing

This commit introduces three changes:
1) Class properties can be decorated
2) Decorators can contain arbitrary expressions, using @(...)
3) The Decorator node type has a new property, "arguments". This
    makes it possible do distinguish @dec() and @(dec()), which have
    different behaviors because @(dec()) is equivalent to @(dec())().

* Rename Decorator#expression to Decorator#callee

* Add test for @dec()()
2018-04-17 16:22:03 -05:00
Brian Ng
81149a5cc9
Add initial support for ES2018 in preset-env (#7658) 2018-04-17 16:16:33 -05:00
Mateusz Burzyński
5166eef103 Optimize class properties output (#6656) 2018-04-15 01:03:47 -04:00
Justin Ridgewell
0ee9a4e612
Fix default class super inheritance (#7732)
Fixes #7683.
2018-04-14 15:15:40 -04:00
Henry Zhu
858a2c74e7
update readme [skip ci] 2018-04-14 15:13:31 -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
39b05598a0
Drop Chai from packages (#7729) 2018-04-14 09:01:38 -04:00
Justin Ridgewell
29eafbbf44
Remove tagged template literal global caching (#7722)
* Remove tagged template literal global caching

Fixes #7350.

* Review comments

* assert output
2018-04-13 11:51:00 -04:00
Henry Zhu
7a106025ea
Merge pull request #7720 from devenbansod/migrate_to_jest_expect-3
Migrate more packages' tests to use jest expect assertions
2018-04-13 11:04:44 -04:00
Deven Bansod
4f1473da3d Remove global chai.assert in fixture runner's test context 2018-04-13 19:14:30 +05:30
Deven Bansod
c62b202e6a Migrate remaining test assertions to jest-expect 2018-04-13 19:14:03 +05:30
Deven Bansod
a084339a15 Migrate -computed-properties and -jscript tests to use jest expect assertions 2018-04-13 16:30:06 +05:30
Deven Bansod
d7987fbbd2 Migrate -transform-object-super tests to use jest expect assertions 2018-04-13 14:21:02 +05:30
Deven Bansod
8a31eabf5e Migrate -transform-classes tests to use jest expect assertions 2018-04-13 14:20:51 +05:30
Deven Bansod
80428dec47 Migrate -optional-catch-binding, -block-scoping to use jest expect assertions 2018-04-13 14:19:49 +05:30
Dennis Czombera
61ec5ce957 Provide better error message for invalid default export declaration (#7717) 2018-04-12 17:07:41 -05:00
Alexander Pepper
1e41f613bb [babel-preset-typescript] Fixed link of plugin-transform-typescript. (#7700) [skip ci] 2018-04-12 16:44:43 -04:00