Proposal: Object.defineProperty shorthand

Axel Rauschmayer axel at
Tue May 31 15:47:25 PDT 2011

> From: Brendan Eich <brendan at>
> A Unix-y (ls(1) inspired) mid-point might be to use strings:
> var foo = {
>   {"!c!e!w"} high_integrity: 42,
>   ...
> };

Would it make sense to turn this into a generic system for adding meta-data to properties? Python’s decorators and Java’s annotations come to mind which are used for various great purposes in libraries. Some of Java’s annotations such @Override or @Nullable also cross the border into language territory.

Won’t enumerable go away (as in “used less”) in the long run? Thus there is less of a reason to provide a concise syntax for specifying enumerability.

I would prefer something like

var foo = {
  { !conf !enum !write } high_integrity: 42,

Yes, it is more verbose, but also more descriptive.

Dr. Axel Rauschmayer

axel at


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

More information about the es-discuss mailing list