Activate SwigModuleInitializer for in v8 emitter.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13798 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Oliver Buchtala 2012-09-08 01:08:33 +00:00
commit 21bdb78f1c
2 changed files with 21 additions and 13 deletions

View file

@ -107,6 +107,8 @@ extern "C" {
void $jsname_initialize(v8::Handle<v8::Context> context) void $jsname_initialize(v8::Handle<v8::Context> context)
{ {
SWIG_InitializeModule(0);
v8::HandleScope scope; v8::HandleScope scope;
v8::Local<v8::Object> global = context->Global(); v8::Local<v8::Object> global = context->Global();

View file

@ -1575,19 +1575,23 @@ protected:
private: private:
File *f_runtime; /* built-in parts */
File *f_header; String *f_runtime;
File *f_class_templates; String *f_header;
File *f_init; String *f_init;
File *f_init_namespaces; /* part for class templates */
File *f_init_class_templates; String *f_class_templates;
File *f_init_wrappers;
File *f_init_inheritance; /* parts for initilizer */
File *f_init_class_instances; String *f_init_namespaces;
File *f_init_static_wrappers; String *f_init_class_templates;
File *f_init_register_classes; String *f_init_wrappers;
File *f_init_register_namespaces; String *f_init_inheritance;
String *f_init_class_instances;
String *f_init_static_wrappers;
String *f_init_register_classes;
String *f_init_register_namespaces;
// the output cpp file // the output cpp file
File *f_wrap_cpp; File *f_wrap_cpp;
@ -1672,7 +1676,9 @@ int V8Emitter::dump(Node *n)
.replace(V8_STATIC_WRAPPERS, f_init_static_wrappers) .replace(V8_STATIC_WRAPPERS, f_init_static_wrappers)
.replace(V8_REGISTER_CLASSES, f_init_register_classes) .replace(V8_REGISTER_CLASSES, f_init_register_classes)
.replace(V8_REGISTER_NS, f_init_register_namespaces) .replace(V8_REGISTER_NS, f_init_register_namespaces)
.pretty_print(f_wrap_cpp); .pretty_print(f_init);
Printv(f_wrap_cpp, f_init, 0);
return SWIG_OK; return SWIG_OK;
} }