Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function MemberExpression(node, parent) {
if (node.computed) {
return t.indexExpression(this.transform(node.object), this.transform(node.property));
}
// Always pass context in calls, since most of Lua apis expect it
const indexer =
bt.isCallExpression(parent) && parent.callee === node && !node[NO_CONTEXT] ? ':' : '.';
return t.memberExpression(this.transform(node.object), indexer, this.transform(node.property));
}
export function SequenceExpression(node) {
return t.indexExpression(
t.tableConstructorExpression(this.transformList(node.expressions).map(n => t.tableValue(n))),
t.numericLiteral(node.expressions.length),
);
}