I am using the Jint interpreter for C# Jint
I want to run the following JavaScript code.
class User {
constructor(name) { this.name = name; }
sayHi() { alert(this.name); }
}
...
But I always get an exception "unexpected reserver word in line 1."
What am I doing wrong?
The c# code looks like this:
Engine jsEngine = new Engine();
jsEngine.Execute(script);
The solution is to build the class like described here.