diff --git a/src/mod/languages/mod_v8/mod_v8.2015.vcxproj b/src/mod/languages/mod_v8/mod_v8.2015.vcxproj index 8eeab47b18..dfdf26e0ec 100644 --- a/src/mod/languages/mod_v8/mod_v8.2015.vcxproj +++ b/src/mod/languages/mod_v8/mod_v8.2015.vcxproj @@ -86,6 +86,11 @@ NativeMinimumRules.ruleset false + + + 4100;%(DisableSpecificWarnings) + + Disabled diff --git a/src/mod/languages/mod_v8/mod_v8.cpp b/src/mod/languages/mod_v8/mod_v8.cpp index bd3882d0d8..1a73db85bf 100644 --- a/src/mod/languages/mod_v8/mod_v8.cpp +++ b/src/mod/languages/mod_v8/mod_v8.cpp @@ -665,7 +665,12 @@ static int v8_parse_and_execute(switch_core_session_t *session, const char *inpu // Compile the source code. #if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5 v8::ScriptCompiler::CompileOptions options = v8::ScriptCompiler::kNoCompileOptions; - Handle v8_script = v8::ScriptCompiler::Compile(context, &source, options).ToLocalChecked(); + Handle v8_script; + v8::MaybeLocal v8_script_check = v8::ScriptCompiler::Compile(context, &source, options); + + if (!v8_script_check.IsEmpty()) { + v8_script = v8_script_check.ToLocalChecked(); + } //Handle v8_script = v8::ScriptCompiler::Compile(context, source,/* String::NewFromUtf8(isolate, script_file),*/ v8::ScriptCompiler::kProduceCodeCache).ToLocalChecked(); //source->GetCachedData(); #else diff --git a/src/mod/languages/mod_v8/src/fsdbh.cpp b/src/mod/languages/mod_v8/src/fsdbh.cpp index 605df59b89..59bd3b8128 100644 --- a/src/mod/languages/mod_v8/src/fsdbh.cpp +++ b/src/mod/languages/mod_v8/src/fsdbh.cpp @@ -253,7 +253,7 @@ JS_DBH_FUNCTION_IMPL(query) if (err) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error %s\n", err); - switch_core_db_free(err); + switch_safe_free(err); info.GetReturnValue().Set(false); } } diff --git a/src/mod/languages/mod_v8/src/jsbase.cpp b/src/mod/languages/mod_v8/src/jsbase.cpp index 12d65b8996..4fd320f439 100644 --- a/src/mod/languages/mod_v8/src/jsbase.cpp +++ b/src/mod/languages/mod_v8/src/jsbase.cpp @@ -158,7 +158,11 @@ void JSBase::CreateInstance(const v8::FunctionCallbackInfo& args) v8::Local context = isolate->GetCurrentContext(); v8::Local key = String::NewFromUtf8(isolate, "constructor_method"); v8::Local privateKey = v8::Private::ForApi(isolate, key); - Handle ex = Handle::Cast(args.Callee()->GetPrivate(context, privateKey).ToLocalChecked()); + Handle ex; + v8::MaybeLocal hiddenValue = args.Callee()->GetPrivate(context, privateKey); + if (!hiddenValue.IsEmpty()) { + ex = Handle::Cast(hiddenValue.ToLocalChecked()); + } #else Handle ex = Handle::Cast(args.Callee()->GetHiddenValue(String::NewFromUtf8(args.GetIsolate(), "constructor_method"))); #endif