From c41d340983b803c1c12a58ac7884b243906bda36 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 1 Feb 2021 09:54:29 +0100 Subject: [PATCH] LibJS: Use VM::names for Object::invoke() function names --- Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp | 2 +- Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp index 8b155e9a95..aa6e39a6e8 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp @@ -309,7 +309,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::to_locale_string) auto* value_object = value.to_object(global_object); if (!value_object) return {}; - auto locale_string_result = value_object->invoke("toLocaleString"); + auto locale_string_result = value_object->invoke(vm.names.toLocaleString); if (vm.exception()) return {}; auto string = locale_string_result.to_string(global_object); diff --git a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp index cfc31c6b91..71f498e126 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectPrototype.cpp @@ -119,7 +119,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectPrototype::to_locale_string) auto* this_object = vm.this_value(global_object).to_object(global_object); if (!this_object) return {}; - return this_object->invoke("toString"); + return this_object->invoke(vm.names.toString); } JS_DEFINE_NATIVE_FUNCTION(ObjectPrototype::value_of)