Javascript ES5 的当前状态是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4042020/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 10:15:02  来源:igfitidea点击:

What's the current status of Javascript ES5?

javascriptecmascript-5

提问by Julio Faerman

What browsers / engines already support ES5 [strict]?

哪些浏览器/引擎已经支持 ES5 [严格]?

回答by Andy E

All the major browser vendorsmore or less have had ES5 fully implemented for a few years now (though IE 9 doesn't support strict mode). kangaxcreated this compatibility tablerepresenting the existence of ECMAScript 5 features in major browsers and other JS implementations. It will even list the availability of those features in the browser you visit the page with. It doesn't test conformance, however.

所有主要的浏览器供应商或多或少已经完全实现了 ES5 几年(尽管 IE 9 不支持严格模式)。 kangax创建了这个兼容性表,表示主要浏览器和其他 JS 实现中 ECMAScript 5 特性的存在。它甚至会在您访问页面的浏览器中列出这些功能的可用性。但是,它不测试一致性。

Kris Kowalcreated es5-shim.js, which provides as much of the functionality of ES5 as possible to ES3 compliant implementations. Of course, not everything is possible but the goal of the shim is to allow code to gracefully degrade.

Kris Kowal创建了es5-shim.js,它为 ES3 兼容的实现提供了尽可能多的 ES5 功能。当然,并非一切皆有可能,但 shim 的目标是允许代码优雅地降级。

回答by J?rg W Mittag

AFAIK, the only implementation of ECMAScript 5 is BESEN. It's a bit disappointing, really. BESEN was created from scratch, by a single developer, in just a couple of weeks. Google, Microsoft, Apple, Mozilla and Opera on the other hand, with all their developers, all their money, haven't been able to provide an implementation after almost 11 months. And that is despitethe fact that they have dozens of developers, have an already working implementation as a base to start from, were a part of the standardization process from day one (and thus had access to the specs long before the author of BESEN did), andmost of the features in the ES5 specification were taken from alreadyexisting implementations in the browsers.

AFAIK,ECMAScript 5 的唯一实现是BESEN。这有点令人失望,真的。BESEN 是由一个开发人员在短短几周内从头开始创建的。另一方面,谷歌、微软、苹果、Mozilla 和 Opera 及其所有的开发人员和所有的资金,在近11 个月后仍未能提供实施。那就是,尽管事实上,他们有几十个开发人员,有一个已经工作的实施为基地,以从,分别来自天一个标准化进程的一部分(启动,因此不得不进入规范BESEN笔者之前多久没),并且ES5 规范中的大部分功能已经取自浏览器中的现有实现。

AFAIK, the onlytwo features that in ECMAScript 5 that were not already part of JavaScript were the Properties API and Strict Mode.

AFAIK,ECMAScript 5 中仅有的两个尚未成为 JavaScript 一部分的功能是 Properties API 和 Strict Mode。

回答by Kevin Cantu

This page of the ecmascript wikihas links to the bugs remaining in the major implementations in progress.

ecmascript wiki 的这个页面包含指向正在进行的主要实现中剩余的错误的链接。