Skip to content

Wrapping an object which is created in C++ and making it available in JavaScript, using v8

Notifications You must be signed in to change notification settings

anoop-rs/C-ObjectAccessUsingV8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C-ObjectAccessUsingV8

Wrapping an object which is created in C++ and making it available in JavaScript, using v8

I was trying to figure out how to wrap C++ objects in JavaScript. Most of the code I found online is old and is not working with current version of v8. It's based on the HelloWorld exmple of V8 so that it is not overly complex and anyone who can get the HelloWorld exmple up can compile and run this also. It exposes the Point class which is created in C++, so that in Javascript, we can use it as follows:

var p = Point(67,98); console.log(p.x);

My references are : http://web.archive.org/web/20150217015842/http://create.tpsitulsa.com/blog/2009/01/29/v8-objects https://github.com/v8/v8/blob/master/samples/process.cc

About

Wrapping an object which is created in C++ and making it available in JavaScript, using v8

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages