Skip to content

[embind] Rename rawType -> typeID. NFC - #28157

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:embind_typeid
Nov 4, 2026
Merged

sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:embind_typeid

Conversation

@sbc100

@sbc100 sbc100 commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Rename rawType and related raw*Type variables/parameters in embind JS code to typeID and *TypeID. This matches the existing // typeID -> ... comments and C++ TYPEID typedef and makes it clear that these hold numeric TYPEID pointers rather than type names or registered type objects.

Inspired by the question/confusion in:
#28138 (comment)

@sbc100
sbc100 requested a review from brendandahl November 3, 2026 23:46

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request systematically renames various raw type parameters to use a TypeID suffix (such as typeID, pointerTypeID, and baseClassTypeID) across libembind.js, libembind_gen.js, and libembind_shared.js to improve naming consistency. The review comments correctly identify that rawValueType in the _embind_register_enum function was missed in both libembind.js and libembind_gen.js, and they provide actionable suggestions to rename it to valueTypeID for complete consistency.

Comment thread src/lib/libembind.js Resolved
Comment thread src/lib/libembind_gen.js Resolved
@sbc100
sbc100 requested a review from kripken November 3, 2026 23:53
@sbc100 sbc100 changed the title [embind] Rename rawType / raw*Type to typeID / *TypeID. NFC [embind] Rename rawType -> typeID. NFC Nov 3, 2026

@brendandahl brendandahl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a few more that don't use the word raw that we should probably update to. May be worth having gemini do one more pass.

Comment thread src/lib/libembind_gen.js Resolved
Comment thread src/lib/libembind_gen.js Resolved
Comment thread src/lib/libembind_gen.js Resolved
Comment thread src/lib/libembind_gen.js Resolved
Rename `rawType` and related `raw*Type` variables/parameters in
embind JS code to `typeID` and `*TypeID`.  This matches the existing
`// typeID -> ...` comments and C++ `TYPEID` typedef and makes it clear
that these hold numeric `TYPEID` pointers rather than type names or
registered type objects.

Inspired by the question/confusion in:
emscripten-core#28138 (comment)
@sbc100

sbc100 commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Done!

@sbc100
sbc100 requested a review from brendandahl November 4, 2026 18:34
@sbc100
sbc100 merged commit 70a8d2b into emscripten-core:main Nov 4, 2026
42 checks passed
@sbc100
sbc100 deleted the embind_typeid branch November 4, 2026 22:02
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.

2 participants