24 Commits

Author SHA1 Message Date
Ryan Biwer
23ea626241 Fix block scope remapping (fixes T7525) (#3662) 2016-09-01 10:48:32 -04:00
Adam Leventhal
0d1e1ee10c incorrect handling of returns nested in switch cases (#3618) 2016-08-18 10:14:07 -04:00
Logan Smyth
5ddce1372b Fix an issue with the switch handing from PR #3490. 2016-06-11 00:17:36 -07:00
Logan Smyth
61b3a6314b Merge pull request #3490 from jayphelps/T7324
create new lexical env inside switch statement blocks, fixes #T7324
2016-05-30 14:42:29 -07:00
Jordan Klassen
dc1f40540d Upgrade to lodash 4 (#3315)
* Upgrade to lodash 4

* Fix incorrect require in babel-runtime/scripts

* Replace cloneDeep with cloneDeepWith where applicable
2016-05-13 17:15:14 -04:00
Jay Phelps
4166e5148e create new lexical env inside switch statement blocks, fixes #T7324 2016-04-29 23:54:41 -07:00
Amjad Masad
07d2c15e99 quotes 2016-03-09 13:34:06 -08:00
Amjad Masad
3dd80a6b14 Update updateScopeInfo method to use moveBindingTo 2016-03-09 13:28:45 -08:00
Amjad Masad
8b4b02a5fb [hotfix T7197] Use scope.moveBindingTo
I had deleted the binding and created a new one. I naively thought that
the analysis will automatically run again. But now discovered the method
I actually want to use: `scope.moveBindingTo` which moves the binding
and all the correct analysis. The only thing that was left to do is to
update `binding.kind` which I did manually.
2016-03-09 13:24:20 -08:00
Amjad Masad
3bebc3a7ca lint 2016-03-07 18:26:51 -08:00
Amjad Masad
77c7cc5363 Rework scope info updating in block-scoping transform
I previously tried an approach to scope bindings from var to scope but
it didn't catch all cases. This is evident in this bug:

https://phabricator.babeljs.io/T2892

Where even after transforming a const to a var we still get an error
that it's read-only.

This approach will go through and delete every existing let and const
binding and creates a new one with the kind "var"
2016-03-07 18:19:10 -08:00
Amjad Masad
3667527d04 Revert "Remove flow"
This reverts commit 2827ff6b01dcce69e9d3c0402e96b52b3a2a47ee.
2016-03-03 14:49:20 -08:00
Amjad Masad
47782a6170 Merge pull request #3389 from babel/block-binding-actual
Update scope binding info after transforming block-scoped bindings
2016-03-02 18:51:26 -08:00
Sam Goldman
2827ff6b01 Remove flow 2016-03-01 22:33:30 -08:00
Amjad Masad
30bb38c4bb Update scope binding info after transforming block-scoped bindings
When convert a const, let or any other block-bound binding to a var we
forget to update the scope info. This confuses other transforms that may
come after this as to which scope does the binding belongs to.

This also uncovered an issue where duplicate block-scoped bindings were allowed
to co-exist.
2016-03-01 17:03:06 -08:00
Sebastian McKenzie
5b89849f43 Switch to klint, fix some lint rules 2016-02-14 23:25:14 +00:00
Andrew Schmadel
307d5c5a0d rename scope bindings during block scope transform 2016-02-10 11:44:16 -05:00
Amjad Masad
0711fa67b4 ensure block 2015-11-11 10:42:55 -08:00
Amjad Masad
8891ed38b8 cleanup 2015-11-11 10:42:55 -08:00
Amjad Masad
ed4a5fb811 get rid of _let 2015-11-11 10:42:55 -08:00
Amjad Masad
aa8b96bf38 Support consts in block-scoping transform 2015-11-11 10:42:55 -08:00
Sebastian McKenzie
e62a00df50 rename NumberLiteral to NumericLiteral and RegexLiteral to RegExpLiteral 2015-11-03 01:19:35 +00:00
Sebastian McKenzie
ae7d5367f1 6.0.0
I'm extremely stupid and didn't commit as I go. To anyone reading this
I'm extremely sorry. A lot of these changes are very broad and I plan on
releasing Babel 6.0.0 today live on stage at Ember Camp London so I'm
afraid I couldn't wait. If you're ever in London I'll buy you a beer
(or assorted beverage!) to make up for it, also I'll kiss your feet and
give you a back massage, maybe.
2015-10-29 17:51:24 +00:00
Sebastian McKenzie
9969224a93 add more plugins, rename some 2015-09-15 06:12:46 +01:00