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

Unified Diff: src/runtime/runtime-object.cc

Issue 1589323002: [runtime] Unify the ToObject handling. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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
« src/builtins.cc ('K') | « src/runtime/runtime-debug.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 75ddb7bc22b66e7d2efc11ded838b6e9e81d1ac2..ea21d1ddd2c78393d6267a695201986e7fad721b 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -274,7 +274,7 @@ RUNTIME_FUNCTION(Runtime_GetOwnProperty) {
CONVERT_ARG_HANDLE_CHECKED(Object, raw_name, 1);
// 1. Let obj be ? ToObject(O).
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, object,
- Execution::ToObject(isolate, object));
+ Object::ToObject(isolate, object));
// 2. Let key be ? ToPropertyKey(P).
Handle<Name> key;
ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, key,
@@ -563,10 +563,8 @@ namespace {
Object* DeleteProperty(Isolate* isolate, Handle<Object> object,
Handle<Object> key, LanguageMode language_mode) {
Handle<JSReceiver> receiver;
- if (!JSReceiver::ToObject(isolate, object).ToHandle(&receiver)) {
- THROW_NEW_ERROR_RETURN_FAILURE(
- isolate, NewTypeError(MessageTemplate::kUndefinedOrNullToObject));
- }
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver,
+ Object::ToObject(isolate, object));
Maybe<bool> result =
Runtime::DeleteObjectProperty(isolate, receiver, key, language_mode);
MAYBE_RETURN(result, isolate->heap()->exception());
@@ -1063,11 +1061,9 @@ RUNTIME_FUNCTION(Runtime_ToObject) {
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, object, 0);
Handle<JSReceiver> receiver;
- if (JSReceiver::ToObject(isolate, object).ToHandle(&receiver)) {
- return *receiver;
- }
- THROW_NEW_ERROR_RETURN_FAILURE(
- isolate, NewTypeError(MessageTemplate::kUndefinedOrNullToObject));
+ ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, receiver,
+ Object::ToObject(isolate, object));
+ return *receiver;
}
« src/builtins.cc ('K') | « src/runtime/runtime-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698