JScript branded quirks check in IE9

  • Follow


Not to say these quirks are having any practical importance, but i)
named function expression namespace and ii) terminal elision treatment
are IE's JScript "branded" features since forever.

If anyone has IE9 installed could you tell the results for:

(function f() {
 /* NOP */
})();

var arr = [0,1,];

// Should be undefined, IE<=8 gives function
window.alert('type of f: ' + typeof f);

// Should be 2, IE<=8 gives 3
window.alert('array length: ' + arr.length);

Just curious how IE "sticks to the traditions" :-)
0
Reply VK 3/27/2011 9:51:56 AM

On 27/03/2011 8:51 PM, VK wrote:
> (function f() {
>   /* NOP */
> })();
>
> var arr = [0,1,];
>
> // Should be undefined, IE<=8 gives function
> window.alert('type of f: ' + typeof f);

Here IE9 gives
type of f: undefined

With compatibility view on
type of f: function

> // Should be 2, IE<=8 gives 3
> window.alert('array length: ' + arr.length);

array length: 2

With compatibility view on
array length: 3

Andrew Poulos
0
Reply Andrew 3/27/2011 11:14:48 PM


On Mar 28, 9:14=A0am, Andrew Poulos <ap_p...@hotmail.com> wrote:
> On 27/03/2011 8:51 PM, VK wrote:
>
> > (function f() {
> > =A0 /* NOP */
> > })();
>
> > var arr =3D [0,1,];
>
> > // Should be undefined, IE<=3D8 gives function
> > window.alert('type of f: ' + typeof f);
>
> Here IE9 gives
> type of f: undefined
>
> With compatibility view on
> type of f: function
>
> > // Should be 2, IE<=3D8 gives 3
> > window.alert('array length: ' + arr.length);
>
> array length: 2
>
> With compatibility view on
> array length: 3

Wow, what happened at MS? They're getting serious about this standards
compliance thing - even implementing stuff from ES 5. Before you know
it, they'll be supporting canvas - oh wait, they've done that.


--
Rob
0
Reply RobG 3/28/2011 1:09:39 AM

2 Replies
377 Views

(page loaded in 0.045 seconds)


Reply: