html icon indicating copy to clipboard operation
html copied to clipboard

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

Open michaelficarra opened this issue 1 year ago • 3 comments

As of https://github.com/tc39/ecma262/pull/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 https://github.com/tc39/ecma262/pull/3408. It wasn't a problem that HTML continued to use the old-style Type checks until https://github.com/tc39/ecma262/pull/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


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

michaelficarra avatar Sep 19 '24 16:09 michaelficarra

Nice, thank you!

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

domenic avatar Sep 20 '24 01:09 domenic

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

bakkot avatar Sep 21 '24 03:09 bakkot

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.)

domenic avatar Sep 21 '24 05:09 domenic

@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.

michaelficarra avatar Oct 26 '24 00:10 michaelficarra

@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.

michaelficarra avatar Oct 28 '24 20:10 michaelficarra