Skip to content

AST scanner only detects ~5 of the fixture's ~40 features (walkAST limitation) #4

Description

@Shinrai

Surfaced during v4 onboarding.

Scanner gap

walkAST (in src) detects only ~5 of the ~40 ES features actually used in test/testfile.js (it finds Promise, Array.includes, Object.entries, Array.flat, Object.fromEntries, and misses the rest). The es<version>.test.js suite originally asserted that every feature in the entire MDN catalog for all later ES versions appears in result.polyfills, which could never pass given the scanner's real output. During onboarding those tests were rewritten to the correct version-gating invariant they were trying to express — (A) nothing at-or-below the target is polyfilled, (B) every polyfilled feature belongs to a strictly-newer version — which is honest (does NOT assert full detection, so it doesn't mask this gap) and catches real regressions. Improving walkAST's coverage of the feature catalog is the real follow-up.

Also changed during onboarding (worth a review)

  • src/lib/polyfillSources.js had a dead require("node-fetch") (not in deps/lockfile → MODULE_NOT_FOUND made the whole suite unloadable); switched to global fetch (Node 18+). Only used in the untested source === "cloudflare" branch.
  • test/index.test.js was overwriting + deleting the shared committed fixture test/testfile.js in beforeAll/afterAll, which races destructively under the per-file-parallel runner; pointed it at a dedicated test/index.testfile.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions