Unverified Commit 157f51e2 authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

fix(turbopack): Use module fragment for async module analysis (#71246)

### What?

Make `EcmascriptModulePartAsset::is_async_module` specify `ModulePart`
correctly while analyzing

### Why?

The previous code makes all dependencies of a module to be loaded.

### How?
parent b559c282
...@@ -104,7 +104,7 @@ impl EcmascriptModulePartAsset { ...@@ -104,7 +104,7 @@ impl EcmascriptModulePartAsset {
#[turbo_tasks::function] #[turbo_tasks::function]
pub async fn is_async_module(self: Vc<Self>) -> Result<Vc<bool>> { pub async fn is_async_module(self: Vc<Self>) -> Result<Vc<bool>> {
let this = self.await?; let this = self.await?;
let result = this.full_module.analyze(); let result = analyze(this.full_module, this.part);
if let Some(async_module) = *result.await?.async_module.await? { if let Some(async_module) = *result.await?.async_module.await? {
Ok(async_module.is_self_async(self.references())) Ok(async_module.is_self_async(self.references()))
......
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