Closed darul75 closed 8 years ago
@darul75 the first case is an instance property that gets initialized in the constructor, so the initializer function generated from the assignment of value
will be called in the constructor during initialization of the instance and the returned value will then be assigned to prop
.
As for the decorated method fn
, it does not require an initializer as it is defined on the prototype of the resulting class.
And it depends, say you want to inject a different value into prop
, then you should definitely replace the initializer function, just as you did in your last example.
Please close as invalid/personal learning process.
Ok thanks
@darul75 so if all is well, how about closing the issue then?
Sorry pushed the wrong one
Hi,
When reading your specification I see that an initializer descriptor property is added and used before next defineProperty call.
But what I can not figure is why on these 2 cases initializer property is sometimes omitted.
will give after desugaring something like
I guess there is a reason but even after playing with babel repl I can not really figure out why.
What if I want to play with third decorator function param like this and change value at runtime, do I need to play with initializer function ? or it will never happened to play like this ? :)
I guess it is not a real case but just want to understand a little bit more :)