agracio / edge-js

Run .NET and Node.js code in-process on Windows, macOS, and Linux
MIT License
643 stars 95 forks source link

System.Exception:"ReferenceError: await is not defined at eval #173

Closed dlxj closed 1 year ago

dlxj commented 1 year ago

my code:

    private async Task<string>  Start()
    {
        var func = Edge.Func(@"
        return function (data, callback) {
            let d = await ( async ()=>{
                return 'paaaaa'
            })()
            callback(null, 'Node.js welcomes ' + data + d);
        }
    ");

        string ret = (string)await func(".NET");
        return ret;
    }

System.Exception:"ReferenceError: await is not defined at eval (eval at compileFunc (xxxxxx\bin\x64\Debug\edge\double_edge.js:53:27),:8:25)"