refactor: ginify Tray (#22822)
* refactor: ginify Tray * lint * improve argument parsing logic * remove redundant imports from tray.js * new Tray produces an instanceof Tray * make Constructible generic * lint * clean up on exit
This commit is contained in:
parent
76ae3b7ecb
commit
a3e28788ce
16 changed files with 380 additions and 88 deletions
|
@ -25,7 +25,6 @@ v8::Local<v8::Object> CreateEvent(
|
|||
v8::Isolate* isolate,
|
||||
v8::Local<v8::Object> sender = v8::Local<v8::Object>(),
|
||||
v8::Local<v8::Object> custom_event = v8::Local<v8::Object>());
|
||||
v8::Local<v8::Object> CreateEventFromFlags(v8::Isolate* isolate, int flags);
|
||||
v8::Local<v8::Object> CreateNativeEvent(
|
||||
v8::Isolate* isolate,
|
||||
v8::Local<v8::Object> sender,
|
||||
|
@ -59,16 +58,6 @@ class EventEmitter : public gin_helper::Wrappable<T> {
|
|||
std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
// this.emit(name, new Event(flags), args...);
|
||||
template <typename... Args>
|
||||
bool EmitWithFlags(base::StringPiece name, int flags, Args&&... args) {
|
||||
v8::Locker locker(isolate());
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
return EmitCustomEvent(name,
|
||||
internal::CreateEventFromFlags(isolate(), flags),
|
||||
std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
// this.emit(name, new Event(), args...);
|
||||
template <typename... Args>
|
||||
bool Emit(base::StringPiece name, Args&&... args) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue