On the first day of TC39 (hosted by Facebook), we covered: the final features we hope make it into ES2017, improvements to regular expressions and promises, a grab-bag of tweaks to modules, and assorted other topics.
ES2017 Last Call
We started the day by looking at features that hadn't yet made it to Stage 4, but which the champion thinks will make it by the deadline (which is more or less now).
There were two such features:
global will reference the global variable in standard ECMAScript. This paves the cowpath laid down by Node.
Second, Shared Array Buffer, "Shared memory and atomics for ECMAscript." Dave wrote about this back in February 2015 about how developers can use Shared Array Buffer as an Extensible Web primitive for experimenting with parallelism approaches in userland:
And crucially, developers would be able to start building higher-level abstractions. As one example, I’ve sketched out API ideas for region-slicing, data-race-free sharing of portions of a single binary buffer, and this could easily be polyfilled with SharedArrayBuffer.
And the Extensible Web approach lets us experiment with and settle on these and other high-level abstractions faster than trying to standardize them directly.
These features may still stall before making it into ES2017, but all signs are positive at the moment.
. in Regular Expressions
. character in normal regular expressions doesn't match newlines:
/foo.bar/.test('foo\nbar'); // → false
You can use this workaround to mean "any character", but it's pretty darn cryptic:
/foo[^]bar/.test('foo\nbar'); // → true
The solution is to add a new
/s flag that fixes the meaning of
/foo.bar/s.test('foo\nbar'); // → true
This feature advanced to Stage 1 and will likely advance to Stage 2 next meeting.
Tomorrow, I'll cover some of the discussions around promises and modules, along with anything else we do on Day 2.