Closed bmomberger-bitovi closed 7 years ago
I think can.Construct
should have the ability to define properties for any instance. Something like:
can.Construct.defineInstanceProperty("_super", { ... });
Then, things like can-define can do what they must with this.
Hi,
since the new version 3.0.1 the workaround 2 ("https://jsbin.com/gareduwata/1/edit?html,js,output") for sealed objects fails :
_super: { type: "function" },
The _super always call "init" method of the parent class. I force 3.0.0 for my project to slove this problem.
@jcarbou does the work-around work with 3.0.2 which was released last night?
Yes !!
Thank you
Object.getPrototypeOf(this)._super =
Fixed by #21
(Note: This is a general issue with can-construct but I am reporting it here because this is where I found it and it is likely to show up in this context frequently)
When using can-construct-super with default DefineMaps,
this._super
cannot be set on the object because it is not part of the original object definition, and DefineMaps are sealed by default (preventing new properties like _super from being assigned). This completely nullifies the ability of can-construct-super to operate unless users specifically define_super
on classes extended from DefineMap or use unsealed objects.Done as a JSBin: https://jsbin.com/gareduwata/1/edit?html,js,output
There needs to be a generalized way of letting DefineMaps know that certain properties need to be universally exempt from being sealed out so other libraries can do their respective jobs. Please discuss how best to do so if you have an opinion.