My ECMAScript 7 wishlist

Rick Waldron waldron.rick at
Thu Jun 5 16:08:49 PDT 2014

On Thu, Jun 5, 2014 at 6:42 PM, Nicholas C. Zakas <
standards at> wrote:

> I wrote this blog post about some of the pain points I'm dealing with and
> dreams of how ES7 might be able to address them:
> A short overview in lieu of posting the whole article here:
> * `Array.prototype.first()`, `Array.prototype.last()` - return the first
> and last items, respectively.

Check out Till's response to the previous thread about first and last:

> * `Array.prototype.isEmpty()` - return true when empty (would also be nice
> on strings, maps, etc.).


> * `Function.empty` - a standard empty function that can be used when you
> just want an empty function (IMHO, it indicates intent much better than
> other options toda).


> * Custom descriptor attributes - David mentioned this likely will never
> happen, which makes me sad. Maybe the decorators proposal solves this use
> case.

The Proxy security issue:
I had hoped that a "black list" of writable, configurable, enumerable
properties would suffice:
but I there is a discussion around some form of custom meta properties.

> * `Object.deepPreventExtensions()`, `Object.deepSeal()`,
> `Object.deepFreeze()` - deep versions of `Object.preventExtensions()`, et
> al.

Does "deep" mean that a Map instance's [[MapData]] is frozen if deepFreeze
is called on a ? eg. what happens here:

var m = Object.deepFreeze(new Map());
m.set(1, 1);

In your blog it mentions the silent failure in non-strict mode, I suspect
that would still have to apply to these additions for semantic consistency.

> * `Object.preventUndeclaredGet()` - change an object's behavior to throw
> an error if you try to read from a property that doesn't exist (instead of
> returning `undefine`).

This can be achieved with Proxy right, or is that too cumbersome?

> * Lightweight traits - simple syntax sugar for object literals and classes
> to facilitate mixins.

+ 1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list