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
The short parameter is incorrectly converted when there are optional parameters.
To Reproduce
using Jint;
var test = new Test();
Engine je = new Engine();
je.SetValue("test", test);
je.Execute(@"
test.Method1(1);
");
// print "2"
Console.ReadLine();
public class Test
{
public void Method1(short s, bool b = true)
{
Console.WriteLine("1");
}
// or string b
public void Method1(bool b)
{
Console.WriteLine("2");
}
}
Expected behavior
print "1"
Additional context
if short => int (int s, bool b = true)
public void Method1(int s, bool b = true)
{
Console.WriteLine("1");
}
will print "1"
The text was updated successfully, but these errors were encountered:
Version used
4.1.0
Describe the bug
The short parameter is incorrectly converted when there are optional parameters.
To Reproduce
Expected behavior
print "1"
Additional context
if short => int
(int s, bool b = true)
will print "1"
The text was updated successfully, but these errors were encountered: