-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
When I run this code:
using NiL.JS.Core;
using NiL.JS.Core.Interop;
var script = @"
console.log('str: ', container.test('str'));
console.log('1: ', container.test(1));
console.log('1.1: ', container.test(1.1));
console.log('[1, 2]: ', container.test([1, 2]));
";
var context = new Context();
context.DefineConstant("container", new FunctionContainer());
context.Eval(script);
class FunctionContainer : CustomType
{
public string test(string s)
{
return $"it is string {s}";
}
public string test(long l)
{
return $"it is long {l}";
}
public string test(double d)
{
return $"it is double {d}";
}
public string test(long[] array)
{
return $"it is long[] {String.Join(", ", array)}";
}
}I got wrong result for array:
str: it is string str
1: it is long 1
1.1: it is double 1,1
[1, 2]: it is long 0
Is it bug?
Markeli
Metadata
Metadata
Assignees
Labels
No labels