diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index f8ab09a7a7..9ec75f5841 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -1482,7 +1482,7 @@ ThrowCompletionOr MemberExpression::to_reference(Interpreter& interpr TRY(require_object_coercible(vm, base_value)); - property_key = TRY(PropertyKey::from_value(vm, value)); + property_key = TRY(value.to_property_key(vm)); } else if (is(*m_property)) { auto& private_identifier = static_cast(*m_property); return make_private_reference(interpreter.vm(), base_value, private_identifier.string()); diff --git a/Userland/Libraries/LibJS/Tests/operators/delete-basic.js b/Userland/Libraries/LibJS/Tests/operators/delete-basic.js index f46fae6cb5..bbb1b58058 100644 --- a/Userland/Libraries/LibJS/Tests/operators/delete-basic.js +++ b/Userland/Libraries/LibJS/Tests/operators/delete-basic.js @@ -166,8 +166,7 @@ test("deleting an object computed property coerces the object to a property key" expect(called).toBeTrue(); }); -// FIXME: This currently does not work as it trys to coerce the returned Symbol to a String. I'm not sure why this is. -test.skip("deleting a symbol returned by @@toPrimitive", () => { +test("deleting a symbol returned by @@toPrimitive", () => { let called = false; const obj = { [Symbol.toStringTag]: "hello world" };