Sunsetting the JavaScript Standard
Back in 2012, the WHATWG set out to document the differences between the ECMAScript 5.1 specification and the compatibility and interoperability requirements for ECMAScript implementations in web browsers.
A specification draft was first published under the name of “Web ECMAScript”, but later renamed to just “JavaScript”. As such, the JavaScript Standard was born.
Our work on the JavaScript Standard consisted of three tasks:
- figuring out implementation differences for various non-standard features;
- filing browser bugs to get implementations to converge;
- and finally writing specification text for the common or most sensible behavior, hoping it would one day be upstreamed to ECMAScript.
That day has come.
Some remaining web compatibility issues are tracked in the repository for the ECMAScript spec, which javascript.spec.whatwg.org now redirects to. The rest of the contents of the JavaScript Standard have been upstreamed into ECMAScript, Annex B.
This is good news for everyone. Thanks to the JavaScript Standard, browser behavior has converged, increasing interoperability; non-standard features got well-defined and standardized; and the ECMAScript standard more closely matches reality.
Highlights:
The infamous “string HTML methods”:
String.prototype.anchor(name)
,String.prototype.big()
,String.prototype.blink()
,String.prototype.bold()
,String.prototype.fixed()
,String.prototype.fontcolor(color)
,String.prototype.fontsize(size)
,String.prototype.italics()
,String.prototype.link(href)
,String.prototype.small()
,String.prototype.strike()
,String.prototype.sub()
, andString.prototype.sup()
. Browsers implemented these slightly differently in various ways, which in one case lead to a security issue (and not just in theory!). It was an uphill battle, but eventually browsers and the ECMAScript spec matched the behavior that the JavaScript Standard had defined.Similarly, ECMAScript now has spec text for
String.prototype.substr(start, length)
.ECMAScript used to require a fixed, heavily outdated, version of the Unicode Standard for determining the set of whitespace characters, and what’s a valid identifier name. The JavaScript Standard required the latest available Unicode version instead. ECMAScript first updated the Unicode version number and later removed the fixed version reference altogether.
ECMAScript Annex B, which specifies things like
escape
andunescape
, used to be purely informative and only there “for compatibility with some older ECMAScript programs”. The JavaScript Standard made it normative and required for web browsers. Nowadays, the ECMAScript spec does the same.The JavaScript Standard documented the existence of HTML-like comment syntax (
<!--
and-->
). As of ECMAScript 2015, Annex B fully defines this syntax.The
__defineGetter__
,__defineSetter__
,__lookupGetter__
, and__lookupSetter__
methods onObject.prototype
are defined in ECMAScript Annex B, as is__proto__
.
So long, JavaScript Standard, and thanks for all the fish!