11410 Commits

Author SHA1 Message Date
Nicolò Ribaudo
a62cfe9045 Disallow arguments in class properties 2018-04-12 22:41:28 +02:00
Nicolò Ribaudo
f797454a18 Disallow super in functions in class properties 2018-04-12 22:41:28 +02:00
Justin Ridgewell
ec882be44d
Uncomment super increment expression set tests (#7721)
This was failing because of the bugs fixed by #7687.
2018-04-12 13:24:07 -04:00
Justin Ridgewell
ecbf0dd53c
Fix super nested class bugs (#7691)
* Properly traverse nested class for supers

* Add object nested in class cases

* Add object nested object cases

* Test class properties

* Undo changes to lerna.json

* Add tests arournd prefix/postfix super increment

* tmp

* Use sets
2018-04-12 13:02:26 -04:00
Nicolò Ribaudo
af3d6526e7 Add slack links to CONTRIBUTING.md (#7713) 2018-04-11 21:56:45 -05:00
Deven Bansod
95894397eb Migrate babel-cli and babel-generator tests to use jest-expect (#7549) 2018-04-11 13:12:56 -05:00
Justin Ridgewell
b1c9af3f05
Use new isInStrictMode (#7714) 2018-04-11 12:17:01 -04:00
Justin Ridgewell
ec3722b3f9
Get set helpers (#7687)
* Improve get/set helper

* fixtures

* Edge cases

* Add loose edge cases

* Spec compliant

* Add issue case

* Even more edge cases!

* Final updates

* Fix name

* Use Reflect.{get, set} when available

* Avoid block scoping in loose

* Remove semicolon

* Do not redefine a non-enumerable

* Get strictness from call site, not helpers

* Add called assertions

* Classes are always strict

* Update test fixture
2018-04-11 11:56:59 -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
Markus Török
6597a472b3 Add "use strict" directive (#7411)
* #7349
- Add "use strict" directive to transformed class bodies

* Update tests (#7349)

* Add test for program with use strict directive (#7349)

* Update tests (#7349)

* Update source mapping (#7349)

* Add test for parent blockStatement with use strict directive (#7349)

* Update tests (#7349)

* Update tests (#7349)

* Update tests (#7349)

* Add test for constructor-only class (#7349)

* Constructor only classes are strict, too

But constructor only that use non-simple parameters must use a strict function wrapper.

* Fix test

* Wrapper not needed if class is already strict

* Revert change to lerna.json
2018-04-10 17:33:38 -04:00
Hendrik Niemann
fdd0789936 Fix literal type annotation argument number (#7706)
Added the value argument to the visitors of flow literal type
annotations.
Literal type annotations need a value since they work very much like
primitive literals in normal JavaScript.

Fixes #7697
2018-04-10 09:38:20 -04:00
Guy Bedford
5b1332457c arrayWithHoles internal function name consistency (#7709) [skip ci] 2018-04-10 09:33:54 -04:00
Justin Ridgewell
3177f05904
ESLint: Ignore lerna.json and .git (#7708)
* Ignore lerna.json

* Oh, and ignore .git
2018-04-10 08:47:50 -04:00
Sven SAULEAU
9dc178df9a
Merge pull request #7704 from babel/use-circle-yarn
Use yarn provided by circle
2018-04-10 07:38:41 +02:00
Brian Ng
75bc9422b8
Use yarn provided by circle 2018-04-09 22:11:17 -05:00
Axel Nyffenegger
bd98041321 Fix function name computation for literal values (#7435)
* Fix name computation for literal values

* Add more computed literal test cases

* Always return a string in getNameFromLiteralId

- Also concatenate quasis id for regex literal

* Add a test clarifying function name for template literals

* Remove useless else ifs
2018-04-09 21:00:55 -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
637bfe76b1
Cleanup object super traversal (#7681) 2018-04-06 20:39:57 +01:00
Justin Ridgewell
3f72f1d637 Add option to overwrite failing output fixtures (#7679) 2018-04-06 12:13:10 -05:00
Henry Zhu
20de23f895 update sponsors, move up [skip ci] (#7676) 2018-04-06 10:02:30 -05:00
Justin Ridgewell
d17adf40df
Use construct helper in New Spread (#7677)
* Use construct helper in New Spread

* CircleCI
2018-04-06 10:40:38 +01:00
Justin Ridgewell
450a1678f2
Use getProto and setProto helpers (#7675)
Depends on #7674.
2018-04-06 02:54:08 +01:00
Justin Ridgewell
e9ed0f5f21
Split _wrapNativeSuper into helpers (#7674)
These can be reused in a few transforms.
2018-04-06 01:18:44 +01:00
Justin Ridgewell
29d249e3b7
Cleanup isReferenced a bit (#7669)
* Cleanup isReferenced a bit

* Optimize isReferenced inside Functions

* Group return falses
2018-04-05 19:09:58 +01:00
Justin Ridgewell
6f9b0546ef
Class Properties Tests (#7670)
* Round out class properties tests

* Rename in preperation for private tests

* Fix options
2018-04-05 17:49:34 +01:00
Nicolò Ribaudo
fa2c6c5164 Never extract class fields into an initializer function. (#7659)
It was needed to avoid collision of identifiers used in fields
initializers with variables declared in the constructor, but it
broke `this` handling.
This commit removes that behavior and instead renames the
colliding variables.
2018-04-05 16:20:47 +01: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
Justin Ridgewell
01f4c2368e
OptionalMemberExpression properties are not referenced (#7668)
Fixes #7642.
2018-04-05 02:44:32 +01:00
hirochachacha
56cb4baf46 Add missing exponential operators to ast spec (#7663) [skip ci] 2018-04-04 14:27:19 -04:00
hirochachacha
b051243a63 Fix typo in ast spec (#7662) [skip ci] 2018-04-04 14:26:06 -04:00
Henry Zhu
e808b63c15 Bump to babel@7.0.0-beta.44 (#7656) 2018-04-02 19:47:25 -05:00
Henry Zhu
a6df92f245 v7.0.0-beta.44 v7.0.0-beta.44 2018-04-02 18:19:30 -04:00
Logan Smyth
f4b81ab101
Merge pull request #7655 from babel/babel-env-make
Remove setting BABEL_ENV to test by default in makefile
2018-04-02 13:57:47 -07:00
Brian Ng
360b632881
Remove setting BABEL_ENV to test by default in makefile 2018-04-02 15:18:50 -05:00
Henry Zhu
bdfeeb38c6 v7.0.0-beta.43 v7.0.0-beta.43 2018-04-02 12:47:55 -04:00
Henry Zhu
47ada5ab3a
revert prev pr to temp fix osx (#7652) 2018-04-02 12:40:03 -04:00
John-David Dalton
59ba3959dc Add options.allowAwaitOutsideFunction. (#7637) 2018-03-29 10:41:14 -04:00
unconfident
0200e6256a Allow StringLiteral to be used as ObjectTypeProperty.key (#7639) 2018-03-28 09:20:46 -05:00
Henry Zhu
9a26c2b07a
Merge pull request #7471 from yakotika/master
added support Node's --require and -r flags in babel-node
2018-03-27 14:44:35 -04:00
Henry Zhu
901571d72f
Merge pull request #7579 from devenbansod/migrate-to-jest-expect-2
Migrate a few packages' tests to use Jest Expect (see below)
2018-03-27 14:43:44 -04:00
Deven Bansod
b09c729675 Use expect's instanceOf and toHaveProperty methods 2018-03-27 22:34:25 +05:30
Sven SAULEAU
a36525be45
Merge pull request #7615 from babel/fix-clean-makefile
clean makefile a bit
2018-03-27 08:36:16 +02:00
Logan Smyth
a10c91790f
Merge pull request #7588 from loganfsmyth/register-cycle-fixes
Have @babel/core lazy-load all dependencies and make @babel/register not explode because of that
2018-03-25 15:24:00 -07:00
Justin Ridgewell
ab7d1231ad
Fix flow errors with Logical Assignment Operators (#7629)
* Fix flow errors with logical assignment

* Fix column numbers
2018-03-25 22:47:48 +01:00
Logan Smyth
a5df709bc3 Lazy-load @babel/core's dependencies to decrease up-front load times. 2018-03-25 14:22:32 -07:00
Logan Smyth
1dbed5f458 Have @babel/register explicitly skip re-entrant plugins/presets. 2018-03-25 14:22:32 -07:00
Logan Smyth
40e38646e4 Include stdout in error messages to aid debugging. 2018-03-25 12:50:35 -07:00
Logan Smyth
9e4dd861ee Ensure that sourceMapSupport is installed in all branches. 2018-03-25 12:50:35 -07:00
Justin Ridgewell
a7bddc02ba
Add ??= to Logical Assignment Operators (#7623)
`??=` is being merged into the Logical Assignment Operator proposal, and the overall proposal will wait until nullish coalescing is finalized.
2018-03-25 18:58:51 +01:00
Justin Ridgewell
023f8bd1cb
Move Logical Assignment Ops to Stage 1 (#7625) 2018-03-25 17:49:21 +01:00