Woops I forgot ___ which is 0. Non-enumerable, non-configurable, non-writable. Since undefined is what indicates lack of a property, this isn't an issue. As for bounding, it's simple enough to specify the valid range to be 0-12. Or use strings with the names instead of numbers, though that loses the ability to combine flags via bitwise ops.
I also forgot to mention how accessors could work. In my experience using this model in place of descriptors, accessors live where the value would be. If a query indicates that a property is an accessor then the value returned from 'get' needs to conform to something like { get, set }. Another option would be to use another trap or another param to indicate 'get' is to return the getter/setter for a property instead of the calculated value. Data properties are far more common and it's worth optimizing for their use in terms of both API complexity and performance.
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss