I have been using JScript.NET to calculate expressions (and execute input code) in Windows Forms.
Like this:
(55 % 6) + Math.acos(0.4) - ~ 9 * Math.PI + Math.random() = 33.72725296117653
Now I would want to have the same thing on Xamarin Forms, but the library would only work on Android (iOS not tested yet) and UWP project keeps saying that ApplicationException is not found.
Will not update the JScript.NET libraries so the deprecated Vsa Engine is not a problem.
What tried so far
Decompiled the lbrary with ILSpy, but it references mscorlib.dll so much that I gave up.
Looked for Javascript evaluators but they also references mscorlib.dll
I don't know if I should include mscorlib in the project, because Microsoft seems to disallow it.
Any solutions? Thanks in advance.
Edit:
Using JScript 8.0 libraries, if that helps.
If possible, suggest a solution cross-compatible with Win8.1 / WinPhone 8.1 projects too.
Eventually I came on to use Jint, which is a Javascript interpreter, free and open-source (no need to worry for licenses yay!) and with a bit of extension methods on Type it seems to work with Win8.1 as well:
Now I do not have to change my example code and evaluate smoothly on everywhere (even Xamarin.iOS since Jint does not use the DLR or IL emitting methods, which again is another advantage)