HTML5 spec. seems to unnecessarily ban strict mode event handlers

Garrett Smith dhtmlkitchen at gmail.com
Thu Mar 17 19:24:08 PDT 2011


On 3/17/11, Juriy Zaytsev <kangax at gmail.com> wrote:
> Thanks for bringing this quirk to the surface. I remember being puzzled by
> the presence of this wording in HTML5 spec but never got a chance to do
> anything about it.
>
> By "non-standard" I meant "not part of ECMA-262 standard" (not that it's not
> part of any other standard, such as HTML5... which — to be precise — is not
> yet a standard, as far as I understand). I changed the wording of the test
> to make it clearer — http://kangax.github.com/es5-compat-table/strict-mode/
>
HTML5 is modular and granular. Each part can have a status.


> And while we're on this subject, I've been tinkering with compat. table of
> non-standard ES features across various (modern and not so modern)
> implementations — http://kangax.github.com/es5-compat-table/non-standard/
>
The table indicates FF as the only browser supporting Array generics.
Array generics are standard and work in Webki, Opera and Chrome .

I think you meant what I call static Array Generics, though I think I
may have coined that term. That is, Array.push( a, "f" ); can be used
in just Firefox.

// Array Generic
var a = {};
Array.prototype.push.call( a, "f" );
a[0]; // "f"

// Static Array Generic
var a = {};
Array.push( a, "f" );
a[0]; // "f"

Some IE versions have bugs with using Array.prototype built-ins
generically. For example, where `obj` is anything other than an Array,
`Array.prototype.push.call( obj );` won't update `obj.length`.
-- 
Garrett


More information about the es-discuss mailing list