escodegen
escodegen copied to clipboard
Unknown node type "ExperimentalSpreadProperty"
Hello, thank you for the awesome project. I received an "Unknown node type ExperimentalSpreadProperty" error as I was traversing the ast tree with estraverse. So I decided to add ExperimentalSpreadProperty: ['argument']
around here. But life is never this easy, escodegen immediately proceeded to throw a TypeError: this[type] is not a function
error here -- complaining (rightfully so) that this type "ExperimentalSpreadProperty" does not exist.
Are there plans to support the ExperimentalSpreadProperty
soon? If not, what is the minimal I need to know to do this right? Perhaps starting with a brief explanation of what the precedence
and flags
arguments dictate, if they are relevant in this case. Without spending too much time, the code below is currently getting me from point A to point B:
CodeGenerator.prototype.ExperimentalSpreadProperty = function (expr, precedence, flags) {
return [
'...',
this.generateExpression(expr.argument, precedence, flags)
].join('')
}