Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 5aea79984777b30081c3c3bc9a705a42a896ae95..e195e6abc0246c30859f225eeb4588038bd21712 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -3912,6 +3912,19 @@ Local<String> v8::Object::GetConstructorName() { |
return Utils::ToLocal(name); |
} |
+Maybe<bool> v8::Object::SetIntegrityLevel(Local<Context> context, |
+ IntegrityLevel level) { |
+ PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::SetIntegrityLevel()", |
+ bool); |
+ auto self = Utils::OpenHandle(this); |
+ i::JSReceiver::IntegrityLevel i_level = |
+ level == IntegrityLevel::kFrozen ? i::FROZEN : i::SEALED; |
+ Maybe<bool> result = |
+ i::JSReceiver::SetIntegrityLevel(self, i_level, i::Object::DONT_THROW); |
+ has_pending_exception = result.IsNothing(); |
+ RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); |
+ return result; |
+} |
Maybe<bool> v8::Object::Delete(Local<Context> context, Local<Value> key) { |
PREPARE_FOR_EXECUTION_PRIMITIVE(context, "v8::Object::Delete()", bool); |