cpgf/cpgf — pull request #8 by svalaskevicius (2014-02-23 19:44:45+00:00)
Title: reuse existing V8 object by ptr address

When C++ is calling a wrapped method, the first
parameter passed is $this, however, a new V8 object
is created for the same native pointer that is already
existing. This causes all properties assigned in javascript
to be lost while inside the overriden method and also
increases memory usage and decreases performance while
creating the new instanance.

This patch tracks allocated javascript objects by the native
object address and passes the already constructed JS object
if its native pointer is being passed in the method arguments.