mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 11:20:03 +00:00
LibJS: Forward a string aproximation of the CallExpression to Call Ops
This gives us better debug output when analysing calls to `undefined` and also fixes multiple test-js cases expecting an `(evaluated from $Expression)` in the error message. This also refactors out the generation of that string, to avoid code duplication with the AST interpreter.
This commit is contained in:
@@ -1548,7 +1548,12 @@ Bytecode::CodeGenerationErrorOr<void> CallExpression::generate_bytecode(Bytecode
|
||||
call_type = Bytecode::Op::Call::CallType::Call;
|
||||
}
|
||||
|
||||
generator.emit<Bytecode::Op::Call>(call_type, callee_reg, this_reg);
|
||||
Optional<Bytecode::StringTableIndex> expression_string_index;
|
||||
if (auto expression_string = this->expression_string(); expression_string.has_value())
|
||||
expression_string_index = generator.intern_string(expression_string.release_value());
|
||||
|
||||
generator.emit<Bytecode::Op::Call>(call_type, callee_reg, this_reg, expression_string_index);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user