[Bug 18547] Add [ImplicitThis] to EventTarget?

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