While Chrome runs Javascript marked as "javascript1.7", it does not support JS1.7 functions, such as the "let" variable statement with restrictions.
This code will work on Firefox 3.5, but not on Chrome using V8:
<script language="javascript" type="application/javascript;version=1.7"> function foo(){ let a = 4; alert(a); }; foo(); </script>
If you change the language to "javascript1.7" and omit this type, it will not work with JS 1.7 functions in Firefox 3.5. A type section is needed.
This seems like a common WebKit error, https://bugs.webkit.org/show_bug.cgi?id=23097 ; it may be that Chrome emulates the behavior of Safari, even if it uses a different engine.
When asked about support for JS 1.8 features , the V8 team said it was trying to keep track of the version used by Safari, so the pages would act the same in both browsers.
Ben Combee Jul 14 '09 at 13:24 2009-07-14 13:24
source share