JavaScript Engine Switcher determines unified interface for access to the basic features of popular JavaScript engines. This library allows you to quickly and easily switch to using of another JavaScript engine.
Apache License 2.0
439
stars
49
forks
source link
Jering.Javascript.NodeJS JsCompilationException on spawn identifier #105
When I want to run this script from C# code I got JsCompilationException withe below details
Exception thrown: 'JavaScriptEngineSwitcher.Core.JsCompilationException' in JavaScriptEngineSwitcher.Node.dll
An unhandled exception of type 'JavaScriptEngineSwitcher.Core.JsCompilationException' occurred in JavaScriptEngineSwitcher.Node.dll
SyntaxError: Identifier 'spawn' has already been declared
at SpawnServer.js:1:1 -> // ITNOA
My loading code like below
using JavaScriptEngineSwitcher.Core;
using JavaScriptEngineSwitcher.Jurassic;
using JavaScriptEngineSwitcher.Node;
using System;
namespace Ansible.VisualStudio.LanguageServer
{
public class Loader
{
public Loader()
{
IJsEngine engine = new NodeJsEngine();
engine.ExecuteFile("SpawnServer.js");
}
}
}
ITNOA
Hi
I have a GitHub project https://github.com/soroshsabz/visualstudio-ansible and in Ansible.VisualStudio.LanguagerServer vs project, I have SpawnServer.js file that content like below
When I want to run this script from C# code I got JsCompilationException withe below details
My loading code like below
Where is my wrong?
if you want to see my code in GitHub you can see language-server branch
I create same Question in SO
thanks