Skip to content

Commit 87cd6de

Browse files
authored
WasmFS: Fix closure error on OPFS backend code with two API forms (#19554)
1 parent 48b0645 commit 87cd6de

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/library_wasmfs_opfs.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ mergeInto(LibraryManager.library, {
241241
let accessHandle;
242242
#if PTHREADS
243243
// TODO: Remove this once the Access Handles API has settled.
244-
if (FileSystemFileHandle.prototype.createSyncAccessHandle.length == 0) {
244+
// TODO: Closure is confused by this code that supports two versions of
245+
// the same API, so suppress type checking on it.
246+
/** @suppress {checkTypes} */
247+
var len = FileSystemFileHandle.prototype.createSyncAccessHandle.length;
248+
if (len == 0) {
245249
accessHandle = await fileHandle.createSyncAccessHandle();
246250
} else {
247251
accessHandle = await fileHandle.createSyncAccessHandle(

0 commit comments

Comments
 (0)