fix(codemode): preserve async callback semantics (#35603)

This commit is contained in:
Kit Langton 2026-07-06 17:29:11 -04:00 committed by GitHub
commit 754dd57177
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 136 additions and 53 deletions

View file

@ -45,6 +45,7 @@ export class CodeModeFunction {
readonly parameters: ReadonlyArray<AstNode>,
readonly body: AstNode,
readonly capturedScopes: ReadonlyArray<Map<string, Binding>>,
readonly async: boolean,
) {}
}
@ -153,7 +154,8 @@ export const unsupportedSyntax = (kind: string, node: AstNode): InterpreterRunti
[supportedSyntaxMessage],
)
export const isRecord = (value: unknown): value is Record<string, unknown> => typeof value === "object" && value !== null
export const isRecord = (value: unknown): value is Record<string, unknown> =>
typeof value === "object" && value !== null
export const asNode = (value: unknown, context: string): AstNode => {
if (!isRecord(value) || typeof value.type !== "string") {