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

Unified Diff: src/runtime.cc

Issue 235943007: Handlify Object::ToObject. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebase Created 6 years, 8 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-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 4f340855e907380dc0fa7ceda43a18219fa13227..7ce8b79c3011ed3730e2290138f56952264c729e 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -655,9 +655,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateGlobalPrivateSymbol) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NewSymbolWrapper) {
+ HandleScope scope(isolate);
ASSERT(args.length() == 1);
- CONVERT_ARG_CHECKED(Symbol, symbol, 0);
- return symbol->ToObject(isolate);
+ CONVERT_ARG_HANDLE_CHECKED(Symbol, symbol, 0);
+ return *Object::ToObject(isolate, symbol).ToHandleChecked();
}
@@ -6849,10 +6850,10 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StringToArray) {
RUNTIME_FUNCTION(MaybeObject*, Runtime_NewStringWrapper) {
- SealHandleScope shs(isolate);
+ HandleScope scope(isolate);
ASSERT(args.length() == 1);
- CONVERT_ARG_CHECKED(String, value, 0);
- return value->ToObject(isolate);
+ CONVERT_ARG_HANDLE_CHECKED(String, value, 0);
+ return *Object::ToObject(isolate, value).ToHandleChecked();
}
@@ -8952,16 +8953,16 @@ RUNTIME_FUNCTION(MaybeObject*, RuntimeHidden_PushWithContext) {
if (args[0]->IsJSReceiver()) {
extension_object = args.at<JSReceiver>(0);
} else {
- // Convert the object to a proper JavaScript object.
- Handle<Object> object = isolate->factory()->ToObject(args.at<Object>(0));
- if (object.is_null()) {
+ // Try to convert the object to a proper JavaScript object.
+ MaybeHandle<JSReceiver> maybe_object =
+ Object::ToObject(isolate, args.at<Object>(0));
+ if (!maybe_object.ToHandle(&extension_object)) {
Handle<Object> handle = args.at<Object>(0);
Handle<Object> result =
isolate->factory()->NewTypeError("with_expression",
HandleVector(&handle, 1));
return isolate->Throw(*result);
}
- extension_object = Handle<JSReceiver>::cast(object);
}
Handle<JSFunction> function;
@@ -11366,7 +11367,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_GetFrameDetails) {
ASSERT(!receiver->IsNull());
Context* context = Context::cast(it.frame()->context());
Handle<Context> native_context(Context::cast(context->native_context()));
- receiver = isolate->factory()->ToObject(receiver, native_context);
+ receiver = Object::ToObject(
+ isolate, receiver, native_context).ToHandleChecked();
}
}
details->set(kFrameDetailsReceiverIndex, *receiver);
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698