fix: update deprecated v8 api usage

This commit is contained in:
deepak1556 2019-01-21 21:57:11 +05:30
parent f09cb56f19
commit 92cfc4a62d
10 changed files with 117 additions and 94 deletions

View file

@ -30,7 +30,10 @@ v8::Maybe<bool> Promise::RejectWithErrorMessage(const std::string& string) {
v8::Local<v8::Context>::New(isolate(), GetContext()));
v8::Local<v8::String> error_message =
v8::String::NewFromUtf8(isolate(), string.c_str());
v8::String::NewFromUtf8(isolate(), string.c_str(),
v8::NewStringType::kNormal,
static_cast<int>(string.size()))
.ToLocalChecked();
v8::Local<v8::Value> error = v8::Exception::Error(error_message);
return Reject(error);
}