flow-runtime
flow-runtime copied to clipboard
Fix babel-runtime Map predicate
Summary
- Treat
babel-runtime/core-js/mapMap instances as Maps in the flow-runtime built-in Map predicate. - Keep native
instanceof Mapbehavior, while also accepting values branded as[object Map]so Babel transform-runtime class property defaults do not fail withExpected: Map / Actual: Map. - Add a regression test using
babel-runtime/core-js/mapwithMap<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 oldnode-sasspostinstall fails on Node 24/Python2)yarn --cwd packages/flow-runtime test --grep "babel-runtime Map"yarn --cwd packages/flow-runtime testgit diff --check
Notes
yarn --cwd packages/flow-runtime lintstill fails on existing fixture semicolon errors and missingjsx-a11y/alt-textrule warnings unrelated to this change. Linting only the touched files exits 0 with existing warnings.