flow-runtime icon indicating copy to clipboard operation
flow-runtime copied to clipboard

Fix babel-runtime Map predicate

Open selimeneserd opened this issue 6 months ago • 0 comments

Summary

  • Treat babel-runtime/core-js/map Map instances as Maps in the flow-runtime built-in Map predicate.
  • Keep native instanceof Map behavior, while also accepting values branded as [object Map] so Babel transform-runtime class property defaults do not fail with Expected: Map / Actual: Map.
  • Add a regression test using babel-runtime/core-js/map with Map<string, number>.

Fixes #177

IssueHunt bounty: https://oss.issuehunt.io/r/gajus/flow-runtime/issues/177

Testing

  • yarn install --frozen-lockfile --ignore-scripts (used because the repo's old node-sass postinstall fails on Node 24/Python2)
  • yarn --cwd packages/flow-runtime test --grep "babel-runtime Map"
  • yarn --cwd packages/flow-runtime test
  • git diff --check

Notes

  • yarn --cwd packages/flow-runtime lint still fails on existing fixture semicolon errors and missing jsx-a11y/alt-text rule warnings unrelated to this change. Linting only the touched files exits 0 with existing warnings.

selimeneserd avatar May 11 '26 06:05 selimeneserd