Unverified Commit 0f47638f authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

fix(turbopack): Fix pure span check in advanced tree shaking (#76406)

parent 7361dc46
......@@ -10,7 +10,7 @@ use petgraph::{
};
use rustc_hash::{FxHashMap, FxHashSet};
use swc_core::{
common::{comments::Comments, util::take::Take, Spanned, SyntaxContext, DUMMY_SP},
common::{comments::Comments, util::take::Take, BytePos, Spanned, SyntaxContext, DUMMY_SP},
ecma::{
ast::{
op, ClassDecl, Decl, DefaultDecl, EsReserved, ExportAll, ExportDecl,
......@@ -1222,7 +1222,10 @@ impl DepGraph {
ids.push(id.clone());
let has_explicit_pure = match &decl.init {
Some(e) => comments.has_flag(e.span().lo, "PURE"),
Some(e) => {
e.span().lo == BytePos::PURE
|| comments.has_flag(e.span().lo, "PURE")
}
_ => false,
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment