LibJS: Use VM::names for Object::invoke() function names

This commit is contained in:
Linus Groh 2021-02-01 09:54:29 +01:00 committed by Andreas Kling
parent 52fff644d5
commit c41d340983
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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)