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

Unified Diff: src/api.cc

Issue 2807333003: [api] Add DefineProperty() method that skips interceptors.
Patch Set: Created 3 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
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index b6f7bb77243bed6519cf86300ef3b325e545047e..6513317e9c84824310622f4e4e39b447d38b6c61 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -4288,6 +4288,22 @@ Maybe<bool> v8::Object::DefineProperty(v8::Local<v8::Context> context,
return success;
}
+Maybe<bool> v8::Object::DefinePropertyWithoutInterceptors(
+ v8::Local<v8::Context> context, v8::Local<Name> key,
+ PropertyDescriptor& descriptor) {
+ PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object,
+ DefinePropertyWithoutInterceptors, bool);
+ i::Handle<i::JSReceiver> self = Utils::OpenHandle(this);
+ i::Handle<i::Name> key_obj = Utils::OpenHandle(*key);
+
+ Maybe<bool> success = i::JSReceiver::DefineOwnPropertyWithoutIntercept(
+ isolate, self, key_obj, &descriptor.get_private()->desc,
+ i::Object::DONT_THROW);
+
+ RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
+ return success;
+}
+
MUST_USE_RESULT
static i::MaybeHandle<i::Object> DefineObjectProperty(
i::Handle<i::JSObject> js_object, i::Handle<i::Object> key,

Powered by Google App Engine
This is Rietveld 408576698