[beast/ebeast: 10/24] V8: export bse.server object



commit b795c78008a9c31b819ff73b882b20d7806f7607
Author: Tim Janik <timj gnu org>
Date:   Sat Feb 18 02:01:50 2017 +0100

    V8: export bse.server object
    
    Signed-off-by: Tim Janik <timj gnu org>

 ebeast/v8bse/nodemodule.cc |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/ebeast/v8bse/nodemodule.cc b/ebeast/v8bse/nodemodule.cc
index 1a3aff0..5e31477 100644
--- a/ebeast/v8bse/nodemodule.cc
+++ b/ebeast/v8bse/nodemodule.cc
@@ -52,6 +52,12 @@ v8bse_register_module (v8::Local<v8::Object> exports)
   v8::Local<v8::Object> module_instance = bse_v8stub->module_.new_instance();
   v8::Maybe<bool> ok = exports->SetPrototype (context, module_instance);
   assert (ok.FromJust() == true);
+
+  // export server handle
+  V8ppType_BseServer &class_ = bse_v8stub->BseServer_class_;
+  v8::Local<v8::Object> v8_server = class_.import_external (isolate, new Bse::ServerH (bse_server));
+  module_instance->DefineOwnProperty (context, v8pp::to_v8 (isolate, "server"),
+                                      v8_server, v8::PropertyAttribute (v8::ReadOnly | v8::DontDelete));
 }
 
 // node.js registration


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]