Skip to content

Commit

Permalink
event, feat: support any type of custom field in EventInfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
xicilion committed Dec 2, 2017
1 parent f2b6e1f commit 205cef3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion fibjs/include/EventInfo.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class EventInfo : public EventInfo_base {
return 0; return 0;
} }


virtual result_t _named_getter(exlib::string property, int32_t& retVal) virtual result_t _named_getter(exlib::string property, v8::Local<v8::Value>& retVal)
{ {
std::map<exlib::string, VariantEx>::iterator it = m_datas.find(property); std::map<exlib::string, VariantEx>::iterator it = m_datas.find(property);


Expand Down
4 changes: 2 additions & 2 deletions fibjs/include/ifs/EventInfo.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class EventInfo_base : public object_base {
virtual result_t get_reason(exlib::string& retVal) = 0; virtual result_t get_reason(exlib::string& retVal) = 0;
virtual result_t get_type(exlib::string& retVal) = 0; virtual result_t get_type(exlib::string& retVal) = 0;
virtual result_t get_target(v8::Local<v8::Object>& retVal) = 0; virtual result_t get_target(v8::Local<v8::Object>& retVal) = 0;
virtual result_t _named_getter(exlib::string property, int32_t& retVal) = 0; virtual result_t _named_getter(exlib::string property, v8::Local<v8::Value>& retVal) = 0;
virtual result_t _named_enumerator(v8::Local<v8::Array>& retVal) = 0; virtual result_t _named_enumerator(v8::Local<v8::Array>& retVal) = 0;


public: public:
Expand Down Expand Up @@ -127,7 +127,7 @@ inline void EventInfo_base::s_get_target(v8::Local<v8::String> property, const v


inline void EventInfo_base::i_NamedGetter(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args) inline void EventInfo_base::i_NamedGetter(v8::Local<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& args)
{ {
int32_t vr; v8::Local<v8::Value> vr;


METHOD_NAME("EventInfo.undefined[]"); METHOD_NAME("EventInfo.undefined[]");
METHOD_INSTANCE(EventInfo_base); METHOD_INSTANCE(EventInfo_base);
Expand Down
2 changes: 1 addition & 1 deletion idl/zh-cn/EventInfo.idl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ interface EventInfo : object
readonly Object target; readonly Object target;


/*! @brief 根据事件类型返回的详细信息 */ /*! @brief 根据事件类型返回的详细信息 */
readonly Integer operator[String]; readonly Value operator[String];
}; };

0 comments on commit 205cef3

Please sign in to comment.