14 Commits

Author SHA1 Message Date
Vedant Roy
dadba01249 Fix export bindings not updated by 'for...in' and 'for...of' (#11074)
* Correctly transpile export bindings for some for-of loops

* Correctly transform non-destructured for of loops to update exported variables

* Add tests

* Don't replace entire for of loop

* Correctly transform destructured for-of/for-in exports

* Update exported variables in array pattern and more fixes

* Refresh test output

* Update tests and rebase on master

* Refactor ForOf|ForIn visitor

* Don't transform re-declared exported vars

* Generate better name for loop id

Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* Idiomatically generate UidIdentifier

* Update scope after replacing loop declaration

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-02-09 11:41:29 +01:00
Klaus Meinhardt
b91720c1cc helper-module-transforms: dereference imported template tag (#10934)
* Dereference imported template tag

* apply fix for OptionalCallExpression as well
2019-12-28 16:46:20 -05:00
Huáng Jùnliàng
4e774b7264 fix: rewriteBindingInitVisitor should skip on scopable node (#10764) 2019-11-26 08:51:11 +01:00
Nicolò Ribaudo
43aa7e262c
Don't throw when destructuring into a var named as an import (#10628) 2019-11-04 22:50:36 +01:00
Willa Wang
73f8059ea0 Fix typo in rewrite-live-references.js (#7896) [skip ci] 2018-05-09 20:30:02 -04:00
Logan Smyth
62c1046249
Avoid re-traversing inserted references to the namespace binding. (#7418) 2018-02-22 23:54:29 -08:00
Logan Smyth
e732ee0c5b
Preserve import binding locations during module rewriting (#7378)
* Only wrap import references that need it.

* Preserve the import binding location for sourcemaps.

* Add tests.
2018-02-14 10:17:27 -08:00
Mateusz Burzyński
4d164bd8e6
Added babel-helper-split-export-declaration (#7313) 2018-02-13 16:44:05 +01:00
Logan Smyth
53826aaaa0 Expose a 'lazy' option for the CommonJS transform. 2017-12-17 18:42:35 -08:00
Logan Smyth
b900a3e5c2 Consistently return AST nodes. 2017-12-17 18:33:47 -08:00
Logan Smyth
f230497d08 Use literal-based templates for more stuff. 2017-10-18 13:58:48 -07:00
Henry Zhu
cde0054227 Scoped: change src imports to @babel/ [skip ci] 2017-10-16 22:49:56 -04:00
Logan Smyth
9dfcf0f116 Split the simple-access transforms out of the module transform into a general helper. 2017-09-26 15:43:51 -07:00
Henry Zhu
5b9112c794 babel-helper-modules -> babel-helper-module-transforms since package taken [skip ci] 2017-09-19 16:20:03 -04:00