GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JavaScript parser treats awaited using(...) call as await-using declaration · Issue #23036 · github/codeql

JavaScript parser treats awaited using(...) call as await-using declaration #23036

New issue
Copy link
New issue
Copy link
Closed
Closed
JavaScript parser treats awaited using(...) call as await-using declaration#23036
Copy link
Labels
javascriptPull requests that update Javascript codePull requests that update Javascript code

Description

@konard
konard
opened on Nov 5, 2026
Issue body actions

CodeQL 2.27.4 reports a syntax error for a valid call to a function named using when it is awaited. Found by checking extraction diagnostics in link-foundation/link-cli#166.

Minimal ECMAScript module:

async function using(store, action) { return action(store); }
await using({}, async () => {});

node --input-type=module < repro.mjs succeeds (Node 24 locally; Node 26, Bun and Deno accepted the original downstream conformance suite). CodeQL JavaScript extraction reports Syntax error: unexpected token '(' at the call, and SARIF includes js/syntax-error despite an empty results array and successful invocation. Real failing run: https://github.com/link-foundation/link-cli/actions/runs/42130454613 (CodeQL javascript-typescript).

The apparent parser cause is javascript/extractor/src/com/semmle/js/parser/Parser.java: isAwaitUsing() checks only the words await using, and parseStatement() then selects parseVarStatement(..., "using") without requiring a following binding identifier. This misclassifies the call as an await-using declaration. isUsingDecl() already has binding lookahead for unawaited using.

Expected: parse the expression statement as an awaited function call. Suggested fix: require valid declaration binding lookahead after await using before choosing the declaration production; retain actual await using resource = expression parsing. Add both forms as parser regression fixtures.

Workaround: rename the helper (downstream uses withClient) while keeping all conformance scenarios. Reproducer and collected SARIF: https://github.com/link-foundation/link-cli/tree/issue-165-a5206aa5b4c0/dev/log/issues/165/pulls/166 . The standalone reproducer is experiments/issue-165/codeql-using-repro.mjs.txt (text suffix prevents the known parser defect from breaking its own audit).

Activity

  1. sam-robson commented on Nov 6, 2026

    @sam-robson
    sam-robson
    on Nov 6, 2026
    Contributor
    More actions

    Thanks for the report @konard. We'll look into this and get back to you.

  2. sam-robson
    added
    javascriptPull requests that update Javascript codePull requests that update Javascript code
    on Nov 6, 2026
  3. sam-robson commented on Nov 11, 2026

    @sam-robson
    sam-robson
    on Nov 11, 2026
    Contributor
    More actions

    This has been fixed in #23040, thanks again!

  4. sam-robson
    closed this as completedon Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    javascriptPull requests that update Javascript codePull requests that update Javascript code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.