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

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

Issue 1441043002: [proxies] Implement [[PreventExtensions]] and [[IsExtensible]]. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Various changes. Created 5 years, 1 month 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
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index 707b05e57b756ccffc0b9ba422b0f2c0b1fde14a..4351a93bec963e09005d46bd62071f314814f938 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -272,8 +272,8 @@ RUNTIME_FUNCTION(Runtime_PreventExtensions) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0);
- if (JSReceiver::PreventExtensions(obj, Object::THROW_ON_ERROR).IsNothing())
- return isolate->heap()->exception();
+ MAYBE_RETURN(JSReceiver::PreventExtensions(obj, Object::THROW_ON_ERROR),
+ isolate->heap()->exception());
return *obj;
}
@@ -281,8 +281,10 @@ RUNTIME_FUNCTION(Runtime_PreventExtensions) {
RUNTIME_FUNCTION(Runtime_IsExtensible) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
- CONVERT_ARG_HANDLE_CHECKED(JSObject, obj, 0);
- return isolate->heap()->ToBoolean(JSObject::IsExtensible(obj));
+ CONVERT_ARG_HANDLE_CHECKED(JSReceiver, obj, 0);
+ Maybe<bool> result = JSReceiver::IsExtensible(obj);
+ MAYBE_RETURN(result, isolate->heap()->exception());
+ return isolate->heap()->ToBoolean(result.FromJust());
}

Powered by Google App Engine
This is Rietveld 408576698