When will v8 implement ECMAScript 5? When will v8 implement ECMAScript 5? google-chrome google-chrome

When will v8 implement ECMAScript 5?


ECMAScript 5 was actually designed in such way so that implementations don't need to be "updated to run" on it.

There are few changes in existing behavior but mainly ES5 adds new native objects (e.g. Object.create, Array.prototype.map, String.prototype.trim, etc.) and standardizes some of the existing de-facto features (from ubiquitous "line terminators in string literals", "property access on strings", and "indirect eval behavior" to less popular "accessors" and array/string extensions).

The biggest change in behavior — strict mode — was made opt-in for the very same reason; to make transition from ES3 to ES5 less painful.

Having said that, V8 does implement a noticeable chunk of ES5 features, including strict mode (one of the recent additions).

If you look at my ES5 compat. table you can see ES5 features implemented in Chrome — which should closely (and I would think — completely) correlate to V8.

You can also see that support for strict mode is largely implemented in Chrome which means that it should be in V8 as well. To double check, I just ran this code in console (v8 v3.2.3.1) and got SyntaxError as expected:

> (function(){"use strict"; with({x:1}) return x})()(shell):1: SyntaxError: Strict mode code may not include a with statement(function(){"use strict"; with({x:1}) return x})()                          ^^^^

So there you have it. V8 definitely implements majority of ES5 features, including strict mode ;)