mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: support converting OnceCallback to V8 (#17941)
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <type_traits>
|
||||
#include <vector>
|
||||
|
||||
#include "base/strings/string_piece.h"
|
||||
@@ -304,6 +305,12 @@ v8::Local<v8::Value> ConvertToV8(v8::Isolate* isolate, const T& input) {
|
||||
return Converter<T>::ToV8(isolate, input);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
v8::Local<v8::Value> ConvertToV8(v8::Isolate* isolate, T&& input) {
|
||||
return Converter<typename std::remove_reference<T>::type>::ToV8(
|
||||
isolate, std::move(input));
|
||||
}
|
||||
|
||||
inline v8::Local<v8::Value> ConvertToV8(v8::Isolate* isolate,
|
||||
const char* input) {
|
||||
return Converter<const char*>::ToV8(isolate, input);
|
||||
|
||||
Reference in New Issue
Block a user