Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: replace uses of the Type macro with is-a tests #10635

Merged
merged 4 commits into from
Oct 28, 2024

Conversation

michaelficarra
Copy link
Contributor

@michaelficarra michaelficarra commented Sep 19, 2024

As of tc39/ecma262#2874 (September 2022), ecma262 no longer uses the Type macro for simple type tests. We have replaced them with "x is a Y"-style notation. We also replaced most of the remaining uses of the Type macro with the new SameType AO in tc39/ecma262#3408. It wasn't a problem that HTML continued to use the old-style Type checks until tc39/ecma262#3420 which removes the final use of the Type macro and with it the Type macro itself.

This is the HTML integration, updating the type tests to the new form and allowing us to un-define the Type macro in ecma262.

/cc @syg @bakkot


/acknowledgements.html ( diff )
/canvas.html ( diff )
/custom-elements.html ( diff )
/dom.html ( diff )
/infrastructure.html ( diff )
/structured-data.html ( diff )

@domenic
Copy link
Member

domenic commented Sep 20, 2024

Nice, thank you!

But, would you be willing to make these links, like they are in ecma262?

@bakkot
Copy link
Contributor

bakkot commented Sep 21, 2024

This will need to be done for at least Streams as well, possibly other specs too.

@domenic
Copy link
Member

domenic commented Sep 21, 2024

Good point. Web IDL is the big one. (In theory Streams should be using more Web IDL to abstract away ES details; in practice it hasn't been updated yet.)

@michaelficarra
Copy link
Contributor Author

@domenic I've added links. I'm not sure if you want undefined/null linked. I linked things in the way they are linked in ECMA-262, so no link for undefined/null and linking the whole text "is not an Object", etc.

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

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

Thanks very much!

@michaelficarra
Copy link
Contributor Author

@domenic @bakkot I created PRs for Web IDL, Streams, Console, and Infra. Those were the only repos in the whatwg org that I could find with references to the old Type macro. PTAL and let me know if you find any others that need updating.

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

Successfully merging this pull request may close these issues.

3 participants