I am having an issue with order semantics regarding
https://github.com/tc39/proposal-class-fields with derived classes defining
or overriding data member values that are used in the base class
constructor for initialization of properties of the class.

This means the Super Class / Base Class'es constructor does not yet have
access to the default field values of the derived class it is initiating.

    class Base {
        constructor() {
             ....
             .. idAttribute ..
             ....
        }
        idAttribute = 'id';
    }
   class Derived extends Base {
        constructor() {
             super();
             ....
        }
        idAttribute = '_id';
   }

All would mean having a separate initialize() function, but even this
solution is flawed when there is a third level in the hierarchy. And as
super() is required it means there seems to be no way round this issue. The
only way I can see is some form of override keyword ?


Has anyone got any solutions to this issue or work arounds ?
-- 
Aaron Gray

Independent Open Source Software Engineer, Computer Language Researcher,
Information Theorist, and amateur computer scientist.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to