• Uncategorised
  • 0

What’s new in ECMAScript 2018

ECMAScript, the standard specification underlying JavaScript,[1] is on track for a new release, likely in June. So far, two proposals have been finalized for inclusion in the ECMAScript 2018 specification. Both are considered as fairly foundational work and not major features, said Zibi Braniecki, a senior software engineer at Mozilla who participates in the development of ECMAScript.

The two proposals include:

  • Lifting of the template literal restriction, to enable the embedding of languages, including domain-specific languages (DSLs). Currently, restrictions on escape clauses make this a problem. The revision cleans up the behavior of literals, letting them be used for DSLs so programmers can create their own minilanguages if neeeded.
  • Adding the s (dotAll) flag for regular expressions, providing consistent behavior for these expressions.

    The feature is intended to address limitations in which the dot (.) in regular expressions does not match line-terminator characters, said author Axel Rauschmeyer, who has focused on JavaScript. The s flag changes that. This flag will operate on an opt-in basis, so existing regular expressions patterns will not be affected.

There are four other features under strong consideration, which would make it easier to program with JavaScript, Braniecki said.

These include:

  • Regexp (regular expression) look-behind assertions, fixing a shortcoming with lookarounds, which are zero-width assertions that match a string without consuming anything. Currently, lookaround assertions can be used in a forward direction but not a backward direction. With lookbehind assertions, developers would be able to ensure that a pattern is or is not preceded by another; for example, matching a dollar amount without capturing the dollar sign.
  • Regexp Unicode property escapes, giving developers a better way to access Unicode character properties.

    Property escapes in the form of \p{…} and \P{…} would be added.

  • Promise.prototype.finally, for writing cleaner code when a programmer does not does not close a socket or clean up memory. A class of errors would be removed.
  • Updating the function Function.prototype.toString. The toString () method would return a string representing a function’s source code.

Braniecki expects the ECMAScript 2018 features to be implemented in browsers this year.

Some already have been implemented. Braniecki considers ECMAScript 2018 to be a fairly modest release. Next year, he anticipates bigger capabilities for ECMAScript, with conversations being held about asynchronous iterators and extending classes.

Where to get the ECMAScript 2018 specification

You can read the draft specification on GitHub[2].

A list of proposals[3] is posted as well.

References

  1. ^ the standard specification underlying JavaScript, (www.infoworld.com)
  2. ^ draft specification on GitHub (tc39.github.io)
  3. ^ list of proposals (github.com)

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

       
Apps & Games Clothing Electronics & Photo Large Appliances
Baby Womens Apparel Garden Lighting
Beauty Mens Apparel Outdoors Luggage
Books Girls Apparel Health & Personal Care Pet Supplies
Car Boys Apparel Home Shoes & Bags
Motorbike Computers & Accessories Kitchen Equipment Sports & Outdoors
Fashion DIY & Tools Jewellery Toys & Games