duktape closure registration
<p>I have C++ project and I'm using duktape JS library. I need to register global function in JS and save pointer to object as closure data with this function, so I can access this pointer when function is called. </p>

<p>I know how to do this in lua c api:</p>

<pre><code>lua_pushlightuserdata(L, this);
lua_pushcclosure(L, &amp;someFunction, 1);
lua_setglobal(L, "someFunction");
</code></pre>

<p>First I'm pushing pointer as closure data, then pointer to function. I need same functionality in duktape api.</p>

<p>Can you show me some code with closure registration and accessing it?</p>