Skip to content

Commit 02f09d2

Browse files
authored
revert: "fix: getHash occasionally panic when rebuild (#3970)" (#4029)
Revert "fix: getHash occasionally panic when rebuild (#3970)" This reverts commit efa0dc6.
1 parent 79d7c9b commit 02f09d2

File tree

19 files changed

+260
-301
lines changed

19 files changed

+260
-301
lines changed

crates/node_binding/binding.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class JsStats {
5555
getErrors(): Array<JsStatsError>
5656
getWarnings(): Array<JsStatsWarning>
5757
getLogging(acceptedTypes: number): Array<JsStatsLogging>
58-
getHash(): string | null
58+
getHash(): string
5959
}
6060

6161
export class Rspack {
@@ -381,7 +381,6 @@ export interface JsStatsModule {
381381
issuerPath: Array<JsStatsModuleIssuer>
382382
reasons?: Array<JsStatsModuleReason>
383383
assets?: Array<string>
384-
modules?: Array<JsStatsModule>
385384
source?: string | Buffer
386385
profile?: JsStatsModuleProfile
387386
}

crates/node_binding/src/js_values/compilation.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,10 @@ impl JsCompilation {
317317
}
318318

319319
#[napi]
320-
pub fn get_stats(&self) -> Result<JsStats> {
321-
self.inner.get_stats().try_into()
320+
pub fn get_stats(&self, reference: Reference<JsCompilation>, env: Env) -> Result<JsStats> {
321+
Ok(JsStats::new(reference.share_with(env, |compilation| {
322+
Ok(compilation.inner.get_stats())
323+
})?))
322324
}
323325

324326
#[napi]

0 commit comments

Comments
 (0)