fix: fall back to default logs path in getPath('logs') (#19653)

This commit is contained in:
Shelley Vohr 2019-08-19 15:16:00 -07:00 committed by GitHub
parent 0851697cb7
commit 1dc02e6dbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 89 additions and 19 deletions

View file

@ -9,6 +9,7 @@
#include <vector>
#include "base/macros.h"
#include "base/optional.h"
#include "native_mate/converter.h"
namespace mate {
@ -34,6 +35,17 @@ class Arguments {
return ConvertFromV8(isolate_, info_->Data(), out);
}
template <typename T>
bool GetNext(base::Optional<T>* out) {
if (next_ >= info_->Length())
return true;
v8::Local<v8::Value> val = (*info_)[next_];
bool success = ConvertFromV8(isolate_, val, out);
if (success)
next_++;
return success;
}
template <typename T>
bool GetNext(T* out) {
if (next_ >= info_->Length()) {