diff options
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ReflectObject.cpp | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Tests/builtins/Reflect/Reflect.@@toStringTag.js | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp index 0db3db5cd1..704ca31f2e 100644 --- a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp @@ -78,6 +78,7 @@ void ReflectObject::initialize(GlobalObject& global_object) define_native_function(vm.names.preventExtensions, prevent_extensions, 1, attr); define_native_function(vm.names.set, set, 3, attr); define_native_function(vm.names.setPrototypeOf, set_prototype_of, 2, attr); + Object::define_property(vm.well_known_symbol_to_string_tag(), js_string(vm.heap(), "Reflect"), Attribute::Configurable); } ReflectObject::~ReflectObject() diff --git a/Userland/Libraries/LibJS/Tests/builtins/Reflect/Reflect.@@toStringTag.js b/Userland/Libraries/LibJS/Tests/builtins/Reflect/Reflect.@@toStringTag.js new file mode 100644 index 0000000000..8ee882f287 --- /dev/null +++ b/Userland/Libraries/LibJS/Tests/builtins/Reflect/Reflect.@@toStringTag.js @@ -0,0 +1,3 @@ +test("basic functionality", () => { + expect(Reflect[Symbol.toStringTag]).toBe("Reflect"); +}); |