mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibJS: Implement 'in' operator
This commit is contained in:
parent
396ecfa2d7
commit
11728b7db5
Notes:
sideshowbarker
2024-07-19 07:21:32 +09:00
Author: https://github.com/linusg
Commit: 11728b7db5
Pull-request: https://github.com/SerenityOS/serenity/pull/1931
Reviewed-by: https://github.com/awesomekling
6 changed files with 54 additions and 0 deletions
|
@ -331,6 +331,8 @@ Value BinaryExpression::execute(Interpreter& interpreter) const
|
|||
return right_shift(interpreter, lhs_result, rhs_result);
|
||||
case BinaryOp::UnsignedRightShift:
|
||||
return unsigned_right_shift(interpreter, lhs_result, rhs_result);
|
||||
case BinaryOp::In:
|
||||
return in(interpreter, lhs_result, rhs_result);
|
||||
case BinaryOp::InstanceOf:
|
||||
return instance_of(interpreter, lhs_result, rhs_result);
|
||||
}
|
||||
|
@ -512,6 +514,9 @@ void BinaryExpression::dump(int indent) const
|
|||
case BinaryOp::UnsignedRightShift:
|
||||
op_string = ">>>";
|
||||
break;
|
||||
case BinaryOp::In:
|
||||
op_string = "in";
|
||||
break;
|
||||
case BinaryOp::InstanceOf:
|
||||
op_string = "instanceof";
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue