mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:37:34 +00:00
LibJS: Remove the default length & attributes from define_native_*
These are usually incorrect, and people sometimes forget to add the correct values as a result of them being optional, so they should just be specified explicitly.
This commit is contained in:
parent
a6b8291a9b
commit
53f70e5208
10 changed files with 48 additions and 43 deletions
|
@ -57,17 +57,18 @@ void WindowObject::initialize_global_object()
|
|||
define_native_accessor("screen", screen_getter, {}, JS::Attribute::Enumerable);
|
||||
define_native_accessor("innerWidth", inner_width_getter, {}, JS::Attribute::Enumerable);
|
||||
define_native_accessor("innerHeight", inner_height_getter, {}, JS::Attribute::Enumerable);
|
||||
define_native_function("alert", alert);
|
||||
define_native_function("confirm", confirm);
|
||||
define_native_function("prompt", prompt);
|
||||
define_native_function("setInterval", set_interval, 1);
|
||||
define_native_function("setTimeout", set_timeout, 1);
|
||||
define_native_function("clearInterval", clear_interval, 1);
|
||||
define_native_function("clearTimeout", clear_timeout, 1);
|
||||
define_native_function("requestAnimationFrame", request_animation_frame, 1);
|
||||
define_native_function("cancelAnimationFrame", cancel_animation_frame, 1);
|
||||
define_native_function("atob", atob, 1);
|
||||
define_native_function("btoa", btoa, 1);
|
||||
u8 attr = JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable;
|
||||
define_native_function("alert", alert, 0, attr);
|
||||
define_native_function("confirm", confirm, 0, attr);
|
||||
define_native_function("prompt", prompt, 0, attr);
|
||||
define_native_function("setInterval", set_interval, 1, attr);
|
||||
define_native_function("setTimeout", set_timeout, 1, attr);
|
||||
define_native_function("clearInterval", clear_interval, 1, attr);
|
||||
define_native_function("clearTimeout", clear_timeout, 1, attr);
|
||||
define_native_function("requestAnimationFrame", request_animation_frame, 1, attr);
|
||||
define_native_function("cancelAnimationFrame", cancel_animation_frame, 1, attr);
|
||||
define_native_function("atob", atob, 1, attr);
|
||||
define_native_function("btoa", btoa, 1, attr);
|
||||
|
||||
// Legacy
|
||||
define_native_accessor("event", event_getter, {}, JS::Attribute::Enumerable);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue