You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Value of the Interop.AllowGetType option can be set only for the first instance of engine, then it will be cached and all other engine instances will use it. To reproduce this error, I created a example:
using System;using Jint;using Jint.Native;namespaceTestJint{classProgram{staticvoidMain(string[]args){// Displays the full type name
TestAllowGetTypeOption(true);// Should throw an exception, but displays the full type name
TestAllowGetTypeOption(false);}privatestaticvoidTestAllowGetTypeOption(boolallowGetType){varuri=new Uri("https://github.com/sebastienros/jint");stringitemName= nameof(uri);stringinput=itemName+".GetType();";
Console.WriteLine("AllowGetType = {0}", allowGetType);using(varengine=new Engine(options => options.Interop.AllowGetType =allowGetType)){
engine.SetValue(itemName, JsValue.FromObject(engine, uri));stringresult= engine.Evaluate(input).ToString();
Console.WriteLine("Result = {0}", result);}
Console.WriteLine();}}}
Hello!
Value of the
Interop.AllowGetType
option can be set only for the first instance of engine, then it will be cached and all other engine instances will use it. To reproduce this error, I created a example:Most likely, this error is caused by the default value of the
Interop.TypeResolver
option.The text was updated successfully, but these errors were encountered: