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

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

Issue 1502983002: [proxies] Make Object.{isFrozen,isSealed} behave correctly for proxies. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years 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/runtime/runtime.h ('k') | test/mjsunit/harmony/proxies-integrity.js » ('j') | 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 674cc89076586a540d417c29ce102b8f3acdf4e2..4441f47aaa2d0ad69184f4d1692bf19857ca1be4 100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -343,6 +343,17 @@ RUNTIME_FUNCTION(Runtime_ObjectFreeze) {
}
+RUNTIME_FUNCTION(Runtime_ObjectIsFrozen) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSReceiver, object, 0);
+
+ Maybe<bool> result = JSReceiver::TestIntegrityLevel(object, FROZEN);
+ MAYBE_RETURN(result, isolate->heap()->exception());
+ return isolate->heap()->ToBoolean(result.FromJust());
+}
+
+
RUNTIME_FUNCTION(Runtime_ObjectSeal) {
HandleScope scope(isolate);
DCHECK(args.length() == 1);
@@ -355,6 +366,17 @@ RUNTIME_FUNCTION(Runtime_ObjectSeal) {
}
+RUNTIME_FUNCTION(Runtime_ObjectIsSealed) {
+ HandleScope scope(isolate);
+ DCHECK(args.length() == 1);
+ CONVERT_ARG_HANDLE_CHECKED(JSReceiver, object, 0);
+
+ Maybe<bool> result = JSReceiver::TestIntegrityLevel(object, SEALED);
+ MAYBE_RETURN(result, isolate->heap()->exception());
+ return isolate->heap()->ToBoolean(result.FromJust());
+}
+
+
RUNTIME_FUNCTION(Runtime_LoadGlobalViaContext) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
« no previous file with comments | « src/runtime/runtime.h ('k') | test/mjsunit/harmony/proxies-integrity.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698