Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index b64ae2c1e7b30d506db1a691eb13d56a2553d6a1..0723586a27e3b10072743bedf23a3e089f11fbce 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -8048,18 +8048,8 @@ MaybeHandle<Object> JSReceiver::ToPrimitive(Handle<JSReceiver> receiver, |
isolate, exotic_to_prim, |
GetMethod(receiver, isolate->factory()->to_primitive_symbol()), Object); |
if (!exotic_to_prim->IsUndefined(isolate)) { |
- Handle<Object> hint_string; |
- switch (hint) { |
- case ToPrimitiveHint::kDefault: |
- hint_string = isolate->factory()->default_string(); |
- break; |
- case ToPrimitiveHint::kNumber: |
- hint_string = isolate->factory()->number_string(); |
- break; |
- case ToPrimitiveHint::kString: |
- hint_string = isolate->factory()->string_string(); |
- break; |
- } |
+ Handle<Object> hint_string = |
+ isolate->factory()->ToPrimitiveHintString(hint); |
Handle<Object> result; |
ASSIGN_RETURN_ON_EXCEPTION( |
isolate, result, |