<CodeAnalysisRuleSet>NativeMinimumRules.ruleset</CodeAnalysisRuleSet>\r
<RunCodeAnalysis>false</RunCodeAnalysis>\r
</PropertyGroup>\r
+ <ItemDefinitionGroup>\r
+ <ClCompile>\r
+ <DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+ </ClCompile>\r
+ </ItemDefinitionGroup>\r
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<ClCompile>\r
<Optimization>Disabled</Optimization>\r
// Compile the source code.
#if defined(V8_MAJOR_VERSION) && V8_MAJOR_VERSION >=5
v8::ScriptCompiler::CompileOptions options = v8::ScriptCompiler::kNoCompileOptions;
- Handle<v8::Script> v8_script = v8::ScriptCompiler::Compile(context, &source, options).ToLocalChecked();
+ Handle<v8::Script> v8_script;
+ v8::MaybeLocal<v8::Script> v8_script_check = v8::ScriptCompiler::Compile(context, &source, options);
+
+ if (!v8_script_check.IsEmpty()) {
+ v8_script = v8_script_check.ToLocalChecked();
+ }
//Handle<v8::Script> v8_script = v8::ScriptCompiler::Compile(context, source,/* String::NewFromUtf8(isolate, script_file),*/ v8::ScriptCompiler::kProduceCodeCache).ToLocalChecked();
//source->GetCachedData();
#else
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);
}
}
v8::Local<v8::Context> context = isolate->GetCurrentContext();
v8::Local<v8::String> key = String::NewFromUtf8(isolate, "constructor_method");
v8::Local<v8::Private> privateKey = v8::Private::ForApi(isolate, key);
- Handle<External> ex = Handle<External>::Cast(args.Callee()->GetPrivate(context, privateKey).ToLocalChecked());
+ Handle<External> ex;
+ v8::MaybeLocal<v8::Value> hiddenValue = args.Callee()->GetPrivate(context, privateKey);
+ if (!hiddenValue.IsEmpty()) {
+ ex = Handle<External>::Cast(hiddenValue.ToLocalChecked());
+ }
#else
Handle<External> ex = Handle<External>::Cast(args.Callee()->GetHiddenValue(String::NewFromUtf8(args.GetIsolate(), "constructor_method")));
#endif