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

In the future, make assert_class_string and idlharness class string tests stricter #23206

Open
domenic opened this issue Apr 23, 2020 · 2 comments

Comments

@domenic
Copy link
Member

domenic commented Apr 23, 2020

For a long time, Web IDL "class string" behavior was non-interoperable. As such, currently assert_class_string only tests the interoperable subset: basically, does Object.prototype.toString() produce the right result on instances. This is good, because if it tested the full spec semantics, then every idlharness-based test would get a bunch of noisy failures for areas outside the interoperable subset. Instead, we tested the full spec semantics for one or two interfaces in the WebIDL/ directory.

However, we seem to be converging on interoperability. In particular, whatwg/webidl#357 has been merged, with implementer support. Once implementers implement it, we should consider expanding test coverage for class strings to test the full spec semantics.

We should not do this right away, to avoid the thousands-of-noisy-failures issue. But once implemented, we can do so, for the following benefits:

  • Gives full coverage of all classes, not just a few. In particular this is important for classes like WebAssembly or Streams, which might be implemented using different technology. For example, we could revert WASM JS API: Test new Web IDL class string behavior #23205 and let idlharness take care of it.

  • Lets us remove most of the class string tests in the WebIDL/ folder.

Note that this work was started in #23108, but I asked that it be put on hold. So this issue is basically to track reopening and merging that PR in a future time.

/cc @annevk @shvaikalesh @evilpie @TimothyGu

@TimothyGu
Copy link
Member

Looks like all three browsers have implemented this change!

a = new URL('http://a/');
assert_equals(Object.prototype.toString.call(a), "[object URL]");
delete URL.prototype[Symbol.toStringTag];
assert_equals(Object.prototype.toString.call(a), "[object Object]");

@ExE-Boss
Copy link
Contributor

See also: #27239

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

No branches or pull requests

5 participants