Index: src/runtime/runtime-object.cc |
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc |
index e493118ae097b0670488b78b4a743a1b17d70cec..cb5b3b685a6e1168ef92770def9b6dd3fd9262c7 100644 |
--- a/src/runtime/runtime-object.cc |
+++ b/src/runtime/runtime-object.cc |
@@ -756,9 +756,12 @@ RUNTIME_FUNCTION(Runtime_HasProperty) { |
HandleScope scope(isolate); |
DCHECK(args.length() == 2); |
CONVERT_ARG_HANDLE_CHECKED(JSReceiver, receiver, 0); |
- CONVERT_ARG_HANDLE_CHECKED(Name, key, 1); |
+ CONVERT_ARG_HANDLE_CHECKED(Object, key, 1); |
- Maybe<bool> maybe = JSReceiver::HasProperty(receiver, key); |
+ Handle<Name> name; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, name, |
+ Object::ToName(isolate, key)); |
+ Maybe<bool> maybe = JSReceiver::HasProperty(receiver, name); |
if (!maybe.IsJust()) return isolate->heap()->exception(); |
return isolate->heap()->ToBoolean(maybe.FromJust()); |
} |
@@ -1481,6 +1484,17 @@ RUNTIME_FUNCTION(Runtime_ToNumber) { |
} |
+RUNTIME_FUNCTION(Runtime_ToName) { |
+ HandleScope scope(isolate); |
+ DCHECK_EQ(1, args.length()); |
+ CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); |
+ Handle<Object> result; |
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, |
+ Object::ToName(isolate, input)); |
+ return *result; |
+} |
+ |
+ |
RUNTIME_FUNCTION(Runtime_StrictEquals) { |
SealHandleScope scope(isolate); |
DCHECK_EQ(2, args.length()); |