W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2012

[Bug 18547] Add [ImplicitThis] to EventTarget?

From: <bugzilla@jessica.w3.org>
Date: Fri, 07 Dec 2012 00:59:04 +0000
To: public-script-coord@w3.org
Message-ID: <bug-18547-3890-hvOq3grbGo@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=18547

--- Comment #6 from Cameron McCormack <cam@mcc.id.au> ---
(In reply to comment #5)
> Is there a black-box-detectable difference between putting [ImplicitThis] on
> all interfaces implemented by the global object (which may not be a Window)
> and simply having [ImplicitThis] on all interfaces?

No, there would be no difference, because when calling a function from some
[ImplicitThis]-annotated not-implemented-by-Window interface, you will get a
TypeError thrown from step 1 of
http://dev.w3.org/2006/webapi/WebIDL/#es-operations, and if it wasn't
[ImplicitThis]-annotated then you would get a TypeError because
http://es5.github.com/#x10.4.3 would turn the null into the global object, and
this wouldn't be the right kind of object to call the function on.

One of the problems mentioned in the IRC log was that without [ImplicitThis],

  interface WindowProxy {
    readonly attribute WindowProxy window;
  };

you can't actually evaluate `window` in strict mode.  And anyway [ImplicitThis]
is currently only defined to work on operations, not attributes.

So we obviously need it for that attribute.  And comment 0 says we need it for
window.addEventListener.call().  Do we need it for a specific set of functions,
or just for everything on window?  I'm wondering if doing it for everything on
window defeats (some of) the purpose of strict mode.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Friday, 7 December 2012 00:59:07 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:08 UTC