Skip to content

Commit 3df56c7

Browse files
cpiroGregBrimble
authored andcommitted
fix evanw#3390: allow using disposable functions (evanw#3391)
1 parent 22f0818 commit 3df56c7

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
@@ -455,7 +455,7 @@ func Source(unsupportedJSFeatures compat.JSFeature) logger.Source {
455455
// These are for the "using" statement in TypeScript 5.2+
456456
export var __using = (stack, value, async) => {
457457
if (value != null) {
458-
if (typeof value !== 'object') throw TypeError('Object expected')
458+
if (typeof value !== 'object' && typeof value !== 'function') throw TypeError('Object expected')
459459
var dispose
460460
if (async) dispose = value[__knownSymbol('asyncDispose')]
461461
if (dispose === void 0) dispose = value[__knownSymbol('dispose')]

0 commit comments

Comments
 (0)