cloudtrends / chromiumembedded

Automatically exported from code.google.com/p/chromiumembedded
1 stars 1 forks source link

Add a user_data parameter to V8 CreateFunction #191

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In V8, a function is an object.
So a function should have user data (like objects) in the v8 extension API. It 
should be helpfull to create object constructor or use anonymous methods.

Original issue reported on code.google.com by hgourv...@gmail.com on 20 Feb 2011 at 11:56

GoogleCodeExporter commented 9 years ago
The CefV8Handler instance passed to CefV8Value::CreateFunction can contain 
whatever user data you require.

You can define anonymous functions as part of a V8 extension. Can you provide a 
concrete example of how you want to use anonymous functions with 
CefV8Value::CreateFunction?

Original comment by magreenb...@gmail.com on 21 Feb 2011 at 12:52

GoogleCodeExporter commented 9 years ago
An anonymous method is not the best example.
I would like for example to be able to use the js constructor syntax: v = new 
MyClass(). If I keep reference of the class in the user data I could call the 
constructor method directly without having to create a v8 handler for each 
constructor.
I must say I use Delphi and the new RTTI introspection to expose automatically 
any value to v8.

Original comment by hgourv...@gmail.com on 21 Feb 2011 at 8:54

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 23 Feb 2011 at 5:54

GoogleCodeExporter commented 9 years ago

Original comment by magreenb...@gmail.com on 2 Oct 2012 at 10:20