diff --git a/Lib/javascript/v8/javascriptruntime.swg b/Lib/javascript/v8/javascriptruntime.swg index 3ccbbd5b7..ea11b0837 100644 --- a/Lib/javascript/v8/javascriptruntime.swg +++ b/Lib/javascript/v8/javascriptruntime.swg @@ -6,9 +6,10 @@ // V8 Version Macro // ---------------- // v8 does not (until now) provide a version macro - which is still discussed and may come soon. -// Until then, we set a default version which can be overridden via command line or via a define in -// the SWIG configuration. -// For example, `swig -javascript -v8 -DV8_VERSION=0x031110` +// Until then, we set a default version which can be overridden via command line using V8_VERSION: +// swig -javascript -v8 -DV8_VERSION=0x031110 +// Or code in the interface file using SWIG_V8_VERSION: +// %begin %{#define SWIG_V8_VERSION 0x031110%} %define %swig_v8_define_version(version) %insert("runtime") %{ diff --git a/Source/Modules/javascript.cxx b/Source/Modules/javascript.cxx index 5ec42c9c6..93c21645f 100644 --- a/Source/Modules/javascript.cxx +++ b/Source/Modules/javascript.cxx @@ -1559,6 +1559,8 @@ int JSCEmitter::initialize(Node *n) { Swig_register_filebyname("runtime", f_runtime); Swig_register_filebyname("init", f_init); + Swig_banner(f_wrap_cpp); + return SWIG_OK; } @@ -1566,9 +1568,6 @@ int JSCEmitter::dump(Node *n) { /* Get the module name */ String *module = Getattr(n, "name"); - // write the SWIG banner - Swig_banner(f_wrap_cpp); - Template initializer_define(getTemplate("js_initializer_define")); initializer_define.replace("$jsname", module).pretty_print(f_header); @@ -1890,6 +1889,8 @@ int V8Emitter::initialize(Node *n) { state.globals(FORCE_CPP, NewString("1")); + Swig_banner(f_wrap_cpp); + return SWIG_OK; } @@ -1897,9 +1898,6 @@ int V8Emitter::dump(Node *n) { /* Get the module name */ String *module = Getattr(n, "name"); - // write the SWIG banner - Swig_banner(f_wrap_cpp); - Template initializer_define(getTemplate("js_initializer_define")); initializer_define.replace("$jsname", module).pretty_print(f_header);