feat(codemode): support custom async iterators (#38141)

This commit is contained in:
Aiden Cline 2026-07-21 12:18:46 -05:00 committed by GitHub
commit 6f4b9504e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 636 additions and 51 deletions

View file

@ -36,7 +36,7 @@ export type StatementResult =
export type MemberReference = {
target: SafeObject | Array<unknown> | CodeModeRegExp | CodeModeURL
key: string | number
key: PropertyKey
}
export class CodeModeFunction {
@ -61,6 +61,12 @@ export class ComputedValue {
export class PromiseNamespace {}
export class SymbolNamespace {}
export const AsyncIteratorSymbol: unique symbol = Symbol("codemode.async-iterator")
export const IteratorSymbol: unique symbol = Symbol("codemode.iterator")
export const IteratorSymbols = [AsyncIteratorSymbol, IteratorSymbol] as const
export type PromiseMethodName = "all" | "allSettled" | "race" | "any" | "resolve" | "reject"
export class PromiseMethodReference {