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

Unified Diff: src/accessors.h

Issue 2397603003: [runtime] Let native setters have a return value. (Closed)
Patch Set: Ouch. Created 4 years, 2 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
« no previous file with comments | « no previous file | src/accessors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/accessors.h
diff --git a/src/accessors.h b/src/accessors.h
index a1b716d9466a0676ba9752bd013eae2b8e04fc3b..86e796337b3f65021aeb5702e1d27d9e0c245688 100644
--- a/src/accessors.h
+++ b/src/accessors.h
@@ -71,7 +71,7 @@ class Accessors : public AllStatic {
#define ACCESSOR_SETTER_DECLARATION(name) \
static void name(v8::Local<v8::Name> name, v8::Local<v8::Value> value, \
- const v8::PropertyCallbackInfo<void>& info);
+ const v8::PropertyCallbackInfo<v8::Boolean>& info);
ACCESSOR_SETTER_LIST(ACCESSOR_SETTER_DECLARATION)
#undef ACCESSOR_SETTER_DECLARATION
@@ -100,12 +100,21 @@ class Accessors : public AllStatic {
static bool IsJSObjectFieldAccessor(Handle<Map> map, Handle<Name> name,
int* object_offset);
+ // Create an AccessorInfo. The setter is optional (can be nullptr).
+ //
+ // Note that the type of setter is AccessorNameBooleanSetterCallback instead
+ // of v8::AccessorNameSetterCallback. The difference is that the former can
+ // set a (boolean) return value. The setter should roughly follow the same
+ // conventions as many of the internal methods in objects.cc:
+ // - The return value is unset iff there was an exception.
+ // - If the ShouldThrow argument is true, the return value must not be false.
+ typedef void (*AccessorNameBooleanSetterCallback)(
+ Local<v8::Name> property, Local<v8::Value> value,
+ const PropertyCallbackInfo<v8::Boolean>& info);
+
static Handle<AccessorInfo> MakeAccessor(
- Isolate* isolate,
- Handle<Name> name,
- AccessorNameGetterCallback getter,
- AccessorNameSetterCallback setter,
- PropertyAttributes attributes);
+ Isolate* isolate, Handle<Name> name, AccessorNameGetterCallback getter,
+ AccessorNameBooleanSetterCallback setter, PropertyAttributes attributes);
};
} // namespace internal
« no previous file with comments | « no previous file | src/accessors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698