This project is read-only.

V8.NET Beta Release v1.2.54.7

Rating: No reviews yet
Downloads: 7
Change Set: 28897
Released: Aug 20, 2013
Updated: Aug 21, 2013 by jamesnw
Dev status: Beta Help Icon

Recommended Download

Application V8.NET Binaries (v1.2.54.7)
application, 22430K, uploaded Aug 21, 2013 - 7 downloads

Release Notes

Ladies, gentleman, and others - the DLR integration and object binding is here! This release comes with new methods for binding types and object instances with the JavaScript environment. See the console source (program.cs) for a good example.

Completed Updates This Release
  • Very easy to deal with accessing nested properties/objects.
  • Added methods to make it easier to bind existing .NET object instances and types to the V8 JS environment.
  • Created a new function '{V8Engine}.LoadScript(string scriptFile)' to make it more convenient to load JS files.
  • Breaking change 1: Some handle property names were refactored, and some added so that handles can have full access to the native objects without having to create V8NativeObject instances (too much extra overhead I wanted to avoid). In fact, V8NativeObject now wraps a Handle and redirects dynamic requests to it, and both Handle and InternalHandle implement the same methods for working on the native JavaScript objects (so that's all you need to access/update in-script objects!). This was done to allow dynamic property access on the handles without having to create another object to do it. This change slightly affects the members and functionality of the V8NativeObject - but mostly behind the scenes. This allows accessing objects easily using a chain of property names, such as '((dynamic){someHandle}).a.b.c.d...' or '{object}.AsDynamic.a.b.c.d...'.
  • Breaking change 2: V8NativeObject will now have a generic object (V8NativeObject<T>) version to allow injecting your own objects into it instead of deriving from it (deriving is recommended however). I wanted to get rid of the internal "_ObjectInfo' objects that were holding member data that really should be in the object itself. This will mainly affect only those who need to implement the interface (IV8NativeObject) instead of inheriting from V8NativeObject. Under the new system, when the "Initialize()" virtual method is called, you just cache a pointer to the 'V8NativeObject' instance wrapping your object and use that instead.
  • Various Bug fixes.

Some quick start notes:
  • Use "TypeBinder.RegisterType()" to register your types in V8.NET (this has nothing to do with JavaScript - this only creates a cached binder for the type). This is not required, but does give you more control.
  • There's two new "SetProperty()" methods: one for binding an object instance, and another to store a type as a function property (to use with "new").
  • There are two attributes to use on your custom objects: 'ScriptObject' and 'ScriptMember'.

Known issue: Overloaded methods are not well supported yet when binding. For now, the parameter type names are added to the property name to make it unique. This will probably not change, however, I'm looking into a way for users to handle these special situations. This is actually a good thing - calling overloaded methods based on dynamic variable types would make for easy bugs (and just confusion over all). Instead, the arguments given are converted to the required parameter types for you (where possible). To this end, overloads are not supported, and alternate names will be required (by default). That said, I'll probably create a callback to allow someone to add custom behavior for this.

Missing: Static members not yet supported. I'll be doing this next. The DLR support and binding took a lot of time, but I should be releasing quicker updates now - so you won't have to wait too long. :)

Reviews for this release

No reviews yet for this release.