On Sep 24, 2011, at 9:03 AM, David Bruant wrote:

> ...
> I'm a big fan of the proto operator proposal, however, as raised
> previously this operator relies on the object being created to have an
> intialisation syntax. This prevents, for instance, Date objects to have
> a custom prototype with this method. I am not very familiar with it yet,
> but I think that if they ever came to life, ParallelArrays [2] would
> suffer from the same problem.
> By the way, could someone add this concern as a note ("open issue" or
> "limitation" or something like this) in the proto operator page, please?
> 

The solution for Date that I intend to implement for ES.next is to respecify 
Date so it uses a private named property instead of the [[PrimitiveValue]] 
internal property to store the time value.  The primary thing this changes is 
that private names properties are inheritable.  That means that you will be 
able to subclass date like so:

let ExtendedDate = Date <| function (...args) {
   super.constructor(...args);  /*this will initialize the private time value 
property */
   /* any ExtendedDate constructor initialization */
}

It will probably makes sense to redefine all the private state internal 
properties in a similar manner and hence make them all 
"subclassable" .  With private names available to implement private instance 
variables the only things that really need to be non-inheritable "internal 
properties" are the semantic methods such as [[Get]], [[Put]], 
[[DefineOwnProperty]].etc.

Allen


_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to