You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think where we came to in #182 and which was implemented in #199 would make finish and replace on ClassDescriptor obsolete. But I could be mistaken
I think we need to either:
Remove them from ClassDescriptor, or
Modify ToClassDescriptor to have it look for finish and replace properties and, if either exists, add appropriate type="hook" element(s) to a shallow copy of elementsObject just prior to calling ToElementDescriptors.
(1) is the simple solution; if you want hooks, add them to the elements array. (2) is more concise to use.
FWIW: The direction I lean varies by the minute. On the one hand, KISS. On the other hand, it's pretty simple to say "putting a finish/replace function on the class descriptor effectively adds a type="hook" element with a finish/replace function to elements".
Happy to add it to my PR queue once a decision is made.
The text was updated successfully, but these errors were encountered:
Let's read the properties and throw if they are present, and remove them from ClassDescriptor as you say. Option 2 is a bit redundant, as you explained.
tjcrowder
added a commit
to tjcrowder/proposal-decorators
that referenced
this issue
Jan 20, 2019
ClassDescriptor has
finish
andreplace
properties, but ToClassDescriptor doesn't do anything with those properties.I think where we came to in #182 and which was implemented in #199 would make
finish
andreplace
on ClassDescriptor obsolete. But I could be mistakenI think we need to either:
finish
andreplace
properties and, if either exists, add appropriatetype="hook"
element(s) to a shallow copy of elementsObject just prior to calling ToElementDescriptors.(1) is the simple solution; if you want hooks, add them to the
elements
array. (2) is more concise to use.FWIW: The direction I lean varies by the minute. On the one hand, KISS. On the other hand, it's pretty simple to say "putting a
finish
/replace
function on the class descriptor effectively adds atype="hook"
element with afinish
/replace
function toelements
".Happy to add it to my PR queue once a decision is made.
The text was updated successfully, but these errors were encountered: