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
usingNiL.JS.Core;usingNiL.JS.Core.Interop;varscript=@"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]));";varcontext=newContext();context.DefineConstant("container",newFunctionContainer());context.Eval(script);classFunctionContainer:CustomType{publicstringtest(strings){return$"it is string {s}";}publicstringtest(longl){return$"it is long {l}";}publicstringtest(doubled){return$"it is double {d}";}publicstringtest(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?
The text was updated successfully, but these errors were encountered:
So, i tried to fix this, but i couldn't. There are a lot of corner cases. As a workaround you can move method with array in top of class definition. Or replace long[] with JSValue[].
Maybe sometimes i can come up with a solution to this problem
When I run this code:
I got wrong result for array:
Is it bug?
The text was updated successfully, but these errors were encountered: