13 Commits

Author SHA1 Message Date
Moti Zilberman
7a7704fea0 Fix block scoping transform for declarations in labeled statements (#4669)
* Fix block scoping transform for declarations in labeled statements (#4122)

* DRY block-scoping
2016-10-05 21:47:21 +02:00
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
Jay Phelps
4166e5148e create new lexical env inside switch statement blocks, fixes #T7324 2016-04-29 23:54:41 -07: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
Henry Zhu
937b8a6767 use flow instead of flow-comments 2016-03-04 15:50:05 -05: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
Amjad Masad
0d8e5a9e86 Fix over-parenthesizing of function expressions 2015-12-24 14:55:51 -08:00
Amjad Masad
a17d62ca2b Convert the constants transform plugin to a validation plugin
A follow up from https://github.com/babel/babel/pull/2969 were we added support for consts in the block-scoping plugin.
2015-11-11 10:45:31 -08:00
Amjad Masad
aa8b96bf38 Support consts in block-scoping transform 2015-11-11 10:42:55 -08:00
Amjad Masad
4cca0abd2f move them to the correct place 2015-11-11 10:42:54 -08:00
Sebastian McKenzie
15969a0904 move all plugin tests out of babel-core and into their appropriate folders 2015-11-08 23:04:10 -08:00