Skip to content

Commit

Permalink
polyfill Symbol.dispose and Symbol.asyncDispose
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Dec 16, 2024
1 parent 0768a5b commit bcb8aca
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/@tailwindcss-node/src/instrumentation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { DefaultMap } from '../../tailwindcss/src/utils/default-map'
import * as env from './env'

// See: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#:~:text=Symbol.dispose,-??=%20Symbol(%22Symbol.dispose
// @ts-expect-error — Ensure Symbol.dispose exists
Symbol.dispose ??= Symbol('Symbol.dispose')
// @ts-expect-error — Ensure Symbol.asyncDispose exists
Symbol.asyncDispose ??= Symbol('Symbol.asyncDispose')

export class Instrumentation implements Disposable {
#hits = new DefaultMap(() => ({ value: 0 }))
#timers = new DefaultMap(() => ({ value: 0n }))
Expand Down

0 comments on commit bcb8aca

Please sign in to comment.