mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibJS: Use CallBuiltin for Math.cos()
This commit is contained in:
parent
c02535e9f9
commit
878cc16d7a
Notes:
github-actions[bot]
2025-05-26 19:53:48 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 878cc16d7a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4884
Reviewed-by: https://github.com/awesomekling ✅
4 changed files with 13 additions and 4 deletions
|
@ -23,7 +23,8 @@ namespace JS::Bytecode {
|
|||
O(MathRandom, math_random, Math, random, 0) \
|
||||
O(MathRound, math_round, Math, round, 1) \
|
||||
O(MathSqrt, math_sqrt, Math, sqrt, 1) \
|
||||
O(MathSin, math_sin, Math, sin, 1)
|
||||
O(MathSin, math_sin, Math, sin, 1) \
|
||||
O(MathCos, math_cos, Math, cos, 1)
|
||||
|
||||
enum class Builtin : u8 {
|
||||
#define DEFINE_BUILTIN_ENUM(name, ...) name,
|
||||
|
|
|
@ -2821,6 +2821,8 @@ static ThrowCompletionOr<Value> dispatch_builtin_call(Bytecode::Interpreter& int
|
|||
return TRY(MathObject::sqrt_impl(interpreter.vm(), interpreter.get(arguments[0])));
|
||||
case Builtin::MathSin:
|
||||
return TRY(MathObject::sin_impl(interpreter.vm(), interpreter.get(arguments[0])));
|
||||
case Builtin::MathCos:
|
||||
return TRY(MathObject::cos_impl(interpreter.vm(), interpreter.get(arguments[0])));
|
||||
case Bytecode::Builtin::__Count:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue