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:
parent
86b85aa68b
commit
6c8ab1ca0d
4 changed files with 58 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue