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
constelement=newElementType();console.log(element.toCompactRefract());// => ['element', {}, {}, null]// Access the non-existing name propertyelement.name;// What? Now there is a meta name for some reason!?console.log(element.toCompactRefract());// => ['element', {name: ''}, {}, null]// Try to get something from meta with a default if not foundelement.getProperty('foo','bar');// What? Now my default value is getting serialized!console.log(element.toCompactRefract());// => ['element', {name: '', foo: 'bar'}, {}, null]
I'm sorry I glossed over this in the initial review! I believe the code is written this way to cache the conversion to refract element classes for the default value, but I think we need to either do that conversion each time or keep a separate cache that doesn't mutate the original meta values..
@danielgtaylor Great find here. I think you're right. I'll be thinking on this as I do not think what I currently wrote is helpful to the user. I also think I should have made getProperty a private method.
I'll be thinking on this. I'm working on a proposal for Minim that I'll be running by you soon.
This leads to non-obvious behavior which I think we need to properly define or change. Here is the implementation as it stands:
pimitives.es6#34-40
Here is the surprising part:
I'm sorry I glossed over this in the initial review! I believe the code is written this way to cache the conversion to refract element classes for the default value, but I think we need to either do that conversion each time or keep a separate cache that doesn't mutate the original meta values..
Thoughts @smizell?
The text was updated successfully, but these errors were encountered: