summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2016-01-12 09:33:13 +1300
committerOlly Betts <olly@survex.com>2016-01-12 09:33:13 +1300
commitb3bedc210c723b29314688a87385797f7888fad3 (patch)
treefa22119445e050bac09d8bc449236be34961f90b /Doc
parent8b9a6d3c24cd6004f3114a27db395433f2f1ed4f (diff)
downloadswig-b3bedc210c723b29314688a87385797f7888fad3.tar.gz
[Javascript] For v8 >= 4.3.0, use V8_MAJOR_VERSION.
Fixes https://github.com/swig/swig/issues/561.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Manual/Javascript.html13
1 files changed, 12 insertions, 1 deletions
diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html
index 56f83b763..405583b4f 100644
--- a/Doc/Manual/Javascript.html
+++ b/Doc/Manual/Javascript.html
@@ -90,11 +90,22 @@ $ swig -javascript -jsc example.i</pre>
$ swig -c++ -javascript -jsc example.i</pre>
</div>
<p>The V8 code that SWIG generates should work with most versions from 3.11.10 up to 3.29.14 and later.</p>
-<p>Specify the V8 version when running SWIG (e.g. 3.25.30)</p>
+<p>The API headers for V8 &gt;= 4.3.0 define constants which SWIG can use to
+determine the V8 version it is compiling for. For versions &lt; 4.3.0, you
+need to specify the V8 version when running SWIG. This is specified as a hex
+constant, but the constant is read as pairs of decimal digits, so for V8
+3.25.30 use constant 0x032530. This scheme can't represent components &gt; 99,
+but this constant is only useful for V8 &lt; 4.3.0, and no V8 versions from
+that era had a component &gt; 99. For example:</p>
<div class="shell">
<pre>
$ swig -c++ -javascript -v8 -DV8_VERSION=0x032530 example.i</pre>
</div>
+<p>If you're targetting V8 &gt;= 4.3.0, you would just run swig like so:<p>
+<div class="shell">
+<pre>
+$ swig -c++ -javascript -v8 example.i</pre>
+</div>
<p>This creates a C/C++ source file <code>example_wrap.c</code> or <code>example_wrap.cxx</code>. The generated C source file contains the low-level wrappers that need to be compiled and linked with the rest of your C/C++ application to create an extension module.</p>
<p>The name of the wrapper file is derived from the name of the input file. For example, if the input file is <code>example.i</code>, the name of the wrapper file is <code>example_wrap.c</code>. To change this, you can use the -o option. The wrapped module will export one function which must be called to register the module with the Javascript interpreter. For example, if your module is named <code>example</code> the corresponding initializer for JavascriptCore would be</p>
<div class="code">