Skip to content

Commit e7bf735

Browse files
authored
fix #3390: allow using disposable functions (#3391)
1 parent 24bea0e commit e7bf735

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/runtime/runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ func Source(unsupportedJSFeatures compat.JSFeature) logger.Source {
462462
// These are for the "using" statement in TypeScript 5.2+
463463
export var __using = (stack, value, async) => {
464464
if (value != null) {
465-
if (typeof value !== 'object') throw TypeError('Object expected')
465+
if (typeof value !== 'object' && typeof value !== 'function') throw TypeError('Object expected')
466466
var dispose
467467
if (async) dispose = value[__knownSymbol('asyncDispose')]
468468
if (dispose === void 0) dispose = value[__knownSymbol('dispose')]

0 commit comments

Comments
 (0)