【发布时间】:2016-05-10 17:03:40
【问题描述】:
我想在控制台应用程序的 c# 平台中运行一些 JavaScript 文件, 例如:
using System;
using System.Threading.Tasks;
using EdgeJs;
class Program
{
public static async Task Start()
{
var func = Edge.Func(@"
return function (data, callback) {
var hello = function() {
// some javascript syntax error ...
return ' Hello ' + data;
};
callback(null, hello());
}
");
Console.WriteLine(await func("Word!"));
}
static void Main(string[] args)
{
Start().Wait();
}
}
但是当我的 js 函数出现错误时,它不会给我任何错误文本或提示来检测我的错误。
那么在运行 JS 函数时如何在 c# 中的 Edgejs 中获取错误文本?
【问题讨论】:
标签: javascript c# node.js edgejs