1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47: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:
Idan Horowitz 2021-07-06 01:12:54 +03:00 committed by Linus Groh
parent a6b8291a9b
commit 53f70e5208
10 changed files with 48 additions and 43 deletions

View file

@ -12,7 +12,7 @@ namespace Web::Bindings {
void WebAssemblyInstancePrototype::initialize(JS::GlobalObject& global_object)
{
Object::initialize(global_object);
define_native_accessor("exports", exports_getter, {});
define_native_accessor("exports", exports_getter, {}, JS::Attribute::Enumerable | JS::Attribute::Configurable);
}
JS_DEFINE_NATIVE_FUNCTION(WebAssemblyInstancePrototype::exports_getter)

View file

@ -13,8 +13,8 @@ namespace Web::Bindings {
void WebAssemblyMemoryPrototype::initialize(JS::GlobalObject& global_object)
{
Object::initialize(global_object);
define_native_accessor("buffer", buffer_getter, {});
define_native_function("grow", grow);
define_native_accessor("buffer", buffer_getter, {}, JS::Attribute::Enumerable | JS::Attribute::Configurable);
define_native_function("grow", grow, 1, JS::Attribute::Writable | JS::Attribute::Enumerable | JS::Attribute::Configurable);
}
JS_DEFINE_NATIVE_FUNCTION(WebAssemblyMemoryPrototype::grow)