Re: [heycam/webidl] Introduce a SameRealmBrandCheck extended attribute (#718)

> I'd like to understand how this reduces complexity in specs, because this definitely increases complexity in implementations as far as I can tell.

Hmm, talking to @tschneidereit recently he implied it would decrease the complexity, especially given Gecko's multi-globals implementation. For example, it allows us to entirely avoid worrying about current realm vs. relevant realm! It also enables self-hosting of built-ins in JavaScript more easily.

> Quite honestly, my preferred answer there would be to expose the existing brand check to script.

I'm not sure how that would work for the polyfilled class itself. For example, given some interface `Foo` with method `bar`, how would you polyfill that `window1.Foo.prototype.bar.call(fooFromWindow2)` works, but `window1.Foo.prototype.bar.call(notAFoo)` does not work?

@littledan had some ideas based on, e.g., using the script URL as a source of identity across realms in https://github.com/littledan/serializable-objects, in particular https://github.com/littledan/serializable-objects#class-identifier-tuple. But those all seemed pretty complex to me.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/718#issuecomment-487207566

Received on Friday, 26 April 2019 21:30:33 UTC