W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2015

RE: Global method calls

From: Domenic Denicola <d@domenic.me>
Date: Thu, 26 Feb 2015 22:35:10 +0000
To: Boris Zbarsky <bzbarsky@mit.edu>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <CY1PR0501MB1369B697DA2396D419F9D2E7DF140@CY1PR0501MB1369.namprd05.prod.outlook.com>
From: Boris Zbarsky [mailto:bzbarsky@mit.edu] 

> How is that black-box observably different from having every single Web IDL method be [ImplicitThis]?

Having thought about this for a bit, I think it is not different. If you picture the beginning of every WebIDL method as beginning with

const thisToUse = this === undefined ? window : this;
if (!brandCheck(this, <<interfaceSpecificBrandHere>>)) { throw new TypeError(); }

then all the cases except methods on Window/objects in Window's prototype chain will just fail the second line if the first line coerces undefined to window.

The only exceptions I can think of are maybe [LenientThis], and any WebIDL methods that don't happen to check branding, which I am not sure is possible.
Received on Thursday, 26 February 2015 22:35:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:24 UTC