Quantcast
Channel: ClearScript
Browsing all 2297 articles
Browse latest View live

Updated Wiki: Home

Description ClearScript is a library that makes it easy to add scripting to your .NET applications. It currently supports JavaScript (via V8 and JScript) and VBScript.Features Simple usage; create a...

View Article



New Post: Is it possible to expose a JavaScript style function with a...

I would like to expose an open method on my c# object that I am exposing to ClearScript. The open method signature would look like this public void open(string address, Action<dynamic> callback)...

View Article

New Post: Is it possible to expose a JavaScript style function with a...

Hello! On the .NET side you can access JavaScript objects, including functions, using the dynamic keyword. For example, you can define your class like this:publicclass Page { publicvoid open(string...

View Article

New Post: Is it possible to expose a JavaScript style function with a...

Perfect. That did the trick. Thanks

View Article

New Post: Possible to get string content of passed in function?

We are building a bridge between CEF and C#. The C# console app is driven by javascript code. Used to basically drive a headless browser. So far clerscript has been a great tool. I was wondering if it...

View Article


Commented Issue: Problems using WindowsScriptEngineFlags.EnableDebugging [36]

I have code that executes fine on my machine with Visual Studio installed but have passed the code (compiled) including ClearScript.DLL to someone else who is getting an error when the script runs. I...

View Article

New Post: Possible to get string content of passed in function?

Greetings!​ I was wondering if it is possible to pull the string content of a passed in JavaScript function ​ Do you mean the function's JavaScript source code? If so, then you can use JavaScript's...

View Article

New Post: Is there a way to access the script frame stack?

I am looking to access the variables within the local scope of a script frame (on the stack?). I haven't found a way to do this with ClearScript yet. Does anyone know if this is possible? For...

View Article


Commented Issue: Problems using WindowsScriptEngineFlags.EnableDebugging [36]

I have code that executes fine on my machine with Visual Studio installed but have passed the code (compiled) including ClearScript.DLL to someone else who is getting an error when the script runs. I...

View Article


New Post: Is there a way to access the script frame stack?

Hi joshrmt, This is currently not possible and is rather unlikely as V8 has no public APIs that would enable it (the code on StackOverflow uses internal interfaces), but just in case, can you describe...

View Article

New Post: Cannot set a string as host object?

Hi, I may be missing something obvious, but this call fails on a V8ScriptEngine:engine.AddHostObject("test", "hello"); Feeling like a noob... :) Thanks for your help!

View Article

New Post: Cannot set a string as host object?

Hello! That's correct; ScriptEngine.AddHostObject() does not work with simple values like strings and numbers. Instead, you can do any of the following: engine.Script.test = "hello";...

View Article

New Post: Date marshalling

Hi again, Based on my tests, it seems that the Date type, which is one of the few core JS types, is not marshalled across the JS/.NET boundary. It would be very convenient if ClearScript could marshal...

View Article


New Post: Is there a way to access the script frame stack?

Im sure this will sound strange, but I wanted to be able to capture the current 'state' in order to transfer the closure/context to a different scripting environment. The alternate context is not...

View Article

New Post: Date marshalling

Hi Thomas, In general, ClearScript favors seamless access over data conversion. We believe that this approach maximizes flexibility. There are exceptions, of course. If ClearScript didn't convert...

View Article


New Post: Date marshalling

Thanks for your reply. I kind of forgot that it was indeed possible to call methods of JS objects from the .NET side. Cheers Thomas

View Article

New Post: Long/Int64 .NET Data types

I'm having some trouble passing large numbers from .NET to the JScriptEngine. Here is what I'm trying to do: JScriptEngine engine = new JScriptEngine(); engine.AddHostObject( "bigNumber",...

View Article


New Post: Date marshalling

I'm having some trouble with date marshaling as well. In my scenario I'm using JavaScript as a hook into how the application performs certain actions. I would like to expose a clean interface that...

View Article

New Post: Long/Int64 .NET Data types

Hi Jamin,​ I'm getting an error on the AddHostObject call. ​ That's correct. That method can't be used with simple values that are automatically converted to native script language datatypes, such as...

View Article

New Post: Date marshalling

Greetings Jamin!​ I would like to expose a clean interface that leverages the native functionality in JavaScript including Date. This is important because I'm prioritizing the JavaScript syntax over...

View Article
Browsing all 2297 articles
Browse latest View live




Latest Images