为什么Firefox发出语法错误,class是保留标识符? [英] Why does Firefox give a syntax error, class is a reserved identifier?

查看:116
本文介绍了为什么Firefox发出语法错误,class是保留标识符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <!DOCTYPE HTML> 
< html>
< head>
< meta charset =UTF-8>
< title>< / title>
< script>
use strict;
class RangeIterator {}
< / script>
< / head>
< body>
< / body>
< / html>

我在控制台中看到以下错误:

  SyntaxError:class是一个保留标识符

任何想法为什么我得到这个错误?

解决方案

Firefox版本< 45根据


Opening a file named index.html with the following code on Firefox 43 renders the following error:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title></title>
    <script>
    "use strict";
    class RangeIterator {}
    </script>
    </head>
    <body>
    </body>
    </html>

I see the following error in the console:

SyntaxError: class is a reserved identifier

Any idea why I'm getting that error?

解决方案

Classes aren't supported in Firefox version < 45 according to this

这篇关于为什么Firefox发出语法错误,class是保留标识符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆