Beispiel #1
0
duk_ret_t dukopen_uv(duk_context *ctx) {

  duv_ref_setup(ctx);

  // Create a uv table on the global
  duk_push_object(ctx);
  duk_put_function_list(ctx, -1, duv_funcs);
  return 1;
}
Beispiel #2
0
void js_client_init(duk_context *ctx) {
   slog(DEBUG,DEBUG,"Constructing cloud object");
  
#ifndef WITH_SEADUK 
   duv_ref_setup(ctx);
#endif

   duk_push_c_function(ctx, js_client_ctor, 5 );

   /* Push Client.prototype object. */
   duk_push_object(ctx);

   duk_put_function_list(ctx, -1, clientMethods);
   duk_put_prop_string(ctx, -2, "prototype");
   /* Finally, register Client to the global object */
   duk_put_global_string(ctx, "CloudClient");  /* -> stack: [ ] */
}