Questions tagged [jint]

Jint is a JavaScript interpreter for .NET.

Jint is a script engine based on the JavaScript language. Using Jint, developers can provide fully scriptable applications, execute .NET code without compiling, or create external configuration logic, using the most used script language.

Jint aims at providing every JavaScript functionalities to .NET applications, and bindings to .NET languages can be done in both sides. Jint scripts can use any .NET object from your application, and use every part of the .NET base class library.

Jint has been rewritten completely and is now hosted on Github.

Jint Information (codeplex archive)

118 questions
4
votes
1 answer

How to create timer on JINT Javascript side

I´m developing a C# project using JINT (https://github.com/sebastienros/jint), and I need to create a timer on my JS so it can execute a function on my javascript every time the timer tim set is elapsed. How can I accomplish that?. I have used…
NicoRiff
  • 4,803
  • 3
  • 25
  • 54
4
votes
1 answer

How to get all variables (and functions names) from the global scope in Jint?

I'm using Jint and I wonder if there is a way from the C# perspective to get all defined variables and functions available in the global scope of the script. For example, given the following Javascript code in the file "test.js": function…
formixian
  • 1,549
  • 16
  • 25
3
votes
1 answer

Pass an object to a function in jint and return a value

I'm attempting to pass an object to a javascript function via jint and return a value. But it doesn't seem to work. Here is what I have tried so far - Error - Jint.Runtime.JavaScriptException: 'obj is undefined' Using the following code - var…
Abhilash V
  • 319
  • 3
  • 16
3
votes
2 answers

C# non-static class inside static class JINT

Hi trying to make a class inside a static class to use in JINT but when it's referenced I get an error C# code namespace Hi { public static class Ok { public class Wowa { public Wowa(){} } } } But when I try to…
Yaakov5777
  • 309
  • 5
  • 15
3
votes
0 answers

How do I serialize/deserialize Jint engine into string/file

Would it be possible to serialize Jint JS engine into a string or a file, and deserialize and load it at a later point? if this is not possible with Jint, is it possible with any other .NET JavaScript interpreters?
CactusBlue
  • 31
  • 1
  • 1
3
votes
1 answer

Jint Array functions ECMA 5.1

I'm attempting to use Jint (v2.10.4.0) to translate one arbitrary JSON structure to another. However, I am having issues with using map. According to the ECMA 5.1 language spec, map should exist on Array.prototye. However, when I attempt to use it,…
BM-
  • 616
  • 5
  • 15
3
votes
2 answers

What happens if I define a .Net class in JavaScript code using Jint engine

In Jint, you can access .Net classes in JS. JS File Code : var write = function (msg) { var log = System.Console.WriteLine; log(msg); }; C# Code Engine jsEngine = new Engine(e=>e.AllowClr()); string script =…
2
votes
1 answer

Exposing specific namespaces to Jint

I would like to allow scripts running in Jint to access a pre-existing API I have set up as a namespace. By that I mean I have a single namespace that contains the API, including other namespaces. I do not want to allow the scripts access to the…
SeriousSamP
  • 436
  • 3
  • 18
2
votes
2 answers

JNI int method returning from exception

Suppose I have a Java class like this: public class Test { static { System.loadLibrary("test"); } public native int foo(); } Suppose that the foo() method is doing some JNI calls, and one of these calls fails (IE, throws…
foens
  • 8,642
  • 2
  • 36
  • 48
2
votes
3 answers

Deserializing embedded array/list to array in c# as expandoobject

I have JSON objects having embedded arrays - with no predefined strongly typed class to deserialize to. ExpandoObject deserialization with Json.Net works, but the array is deserialized to list, which is an issue for me. I need expndoobject with…
ZorgoZ
  • 2,974
  • 1
  • 12
  • 34
2
votes
0 answers

JINT performance is significantly worse when an application is run as a 64bit application

The application requires JS support (the program is written in C#) and JINT is being used as the interpreter. I have noticed how performance significantly degrades when the application is run as a 64bit application. I have simplified this down to…
Ian Hannah
  • 131
  • 1
  • 1
  • 10
2
votes
0 answers

C# - Jint Generic Methods

I am new to using Jint (the Javascript Interpreter for .NET) and am trying to gain a better understanding of the complete functionality. Looking at the documentation, I see support of Generic types like so: jint> var ListOfString =…
2
votes
1 answer

Attach VSCode Debugger for Typescript/Javascript Debugging to a C# Winforms Application

In my C# WinForms application I execute javascript with jint. The javascript code is the result code of my transpiled typescript file. I use inline source mapping. Now I want to give the users of my application the possibility to debug the…
2
votes
0 answers

Using a delegate to handle a Javascript callback in JINT

In the following code using JINT, the call to the Setup1 method works and the call to Setup2 method does not. The call to Setup2 raises the error: Jint.Runtime.JavaScriptException: 'No public methods with the specified arguments were found.' using…
Ian Hannah
  • 131
  • 1
  • 1
  • 10
2
votes
1 answer

Getting "document is not defined" error when checking for valid jQuery code though JInt?

Is it possible to check if a JQuery string has a valid syntax? I've tried Jint because of this Determine whether a string contains valid javascript code. Unfortunately, it seems as if this is meant for another use-case. I have tried the following…
Astrophage
  • 1,231
  • 1
  • 12
  • 38