Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: src/objects.cc

Issue 2152693002: [stubs] Introduce NonPrimitiveToPrimitive builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/objects.h ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698