Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 02d8d3481f636d0b90702251b59684cde3eb8861..af37cb114d615f7a4a6eb0cd51bce840a9527aa7 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -94,6 +94,16 @@ MaybeHandle<JSReceiver> Object::ToObject(Isolate* isolate, |
// static |
+MaybeHandle<Name> Object::ToName(Isolate* isolate, Handle<Object> input) { |
+ ASSIGN_RETURN_ON_EXCEPTION( |
+ isolate, input, Object::ToPrimitive(input, ToPrimitiveHint::kString), |
+ Name); |
+ if (input->IsName()) return Handle<Name>::cast(input); |
+ return ToString(isolate, input); |
+} |
+ |
+ |
+// static |
MaybeHandle<Object> Object::ToNumber(Handle<Object> input) { |
while (true) { |
if (input->IsNumber()) { |