microsoft / microsoft/node-api-dotnet
The double[][] in .NET is spitting out bad conversion code.
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 783
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Description
The function name incorrectly includes []:
private static Microsoft.JavaScript.NodeApi.JSValue from_System_Double[]_Array(double[][] value)
{
Microsoft.JavaScript.NodeApi.JSArray jsArray = new Microsoft.JavaScript.NodeApi.JSArray(value.Length);
jsArray.CopyFrom<double[]>(value, 0, (double[] value) =>
{
jsArray = new Microsoft.JavaScript.NodeApi.JSArray(value.Length);
jsArray.CopyFrom<double>(value, 0, (double value) =>
{
return (Microsoft.JavaScript.NodeApi.JSValue)value;
});
return (Microsoft.JavaScript.NodeApi.JSValue)jsArray;
});
return (Microsoft.JavaScript.NodeApi.JSValue)jsArray;
}
private static double[][] to_System_Double[]_Array(Microsoft.JavaScript.NodeApi.JSValue value)
{
Microsoft.JavaScript.NodeApi.JSArray jsArray = (Microsoft.JavaScript.NodeApi.JSArray)value;
double[][] array = new double[][jsArray.Length];
jsArray.CopyTo<double[]>(array, 0, (Microsoft.JavaScript.NodeApi.JSValue value) =>
{
jsArray = (Microsoft.JavaScript.NodeApi.JSArray)value;
array = new double[jsArray.Length];
jsArray.CopyTo<double>(array, 0, (Microsoft.JavaScript.NodeApi.JSValue value) =>
{
return (double)value;
});
return array;
});
return array;
}
<ItemGroup>
<PackageReference Include="Microsoft.JavaScript.NodeApi" Version="0.9.15-*" />
<PackageReference Include="Microsoft.JavaScript.NodeApi.Generator" Version="0.9.15-*" />
</ItemGroup>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No source file or test is named. Reproduce the generated double[][] conversion using the Microsoft.JavaScript.NodeApi and Microsoft.JavaScript.NodeApi.Generator package references, then trace the generator responsible for conversion method names. Done means the generated methods no longer include [] in their names while preserving the shown nested-array conversions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100