fix(compiler): fix two existing expression transformer issues (#28523)
Testing of Ivy revealed two bugs in the AstMemoryEfficientTransformer class, a part of existing View Engine compiler infrastructure that's reused in Ivy. These bugs cause AST expressions not to be transformed under certain circumstances. The fix is simple, and tests are added to ensure the specific expression forms that trigger the issue compile properly under Ivy. PR Close #28523
This commit is contained in:

committed by
Misko Hevery

parent
dba2a406fd
commit
09af7ea4f5
@ -477,8 +477,9 @@ export class AstMemoryEfficientTransformer implements AstVisitor {
|
||||
|
||||
visitMethodCall(ast: MethodCall, context: any): AST {
|
||||
const receiver = ast.receiver.visit(this);
|
||||
if (receiver !== ast.receiver) {
|
||||
return new MethodCall(ast.span, receiver, ast.name, this.visitAll(ast.args));
|
||||
const args = this.visitAll(ast.args);
|
||||
if (receiver !== ast.receiver || args !== ast.args) {
|
||||
return new MethodCall(ast.span, receiver, ast.name, args);
|
||||
}
|
||||
return ast;
|
||||
}
|
||||
|
Reference in New Issue
Block a user