thingtalk
thingtalk copied to clipboard
optimize.ts contains a lot of wrapper functions
it's unclear currently why some objects have .optimize()
method while some do not. Examples of some that do include: Ast.Input
and Ast.BooleanExpression
, while those that don't include Ast.Expression
and Ast.Statement
. However, it seems if an object does not have such a method, you can find a function in optimize.ts
that provides the functionality. This inconsistency can be confusing to developers.
If it makes sense to add an .optimize()
method for all nodes, I believe we should go ahead and do it.