edge icon indicating copy to clipboard operation
edge copied to clipboard

How can I sharing node.js object between callings of Edge.Func(@"_javascript_code_");

Open fongnx opened this issue 6 years ago • 0 comments

Hi there,

I'm researching with Node.js in a C# process so I dont known how to get the static object between callings of Edge.Func(@"javascript_code");

`public class TestNodeJs { public static async void Start() { var func = Edge.Func(@"

		const num = 5;			

        return function (data, callback) {
            callback(null, "Node.js welcomes "+ num);
        }
    ");

		Console.WriteLine(await func(null));

		var func2 = Edge.Func(@"
        return function (data, callback) {
            callback(null, 'Node.js welcomes ' + num);
        }
    ");

		Console.WriteLine(await func2(null));
	}

}`

I got error when try to access to variable num at the second time!

fongnx avatar Aug 21 '18 17:08 fongnx