tc39 / proposal-shadowrealm

ECMAScript Proposal, specs, and reference implementation for Realms
https://tc39.es/proposal-shadowrealm/
1.44k stars 67 forks source link

ShadowRealms WPT Problems #397

Closed mgaudet closed 1 month ago

mgaudet commented 9 months ago

Here are some issues I've seen in the ShadowRealms WPT that -might- be implementation specific, but I'd be curious about feedback from other implementations running tests:

caridy commented 9 months ago

/cc @rwaldron

rwaldron commented 9 months ago

The failures around undefined references are caused by those external script resources not being loaded into the ShadowRealm created for the test. That's not an "issue" with ShadowRealms or testing of ShadowRealms, it's just a bug in the test harness that needs to be fixed.

rwaldron commented 9 months ago

The reason assert_Memory is undefined is because it needs to be set as globalThis.assert_Memory = ... in wasm/jsapi/memory/assertions.js

rwaldron commented 9 months ago

As for the encoding back pressure issues, I can't say why that doesn't work—it looks like the outcomes are out of order? There's nothing about ShadowRealm itself that would cause that. I wanted to try running that test in either of the other implementations, but couldn't get my local runner to pick up the /encoding/streams/backpressure.any.shadowrealm.html test, even though it is definitely in the manifest 🤷

ptomato commented 1 month ago

The first issue is addressed with https://github.com/web-platform-tests/wpt/pull/48687. For the second, I also can't see any particular reason in the way encoding/streams/backpressure.any.js is written that would be incompatible with ShadowRealm, so I'd suggest looking for a cause in Firefox. FWIW, the test also fails in WebKit but it's obvious why: new TextDecoderStream() already fails in WebKit's ShadowRealm implementation.

Closing as everything addressable in WPT has been addressed for the moment, but feel free to reopen if new info is discovered about the encoding backpressure test.