using Private name objects for declarative property definition.

Brendan Eich brendan at mozilla.com
Fri Jul 8 15:28:49 PDT 2011


On Jul 8, 2011, at 3:24 PM, Brendan Eich wrote:

> In other words, we don't gain any distinctiveness, or make any particular claims about private name objects that could not be made about other (deeply-frozen, generated-only, say by Object.create or Proxy.create in a distinguished factory function) kinds of objects, via a new typeof-type.

Oh, of course you meant to distinguish private names via typeof precisely to tell that they are not converted to strings when used as property names. For that test, the proposal

http://wiki.ecmascript.org/doku.php?id=harmony:private_name_objects

proposes an isName predicate function exported from the "@name" built-in module.

/be


More information about the es-discuss mailing list