fix: rewriteBindingInitVisitor should skip on scopable node (#10764)
This commit is contained in:
committed by
Nicolò Ribaudo
parent
7f732ad019
commit
4e774b7264
@@ -80,10 +80,7 @@ export default function rewriteLiveReferences(
|
||||
* A visitor to inject export update statements during binding initialization.
|
||||
*/
|
||||
const rewriteBindingInitVisitor = {
|
||||
ClassProperty(path) {
|
||||
path.skip();
|
||||
},
|
||||
Function(path) {
|
||||
Scope(path) {
|
||||
path.skip();
|
||||
},
|
||||
ClassDeclaration(path) {
|
||||
|
||||
4
packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/input.mjs
vendored
Normal file
4
packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/input.mjs
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export function bug() {}
|
||||
{
|
||||
let bug = 2;
|
||||
}
|
||||
5
packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/options.json
vendored
Normal file
5
packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/options.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"plugins": [
|
||||
"transform-modules-amd"
|
||||
]
|
||||
}
|
||||
14
packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/output.js
vendored
Normal file
14
packages/babel-plugin-transform-modules-amd/test/fixtures/regression/9346/output.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
define(["exports"], function (_exports) {
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(_exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
_exports.bug = bug;
|
||||
|
||||
function bug() {}
|
||||
|
||||
{
|
||||
let bug = 2;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user