- Notifications
You must be signed in to change notification settings - Fork 154
Description
Hi,
I've got the following code
`string code = "function imageUrl(){if(seasonType==="summer"){return "https://i.ibb.co/P9Sz25M/summer.jpg\"} if(seasonType==="winter"){return "https://cdn.pixabay.com/photo/2018/11/22/12/48/clothing-3831823_1280.jpg\"} if(seasonType==="spring"){return "https://cdn.pixabay.com/photo/2016/11/16/03/55/blue-1828094_1280.jpg\"} }; imageUrl();";
var javascriptContext = new JavascriptContext();
javascriptContext.SetParameter("seasonType", "summer");
var expressionJSResult = javascriptContext.Run(code);
javascriptContext.Dispose();
Console.WriteLine(expressionJSResult.ToString());`
My issue is that when the same code is run it works sometimes and sometimes it throws the below exception.
at Noesis.Javascript.CompileScript(Local<v8::Script>* , Char* source_code, Char* resource_name) at Noesis.Javascript.JavascriptContext.Run(String iSourceCode) at Program.<Main>$(String[] args)
Appreciate any help on this. I'm using .Net version 4.8.