proposal-explicit-resource-management icon indicating copy to clipboard operation
proposal-explicit-resource-management copied to clipboard

In the spec draft, missing exposing of `Symbol.{ dispose, asyncDispose }`

Open zloirock opened this issue 2 years ago • 6 comments

Like here:

image

That causes such issues: https://github.com/nodejs/node/issues/48699

zloirock avatar Jul 07 '23 21:07 zloirock

I don't think this is the cause of node having the wrong descriptors here, to be fair, but it's certainly an omission.

ljharb avatar Jul 07 '23 21:07 ljharb

The current spec has nothing about the descriptors of those symbols (but it should be for consistency with all the rest), so it seems it's the cause of this issue.

zloirock avatar Jul 07 '23 22:07 zloirock

The original implementer in node wasn't looking at the spec either way, they were just adding the Symbols.

ljharb avatar Jul 07 '23 22:07 ljharb

As an option.

zloirock avatar Jul 07 '23 22:07 zloirock

I can add these to the proposal spec, though the intent was to emulate the exact same behavior we specify for every other built-in symbol on Symbol.

rbuckton avatar Jul 13 '23 16:07 rbuckton

Maybe this is related to typechecking the Playwright project by using tsc --noEmit. I get a bunch of errors:

node_modules/playwright-core/types/types.d.ts:16639:11 - error TS2339: Property 'asyncDispose' does not exist on type 'SymbolConstructor'.

16639   [Symbol.asyncDispose](): Promise<void>;

napsta32 avatar Dec 28 '23 22:12 napsta32