Re: [whatwg/webidl] Elaborate on Exposed=* advice (Issue #1119)

@caridy `setTimeout`, `structuredClone`, `atob` etc are operation members of Web IDL global interfaces like Window in HTML. They’re even sensitive to the receiver’s brand and will throw TypeErrors if called with unbranded objects, though a special behavior unique to global interfaces maps `undefined` to the global platform object of the same [[Realm]] as the function being called so this is not frequently noticed.

![atob.call({}, [ "" ]); → TypeError: Illegal invocation](https://user-images.githubusercontent.com/6257356/206911908-462ae382-62d5-4f27-92a1-ca7f93386e97.png)

Currently there doesn’t seem to be a way for such Web IDL operations to be coherent for a ShadowRealm global object. Has this already been addressed somewhere (assuming these are intended to be included)? It seems like this would need new spec text to become possible, but I didn’t find anything.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1119#issuecomment-1345581184

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1119/1345581184@github.com>

Received on Sunday, 11 December 2022 15:18:51 UTC