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: Previous commit with rebasing Created 3 years, 7 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 9eef8056270f8dcf3e77f7b8e9b7cc6aae7dfb21..38d8f0937247a4a51aec5e2496739b69233c2352 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -4396,7 +4396,8 @@ bool v8::PropertyDescriptor::has_configurable() const {
Maybe<bool> v8::Object::DefineOwnProperty(v8::Local<v8::Context> context,
v8::Local<Name> key,
v8::Local<Value> value,
- v8::PropertyAttribute attributes) {
+ v8::PropertyAttribute attributes,
+ CallInterceptors call_interceptors) {
PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object, DefineOwnProperty, bool);
i::Handle<i::JSReceiver> self = Utils::OpenHandle(this);
i::Handle<i::Name> key_obj = Utils::OpenHandle(*key);
@@ -4408,7 +4409,7 @@ Maybe<bool> v8::Object::DefineOwnProperty(v8::Local<v8::Context> context,
desc.set_configurable(!(attributes & v8::DontDelete));
desc.set_value(value_obj);
Maybe<bool> success = i::JSReceiver::DefineOwnProperty(
- isolate, self, key_obj, &desc, i::Object::DONT_THROW);
+ isolate, self, key_obj, &desc, i::Object::DONT_THROW, call_interceptors);
// Even though we said DONT_THROW, there might be accessors that do throw.
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
return success;
@@ -4416,14 +4417,15 @@ Maybe<bool> v8::Object::DefineOwnProperty(v8::Local<v8::Context> context,
Maybe<bool> v8::Object::DefineProperty(v8::Local<v8::Context> context,
v8::Local<Name> key,
- PropertyDescriptor& descriptor) {
+ PropertyDescriptor& descriptor,
+ CallInterceptors call_interceptors) {
PREPARE_FOR_EXECUTION_PRIMITIVE(context, Object, DefineProperty, bool);
i::Handle<i::JSReceiver> self = Utils::OpenHandle(this);
i::Handle<i::Name> key_obj = Utils::OpenHandle(*key);
Maybe<bool> success = i::JSReceiver::DefineOwnProperty(
isolate, self, key_obj, &descriptor.get_private()->desc,
- i::Object::DONT_THROW);
+ i::Object::DONT_THROW, call_interceptors);
RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool);
return success;
}
« include/v8.h ('K') | « include/v8.h ('k') | src/builtins/builtins-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698