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

[Bug 24248] Inconsistency between WebIDL callback function default this and JS strict mode default this

From: <bugzilla@jessica.w3.org>
Date: Fri, 10 Jan 2014 00:25:34 +0000
To: public-script-coord@w3.org
Message-ID: <bug-24248-3890-JOKtQ7ofde@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=24248

Allen Wirfs-Brock <allen@wirfs-brock.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |allen@wirfs-brock.com

--- Comment #1 from Allen Wirfs-Brock <allen@wirfs-brock.com> ---
(In reply to Nikhil from comment #0)
> http://www.w3.org/TR/WebIDL/#es-invoking-callback-functions
> 
> When a JS callback is invoked, WebIDL specifies default `this` to be `null`,
> but JS strict mode functions require that `this` be `undefined`.

That isn't  exactly true. See step 1 of
http://www.ecma-international.org/ecma-262/5.1/#sec-10.4.3 Strict mode
functions accept whatever is passed to them as a thisValue without modifying
it.

It's true that the function call operator
http://www.ecma-international.org/ecma-262/5.1/#sec-11.2.3 passes undefined as
the thisValue (step 7.a) but other means of function invocation (the call/apply
functions) can pass null as the thisValue to a function.

BTW, I'm not arguing against the proposed change (I'm reserving judgement on
that), just saying that it isn't an ES requirement one way or the other.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Received on Friday, 10 January 2014 00:25:35 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:51 UTC