<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>jint Discussions Rss Feed</title><link>http://jint.codeplex.com/Thread/List.aspx</link><description>jint Discussions Rss Description</description><item><title>New Post: Include Javascript Files in a script</title><link>http://jint.codeplex.com/discussions/442771</link><description>&lt;div style="line-height: normal;"&gt;Is there already a command in that allows me to include code stored in separate js files? In good old php times we used for example require('demo') to include the module demo.php. Something like this I would also need here so that we can make our js modular.&lt;br /&gt;
&lt;/div&gt;</description><author>toolsfactory</author><pubDate>Tue, 07 May 2013 07:08:16 GMT</pubDate><guid isPermaLink="false">New Post: Include Javascript Files in a script 20130507070816A</guid></item><item><title>New Post: Accessing current script line number from external functions</title><link>http://jint.codeplex.com/discussions/442770</link><description>&lt;div style="line-height: normal;"&gt;Does anyone have an idea how the following scenario could be implemented:&lt;br /&gt;
&lt;br /&gt;
whenever an external function (registered using SetFunction(&amp;quot;Name&amp;quot;, new Action&amp;lt;object&amp;gt;...)) I would like to allow the called function to write a log entry including the current  line number.&lt;br /&gt;
One way to do this would be running the script in debug mode all the time and manually storing the current line from the OnStep event. But that's eating up performance. So ideally there would be something like a context that I can pass to the external function that holds all the current engine states including the SourceCodeDescriptor structure.&lt;br /&gt;
&lt;br /&gt;
Any ideas welcome&lt;br /&gt;
&lt;/div&gt;</description><author>toolsfactory</author><pubDate>Tue, 07 May 2013 07:04:45 GMT</pubDate><guid isPermaLink="false">New Post: Accessing current script line number from external functions 20130507070445A</guid></item><item><title>New Post: WebSocket on Jint</title><link>http://jint.codeplex.com/discussions/440758</link><description>&lt;div style="line-height: normal;"&gt;Does anyone know how to use the javascript WebSocket library in jint?&lt;br /&gt;
&lt;br /&gt;
I have an existing script that contains the line &amp;quot;var socket = new WebSocket()&amp;quot; but the jint engine doesn't what is web socket.&lt;br /&gt;
&lt;br /&gt;
Does anyone have a solution?&lt;br /&gt;
&lt;/div&gt;</description><author>eranre</author><pubDate>Thu, 18 Apr 2013 12:26:07 GMT</pubDate><guid isPermaLink="false">New Post: WebSocket on Jint 20130418122607P</guid></item><item><title>New Post: Reuse of JintEngine? Performance question </title><link>http://jint.codeplex.com/discussions/439653</link><description>&lt;div style="line-height: normal;"&gt;Should I hold on to an JintEngine instance?&lt;br /&gt;
&lt;br /&gt;
private static JintEngine _scriptEngine;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;    private static JintEngine ScriptEngine
    {
        get { return _scriptEngine ?? (_scriptEngine = new JintEngine()); }
    }&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>Martin_Andersen</author><pubDate>Tue, 09 Apr 2013 14:08:05 GMT</pubDate><guid isPermaLink="false">New Post: Reuse of JintEngine? Performance question  20130409020805P</guid></item><item><title>New Post: Calling a function on a c-object</title><link>http://jint.codeplex.com/discussions/437910</link><description>&lt;div style="line-height: normal;"&gt;Just an update:&lt;br /&gt;
&lt;br /&gt;
When we create the father object within VB.NET and set its members to the original, it works. We can even modify the members of that instance within JavaScript, they are then changed in the original object. It seems that somehow the father object (OURComDataTypes.COURDocument) cannot be passed correctly to JavaScript, when it is created within the modules of our application written in C (COM). &lt;br /&gt;
&lt;br /&gt;
The first 3 lines of the function correct that. While this is a valid workaround, we are still confused why this could happen. Does anyone have an idea what we can do?&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Public Function CallJavaScript(ByVal method As String, ByRef input As OURComDataTypes.COURDocument) As Boolean
    Dim input1 As New OURComDataTypes.COURDocument  // create a new instance 
    input1.ParameterList = input.ParameterList      // share members with the original
    input1.Children = input.Children                // dito
    If JavaScriptContext Is Nothing Then
        ' initialize the javascript engine
        JavaScriptContext = New Jint.JintEngine
        JavaScriptContext.AllowClr = True
        JavaScriptContext.DisableSecurity()
    End If

    Dim ScriptTextContent As String = ReadScript(method)
    If (ScriptTextContent.Length = 0) Then
        Throw New Exception(&amp;quot;JavaScript for method &amp;quot; &amp;amp; method &amp;amp; &amp;quot; is empty&amp;quot;)
        CallJavaScript = False
        Exit Function
    End If

    If Not input Is Nothing Then
         JavaScriptContext.SetParameter(&amp;quot;input&amp;quot;, input1)
    End If


    Try
       
        returnString = JavaScriptContext.Run(ScriptTextContent)
    ...
    
End Function&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>bee4cp</author><pubDate>Wed, 27 Mar 2013 14:09:06 GMT</pubDate><guid isPermaLink="false">New Post: Calling a function on a c-object 20130327020906P</guid></item><item><title>New Post: anchor form controls </title><link>http://jint.codeplex.com/discussions/438028</link><description>&lt;div style="line-height: normal;"&gt;How can achieve this:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Control.Anchor = ((System.Windows.Forms.AnchorStyles)
                (((System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));&lt;/code&gt;&lt;/pre&gt;

in jint javascript?&lt;br /&gt;
thanks,&lt;br /&gt;
i.&lt;br /&gt;
&lt;/div&gt;</description><author>brojgar</author><pubDate>Tue, 26 Mar 2013 13:42:24 GMT</pubDate><guid isPermaLink="false">New Post: anchor form controls  20130326014224P</guid></item><item><title>New Post: Calling a function on a c-object</title><link>http://jint.codeplex.com/discussions/437910</link><description>&lt;div style="line-height: normal;"&gt;Hi, &lt;br /&gt;
&lt;br /&gt;
we have a C-library which is registered in windows and which we use for our shared informations.&lt;br /&gt;
We access this lib from VB.NET. We have instances to objects within that library, which we pass from VB.NET to the jint instance by setParameter()&lt;br /&gt;
&lt;br /&gt;
Depending on the way how we create the object, we get the error &amp;quot;Function expected&amp;quot; when we try to execute a method on that object. &lt;br /&gt;
&lt;br /&gt;
The javascript code looks like this:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
// now we access an object from a list of objects within the 
var pp = input.ParameterList.getFieldFromFieldCollection(&amp;quot;field1&amp;quot;)

// the objects have a member called &amp;quot;value&amp;quot;. We need to call get_Value() to access.
return pp.get_Value().toString()
&lt;/code&gt;&lt;/pre&gt;

Now, as said, when we create the input object &amp;quot;manually&amp;quot; from within VB.NET, the above javascript works fine. &lt;br /&gt;
&lt;br /&gt;
When we create the input object within other c methods and pass it through VB.NET, we always get &amp;quot;Function expected&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Any clues how to resolve this?&lt;br /&gt;
&lt;/div&gt;</description><author>bee4cp</author><pubDate>Mon, 25 Mar 2013 15:56:50 GMT</pubDate><guid isPermaLink="false">New Post: Calling a function on a c-object 20130325035650P</guid></item><item><title>New Post: Jint.JintJsException: Invalid IL code in (wrapper dynamic-method) Jint.Marshal.ProxyHelper:dynamicPropertyGetter (Jint.Marshaller,Jint.Native.JsDictionaryObject): method body is empty</title><link>http://jint.codeplex.com/discussions/437258</link><description>&lt;div style="line-height: normal;"&gt;Hi, I am getting this error on every script, I am running Jint inside a .Net application which is running on Mono. Has anyone seen this before?&lt;br /&gt;
&lt;br /&gt;
This is part of the stack trace:&lt;br /&gt;
&lt;br /&gt;
System.Delegate	CreateDelegate		0	0&lt;br /&gt;
System.Delegate	CreateDelegate		0	0&lt;br /&gt;
System.Reflection.Emit.DynamicMethod	CreateDelegate		0	0&lt;br /&gt;
Jint.Marshal.ProxyHelper	WrapGetProperty		0	0&lt;br /&gt;
Jint.Marshaller	WrapGetProperty		0	0&lt;br /&gt;
Jint.Marshaller	MarshalPropertyInfo		0	0&lt;br /&gt;
Jint.Native.NativeConstructor	.ctor		0	0&lt;br /&gt;
Jint.Native.NativeTypeConstructor	Wrap		0	0&lt;br /&gt;
Jint.Marshaller	CreateConstructor		0	0&lt;br /&gt;
Jint.Marshaller	MarshalType		0	0&lt;br /&gt;
Jint.Marshaller	MarshalClrValue		0	0&lt;br /&gt;
Jint.Native.NativeDescriptor	Get		0	0&lt;br /&gt;
Jint.Native.JsDictionaryObject	TryGetProperty		0	0&lt;br /&gt;
.....&lt;br /&gt;
&lt;br /&gt;
Looking inside NativeConstructor.cs there is only two calls to MarshalPropertyInfo:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;        // find and add all static properties and fields
        foreach (var info in type.GetProperties(BindingFlags.Static | BindingFlags.Public))
            DefineOwnProperty(Global.Marshaller.MarshalPropertyInfo(info, this));
&lt;/code&gt;&lt;/pre&gt;

and &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;        foreach (var info in type.GetProperties(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public))
        {
            ParameterInfo[] indexerParams = info.GetIndexParameters();
            if (indexerParams == null || indexerParams.Length == 0)
                m_properties.AddLast(global.Marshaller.MarshalPropertyInfo(info, this));
&lt;/code&gt;&lt;/pre&gt;

It seems like a similar issue to this: &lt;a href="https://bugzilla.xamarin.com/show_bug.cgi?id=6821#c5" rel="nofollow"&gt;https://bugzilla.xamarin.com/show_bug.cgi?id=6821#c5&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Any help would be amazing&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;/div&gt;</description><author>jch254</author><pubDate>Tue, 19 Mar 2013 23:38:38 GMT</pubDate><guid isPermaLink="false">New Post: Jint.JintJsException: Invalid IL code in (wrapper dynamic-method) Jint.Marshal.ProxyHelper:dynamicPropertyGetter (Jint.Marshaller,Jint.Native.JsDictionaryObject): method body is empty 20130319113838P</guid></item><item><title>New Post: Debugging CallFunction</title><link>http://jint.codeplex.com/discussions/284732</link><description>&lt;div style="line-height: normal;"&gt;don't you have to write the function like thus&lt;br /&gt;
&lt;br /&gt;
var test = function(){&lt;br /&gt;
code;&lt;br /&gt;
code;&lt;br /&gt;
etc etc;;&lt;br /&gt;
}&lt;br /&gt;
&lt;/div&gt;</description><author>notahack</author><pubDate>Sat, 09 Mar 2013 00:32:36 GMT</pubDate><guid isPermaLink="false">New Post: Debugging CallFunction 20130309123236A</guid></item><item><title>New Post: File exists detection</title><link>http://jint.codeplex.com/discussions/405262</link><description>&lt;div style="line-height: normal;"&gt;I bet javascript doesn't need that @ sign in front of the string&lt;br /&gt;
&lt;/div&gt;</description><author>notahack</author><pubDate>Sat, 09 Mar 2013 00:29:03 GMT</pubDate><guid isPermaLink="false">New Post: File exists detection 20130309122903A</guid></item><item><title>New Post: Dang even a caveman can use it BUT ...</title><link>http://jint.codeplex.com/discussions/435965</link><description>&lt;div style="line-height: normal;"&gt;I am rewriting a vb6 project that I used the WSH in. Basically I defined some classes I plugged into the script for users to use functions from.  I kept plugging in other objects and then I would call functions to act like events that would execute user written scripting that would manipulate those objects. I always got what information I needed from those changed objects and never relied on any return code. This code will do exactly that for me and so far I am happy happy happy.&lt;br /&gt;
&lt;br /&gt;
My BUT is this. I will construct the script and run it once to compile it. From then on out I will be constantly, sometimes hundreds of times a minute, using SetParameter to plug in objects and calling the trigger/event functions. Will banging on jint like that be any problem for hours on end?&lt;br /&gt;
&lt;/div&gt;</description><author>notahack</author><pubDate>Sat, 09 Mar 2013 00:16:38 GMT</pubDate><guid isPermaLink="false">New Post: Dang even a caveman can use it BUT ... 20130309121638A</guid></item><item><title>New Post: How do I go from a Javascript array to a c#  object?</title><link>http://jint.codeplex.com/discussions/360886</link><description>&lt;div style="line-height: normal;"&gt;Late to the party but for anyone googling it can be done like this:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;Jint.JintEngine engine = new Jint.JintEngine();
Jint.Native.JsArray result = engine.Run(script);

for (var i = 0; i &amp;lt; result.Length; i++)
{
    var jsObj = result.get(i) as Jint.Native.JsObject;

    if (jsObj == null) continue;

    foreach (var kvp in jsObj)
    {
        Console.WriteLine(&amp;quot;{0} is {1}&amp;quot;, kvp.Key, kvp.Value);
    }
}&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;</description><author>alexrootes</author><pubDate>Sun, 03 Mar 2013 13:02:27 GMT</pubDate><guid isPermaLink="false">New Post: How do I go from a Javascript array to a c#  object? 20130303010227P</guid></item><item><title>New Post: Data Binding with C# Object</title><link>http://jint.codeplex.com/discussions/433711</link><description>&lt;div style="line-height: normal;"&gt;Is there any high-level mechanism to enable Data Binding or PropertyChangeNotify between a C# object outside of the interpreter with an object stored within the JINT engine?  I'm looking to store data in the engine and connect to the GUI to allow users to easily change the data but I also need to reflect back-end changes to the data on the GUI.&lt;br /&gt;
&lt;/div&gt;</description><author>Bofferd</author><pubDate>Tue, 19 Feb 2013 19:54:39 GMT</pubDate><guid isPermaLink="false">New Post: Data Binding with C# Object 20130219075439P</guid></item><item><title>New Post: Using C# overload in JavaScript</title><link>http://jint.codeplex.com/discussions/430560</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi, I am new using Jint :)&lt;/p&gt;
&lt;p&gt;For some reasons, we need to use overload function from C# in JavaScript.&lt;br&gt;
I have an object (from an api) named ORSOleObject where I can in C# do a GetValeur like that:&lt;/p&gt;
&lt;p&gt;ORSOleObject toto = MyObject;&lt;/p&gt;
&lt;p&gt;string result = toto.GetValeur(&amp;quot;string&amp;quot;);&lt;/p&gt;
&lt;p&gt;I do a SetParameter and give toto to the JavaScript with Jint but when I try to do a GetValeur in JavaScript I got an error, the SetParameter is working, I can use the toto but not the overload function.&lt;/p&gt;
&lt;p&gt;Can you help me, I found the SetFunction but I am not sure How to use it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;/div&gt;</description><author>lbouriez</author><pubDate>Wed, 23 Jan 2013 10:12:31 GMT</pubDate><guid isPermaLink="false">New Post: Using C# overload in JavaScript 20130123101231A</guid></item><item><title>New Post: Current Development Status</title><link>http://jint.codeplex.com/discussions/429822</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;I personally have not&amp;nbsp;worked on&amp;nbsp;it for a long time, and don't intend to for some time. I am not the only developer though ...&lt;/p&gt;
&lt;/div&gt;</description><author>sebastienros</author><pubDate>Wed, 16 Jan 2013 20:10:23 GMT</pubDate><guid isPermaLink="false">New Post: Current Development Status 20130116081023P</guid></item><item><title>New Post: Current Development Status</title><link>http://jint.codeplex.com/discussions/429822</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;What is the current development status of Jint?&lt;/p&gt;
&lt;p&gt;Has the development ended?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;/div&gt;</description><author>rodneyjt</author><pubDate>Wed, 16 Jan 2013 20:07:14 GMT</pubDate><guid isPermaLink="false">New Post: Current Development Status 20130116080714P</guid></item><item><title>New Post: HTTP Request? Out of the box?</title><link>http://jint.codeplex.com/discussions/428709</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;.&lt;/p&gt;
&lt;/div&gt;</description><author>SlashMind</author><pubDate>Mon, 07 Jan 2013 03:52:46 GMT</pubDate><guid isPermaLink="false">New Post: HTTP Request? Out of the box? 20130107035246A</guid></item><item><title>New Post: more than one year past, whats about ECMAScript5? Any newer version?</title><link>http://jint.codeplex.com/discussions/428032</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;more than one year past, whats about ECMAScript5? Any newer version?&lt;/p&gt;
&lt;/div&gt;</description><author>softboy99</author><pubDate>Sun, 30 Dec 2012 10:40:19 GMT</pubDate><guid isPermaLink="false">New Post: more than one year past, whats about ECMAScript5? Any newer version? 20121230104019A</guid></item><item><title>New Post: returning Jint.Native.JsInstance objects from c#</title><link>http://jint.codeplex.com/discussions/405871</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;var jintarr =&amp;nbsp;global.ArrayClass.New(); solved the problem.&lt;/p&gt;
&lt;/div&gt;</description><author>sgrondahl</author><pubDate>Thu, 20 Dec 2012 22:20:53 GMT</pubDate><guid isPermaLink="false">New Post: returning Jint.Native.JsInstance objects from c# 20121220102053P</guid></item><item><title>New Post: Unit Test "ShouldNotReferenceThisAsGlobalScopeInDetachedFunctionInStrictMode" failed</title><link>http://jint.codeplex.com/discussions/407346</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;I downloaded the latest source (May 2012), plus the latest Antlr3 (version 3.4.1.9004), built the whole solution with Viisual Studio 2010 and .NET 4.0 Client Profile.&lt;/p&gt;
&lt;p&gt;When I ran the Unit Tests (Jint.Tests), all of Unit Tests passed except for ShouldNotReferenceThisAsGlobalScopeInDetachedFunctionInStrictMode. It failed on the statement [ assert(1, getx()); ] because getx() returns null (it should return 1).&lt;/p&gt;
&lt;p&gt;It appears that his Unit Test has been added after the last release. What would be the cause to this failure? It seems the global 'this' was not found.&lt;/p&gt;
&lt;p&gt;FYI: Migrating JINT&amp;nbsp;to VS2010 and .NET 4 invloves resolving &lt;span style="color:black; font-size:10pt"&gt;
ambiguous Func&amp;lt;&amp;gt; delegates (by changing to either System.Func&amp;lt;&amp;gt; or Jint.Delegates.Func&amp;lt;&amp;gt;).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;p&gt;john&lt;/p&gt;
&lt;/div&gt;</description><author>jianhuahuang</author><pubDate>Wed, 19 Dec 2012 16:15:27 GMT</pubDate><guid isPermaLink="false">New Post: Unit Test "ShouldNotReferenceThisAsGlobalScopeInDetachedFunctionInStrictMode" failed 20121219041527P</guid></item></channel></rss>