edge icon indicating copy to clipboard operation
edge copied to clipboard

Cast error on returning short values (0.10.1)

Open fsahmad opened this issue 9 years ago • 2 comments

Starting from release 0.10.0 returning short values from C# throws the exception "Error: Specified cast is not valid."

The following code will fail for example:

var edge = require('edge');

var helloWorld = edge.func(function () {/*
    async (input) => { 
        return (short)1; 
    }
*/});

helloWorld('JavaScript', function (error, result) {
    if (error) throw error;
    console.log(result);
});

while the following works:

var edge = require('edge');

var helloWorld = edge.func(function () {/*
    async (input) => { 
        return (ushort)1; 
    }
*/});

helloWorld('JavaScript', function (error, result) {
    if (error) throw error;
    console.log(result);
});

fsahmad avatar Mar 24 '15 16:03 fsahmad