Closed MaximBalaganskiy closed 8 years ago
@PWKad This is likely a difference in the way that TS transpiles and handle property descriptors vs. Babel.
Actually, I don't think that TS always provides the property descriptor. That's probably the issue. If one isn't provided your going to need to handle that situation.
(Strictly speaking, I think this is non-spec compliance on the TS part most likely, but we need to handle it unfortunately.)
I don't think that TS always provides the property descriptor
That's exactly what happens. It only gives a descriptor for properties
Right. Even though the spec is changing. In the old spec, I believe there should alway be a descriptor in this case. So, TS is probably fudging it a little bit. We can fix our implementation to account for it though.
:+1:
Is there a workaround for this?
Does this seem like it would appropriately handle the situation -
https://github.com/aurelia/binding/blob/master/src/decorator-observable.js#L8-L20
Basically if it isn't babel just make the descriptor
an object?
just tested applying that logic into validatejs/base-decorator and it solved the problem for me
yes
I'm not sure the best way to represent this in a unit test but I pushed out a fix. @searus can you double-check and make sure that commit looks the exact same way when you implemented it? Thanks!
Looks identical to what I have - except you have nice comments :+1:
Adding a
required
decorator on a view model property results in an exceptionI'm transpiling TS into es6 with module type
system