```
public class TestItem
{
public string Str { get; set; }
}
class Program
{
static void Main(string[] args)
{
using (var runtime = new V8Runtime())
using (var engine = runtime.CreateScriptEngine())
{
engine.AddHostObject("test", new TestItem());
string scriptCode = "test";
V8Script compiledScript = runtime.Compile(scriptCode);
object result = engine.Evaluate(scriptCode); //TestItem type
object resultFromCompiled = engine.Evaluate(compiledScript); // HostObject type
if (!result.Equals(resultFromCompiled)) // Different type of objects.
throw new ApplicationException();
}
Console.ReadLine();
}
}
```
Comments: Thanks!
public class TestItem
{
public string Str { get; set; }
}
class Program
{
static void Main(string[] args)
{
using (var runtime = new V8Runtime())
using (var engine = runtime.CreateScriptEngine())
{
engine.AddHostObject("test", new TestItem());
string scriptCode = "test";
V8Script compiledScript = runtime.Compile(scriptCode);
object result = engine.Evaluate(scriptCode); //TestItem type
object resultFromCompiled = engine.Evaluate(compiledScript); // HostObject type
if (!result.Equals(resultFromCompiled)) // Different type of objects.
throw new ApplicationException();
}
Console.ReadLine();
}
}
```
Comments: Thanks!