Skip to content

Fix Map assertions with babel transform-runtime#308

Open
landeqiming666 wants to merge 1 commit into
gajus:masterfrom
landeqiming666:fix-transform-runtime-map-assertions
Open

Fix Map assertions with babel transform-runtime#308
landeqiming666 wants to merge 1 commit into
gajus:masterfrom
landeqiming666:fix-transform-runtime-map-assertions

Conversation

@landeqiming666

@landeqiming666 landeqiming666 commented Jul 12, 2026

Copy link
Copy Markdown

Summary

  • generate value references for global built-ins when converting class-property annotations, so Map can be rewritten consistently by babel-plugin-transform-runtime
  • accept real Map instances created outside the current realm, which avoids an instanceof mismatch when the runtime constructor differs
  • add focused transform and runtime regressions for the class-property path

This keeps the conversion change scoped to class-property decorators and covers both the generated reference and the runtime predicate path.

Fixes #177

Validation

  • yarn --cwd packages/babel-plugin-flow-runtime build
  • yarn --cwd packages/babel-plugin-flow-runtime test (240 passing)
  • yarn --cwd packages/flow-runtime test (169 passing)
  • targeted lint for all changed source and test files (no errors)
  • git diff --check

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


@landeqiming666

Copy link
Copy Markdown
Author

Hi, a brief follow-up on this PR. It remains clean and mergeable. The patch targets the class-property Map case under babel transform-runtime and includes end-to-end transform fixtures. Happy to adjust the transform scope or tests.

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