chore: remove native_mate (Part 10) (#20696)

* refactor: remove direct uses of event_emitter_deprecated.h

* refactor: remove event_emitter_deprecated.h in api::App

* refactor: use std::move to save a copy

* fix: windows and linux builds
This commit is contained in:
Cheng Zhao 2019-10-24 14:47:58 +09:00 committed by GitHub
parent 77414813b4
commit be955a9721
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 223 additions and 199 deletions

View file

@ -24,10 +24,18 @@ v8::Local<v8::Value> ConvertToV8(v8::Isolate* isolate, T&& input) {
template <>
struct Converter<unsigned long> { // NOLINT(runtime/int)
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
unsigned long val); // NOLINT(runtime/int)
unsigned long val) { // NOLINT(runtime/int)
return v8::Integer::New(isolate, val);
}
static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val,
unsigned long* out); // NOLINT(runtime/int)
unsigned long* out) { // NOLINT(runtime/int)
auto maybe = val->IntegerValue(isolate->GetCurrentContext());
if (maybe.IsNothing())
return false;
*out = maybe.FromJust();
return true;
}
};
#endif