I’m trying to test the writable property of undefined (assigning a value to undefined) using older JavaScript versions in Firefox but for some reason the code used to specify a version isn’t working.
(To be more specific, versions inferior to 1.8.5 so that would be <= 1.8.2 I think.)
I was trying to test the writable property of undefined (assigning a value to undefined).
–> https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/undefined
I tried this method found on the Mozilla Developer Network :
<script type="application/javascript;version=1.7">
but it doesn’t work. I also tried :
<script language="javascript" type="application/javascript;version=1.7">
and this :
<script language="javascript1.7" type="application/javascript">
but neither of them worked.
The code I tested this with is the following :
undefined = true;
var k;
console.log(k);
I also tried to substitute undefined with window.undefined, not that there is really a difference.
So my question is two-fold :
-
How can I make this work in Firefox ?
-
Is there a cross-browser way of achieving this ?
Thanks in advance !
EDIT: I’m using Firefox 19.
language="javascript1.7"specifies a minimum version, not an actual version.You will need to use an older version of the browser, one that has the version you want, to test this.
(Side-note: There are enough bugs in IE’s Compatibility View, can you imagine a browser that has to implement every version of JS individually?)