Skip to content

Commit ba5e0fc

Browse files
committed
Fix fails
1 parent aa996b4 commit ba5e0fc

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/AudioWorklet.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ class AudioWorklet {
296296
get port() { return this.#port }
297297

298298
async addModule(moduleOrSetup) {
299-
if (typeof moduleOrSetup === 'function') return moduleOrSetup(this.#scope)
299+
if (typeof moduleOrSetup === 'function') {
300+
this.#scope.sampleRate = this.#context.sampleRate
301+
return moduleOrSetup(this.#scope)
302+
}
300303

301304
if (typeof moduleOrSetup !== 'string')
302305
throw new TypeError('addModule requires a URL string or setup function')

test/wpt.test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ const subdirs = readdirSync(wptRoot, { withFileTypes: true })
1717
// Some context tests check real-time stats — flaky under parallel CPU contention
1818
const FLAKY = new Set(['the-audiocontext-interface'])
1919

20-
// Platform-specific vm incompatibilities (cannot fix on our side)
20+
// Platform-specific skips
2121
const isDeno = typeof Deno !== 'undefined'
22+
const isBun = typeof Bun !== 'undefined'
2223
const SKIP_FILES = new Set([
2324
// Deno vm: cross-realm __proto__ access returns null, breaking Object.keys(node.__proto__)
2425
...(isDeno ? ['audioparam-nominal-range.html'] : []),
26+
// Bun: MessagePort callback errors bypass process.on('uncaughtException'), crashing the process.
27+
// These tests fail on all runtimes (active processing not implemented) but only crash Bun.
28+
...(isBun ? ['active-processing.https.html'] : []),
2529
])
2630

2731
for (const subdir of subdirs) {

0 commit comments

Comments
 (0)