Controlling DontEnum (was: ES4 draft: Object)

Mark Miller erights at
Tue Mar 11 14:57:12 PDT 2008

On Tue, Mar 11, 2008 at 2:32 PM, Peter Hall <peter.hall at> wrote:
>  Perhaps you can't achieve this without new syntax, but the declarative
>  approach seems cleanest and not prone to this sort of anomaly. If new
>  syntax could be considered, an |enumerable| attribute, complemented by
>  a |!enumerable| attribute seems very clean.
>  type T = {enumerable a:int, b:int};
>  let t:T = {a:1, b:2}:T; // a is enumerable, b is not
>  let s = {a:1, !enumerable b:1}; // a is enumerable, b is not
>  class C {
>   enumerable var p;
>  }

Hi Peter, I like the idea of a more declarative approach as well, if
one can be found. However, this proposal has two problems from our

* It introduces new syntax, as you mention.

* It depends on the proposed ES4 type system which is unacceptable to
the ES3.1 effort. ES3.1 needs a way to express these integrity
constraints in the absence of ES4 types.

Text by me above is hereby placed in the public domain


More information about the Es4-discuss mailing list