V8.NET

291 views
Skip to first unread message

James W

unread,
May 23, 2013, 7:04:43 AM5/23/13
to v8-u...@googlegroups.com
Hey everyone!  I've just completed a .NET wrapper for the V8 engine at v8dotnet.codeplex.com. 8)

Angel Java Lopez

unread,
May 23, 2013, 7:28:43 AM5/23/13
to v8-u...@googlegroups.com
Hi everyone!

James, cool, very interesting!!

Can you write down some use cases? I see in your tests that you can invoke javascript code from .NET, but can you expose a .NET object to V8/Javascript and use it from JavaScript code? expose a Type? declare an static method in .NET as a function to V8? I would like to do

if (System.IO.Exists("..."))
...

var lines = System.IO.File.ReadAllLines("...")
....

from JavaScript. Or reference the System.Console as "myconsole" in JavaScript.

Difference with
?

Angel "Java" Lopez
@ajlopez



On Thu, May 23, 2013 at 8:04 AM, James W <cont...@jameswilkins.net> wrote:
Hey everyone!  I've just completed a .NET wrapper for the V8 engine at v8dotnet.codeplex.com. 8)

--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

James W

unread,
Aug 26, 2013, 10:39:13 AM8/26/13
to v8-u...@googlegroups.com
Hi,

Ok, it's now possible to wrap CLR types in V8.NET. ;)  Although the focus of V8.NET was to interface at a lower level, I've added this feature to make it easier to consume existing .NET types.  For example:

{V8Engine}.GlobalObject.SetProperty(typeof(System.IO.File), nulltrueV8PropertyAttributes.Locked);
In script: "File.Exists(...)"

or

{V8Engine}.GlobalObject.SetProperty(typeof(System.IO.File), "System.IO.File"trueV8PropertyAttributes.Locked);
In script: "this["System.IO.File"].Exists(...)"

V8.NET implicitly calls {V8Engine}.RegisterType() to register types, but you can call this before hand if you want more control over member attributes and recursive binding.

The type binding system is very efficient, and caches anything it can to speed up the process of working with the .NET side.

8)
Reply all
Reply to author
Forward
0 new messages