summaryrefslogtreecommitdiff
path: root/cli/ast.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-10-30 12:19:49 +0100
committerGitHub <noreply@github.com>2020-10-30 12:19:49 +0100
commit4f57ca0daf2471338efe4fafa0f0a25373bfcef3 (patch)
tree85ee46caa01c6a24e384bd82358aa0c258644d90 /cli/ast.rs
parent5aeac009712e4b28cee4437d4d9a6f3832296672 (diff)
fix: panic in bundler (#8168)
This commit fixes panic in bundler which was caused by not setting thread-local slots.
Diffstat (limited to 'cli/ast.rs')
-rw-r--r--cli/ast.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli/ast.rs b/cli/ast.rs
index 44e5616e7..bc7265c15 100644
--- a/cli/ast.rs
+++ b/cli/ast.rs
@@ -467,7 +467,11 @@ pub fn transpile_module(
typescript::strip(),
fixer(Some(&comments)),
);
- let module = module.fold_with(&mut passes);
+ let module = swc_common::GLOBALS.set(&Globals::new(), || {
+ helpers::HELPERS.set(&helpers::Helpers::new(false), || {
+ module.fold_with(&mut passes)
+ })
+ });
Ok((source_file, module))
}