In the initial Treecle port, I removed all the functionality that supports type => something object literals and instead it only supports functions for these things. I instead added code to Vastly to transform object literals into functions.
But it just dawned on me: this would be very useful in Treecle too, it's just that we can't depend on node.type returning a useful type. But we could have a config.getType() method, which by default returns the object [[ Class ]], but can be overridden (e.g. Vastly would do config.getType = n => n.type).
Any objections @adamjanicki2 ?
In the initial Treecle port, I removed all the functionality that supports type => something object literals and instead it only supports functions for these things. I instead added code to Vastly to transform object literals into functions.
But it just dawned on me: this would be very useful in Treecle too, it's just that we can't depend on
node.typereturning a useful type. But we could have aconfig.getType()method, which by default returns the object[[ Class ]], but can be overridden (e.g. Vastly would doconfig.getType = n => n.type).Any objections @adamjanicki2 ?