Skip to content

Fix babel-runtime Map predicate#289

Open
sellimenes wants to merge 1 commit into
gajus:masterfrom
sellimenes:fix-babel-runtime-map-predicate
Open

Fix babel-runtime Map predicate#289
sellimenes wants to merge 1 commit into
gajus:masterfrom
sellimenes:fix-babel-runtime-map-predicate

Conversation

@sellimenes
Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Map class property assertion fails when using babel-plugin-transform-runtime

1 participant