1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 02:37:42 +00:00

LibJS/JIT: Add a builtin for Math.abs

This commit is contained in:
Simon Wanner 2023-11-17 11:56:40 +01:00 committed by Andreas Kling
parent 86b85aa68b
commit 6c8ab1ca0d
4 changed files with 58 additions and 3 deletions

View file

@ -27,7 +27,7 @@ void MathObject::initialize(Realm& realm)
auto& vm = this->vm();
Base::initialize(realm);
u8 attr = Attribute::Writable | Attribute::Configurable;
define_native_function(realm, vm.names.abs, abs, 1, attr);
define_native_function(realm, vm.names.abs, abs, 1, attr, Bytecode::Builtin::MathAbs);
define_native_function(realm, vm.names.random, random, 0, attr);
define_native_function(realm, vm.names.sqrt, sqrt, 1, attr);
define_native_function(realm, vm.names.floor, floor, 1, attr);