You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tryed out these interpreter. An simple console.log will work - But when i try to use ES6 classes, i've got following Exception:
Noesis.Javascript.JavascriptException: SyntaxError: Unexpected reserved word
bei Noesis.Javascript.CompileScript(Local<v8::Script>* , Char* source_code, Char* resource_name)
bei Noesis.Javascript.JavascriptContext.Run(String iSourceCode)
bei ReactSharp.Program.Main(String[] args) in c:\Users\info\Documents\SharpDevelop Projects\ReactSharp\ReactSharp\Program.cs:Zeile 48.
Program.cs
using System;
using System.IO;
using Noesis.Javascript;
namespace Sample {
public class SystemConsole {
public SystemConsole() {}
public void log(string iString) {
Console.WriteLine(iString);
System.Diagnostics.Debug.WriteLine(iString);
}
}
internal sealed class Program {
[STAThread]
private static void Main(string[] args) {
System.Diagnostics.Debug.WriteLine("HI");
using(JavascriptContext context = new JavascriptContext()) {
context.SetParameter("console", new SystemConsole());
// Read the "main.js"
string contents = File.ReadAllText(@"main.js");
// Run the script
context.Run(contents);
}
}
}
}
main.js
class Example {
constructor() {
console.log("Hello World, APP!");
}
}
The text was updated successfully, but these errors were encountered:
You probably need to build from source to get a version that supports ES6 classes. Someone may provide more help if you specify which version of JavaScript.Net you are using, and cut the example down to work out which reserved word is the problem.
I've tryed out these interpreter. An simple
console.log
will work - But when i try to useES6
classes, i've got following Exception:Program.cs
main.js
The text was updated successfully, but these errors were encountered: