From 3ed5a0c68d8dc4ffa12eea89b2f560bea1b10997 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 13 Jun 2021 20:12:19 +0100 Subject: [PATCH] LibJS: Make a couple of RegExp.prototype properties accessors --- Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index 363394bcd0..9cb84e2164 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -32,12 +32,11 @@ void RegExpPrototype::initialize(GlobalObject& global_object) define_native_function(vm.well_known_symbol_match(), symbol_match, 1, attr); define_native_function(vm.well_known_symbol_replace(), symbol_replace, 2, attr); - u8 readable_attr = Attribute::Configurable; - define_native_property(vm.names.flags, flags, {}, readable_attr); - define_native_property(vm.names.source, source, {}, readable_attr); + define_native_accessor(vm.names.flags, flags, {}, Attribute::Configurable); + define_native_accessor(vm.names.source, source, {}, Attribute::Configurable); #define __JS_ENUMERATE(flagName, flag_name, flag_char, ECMAScriptFlagName) \ - define_native_property(vm.names.flagName, flag_name, {}, readable_attr); + define_native_accessor(vm.names.flagName, flag_name, {}, Attribute::Configurable); JS_ENUMERATE_REGEXP_FLAGS #undef __JS_ENUMERATE }