Dev Checkpoint 201906252210
This commit is contained in:
parent
e7993dca97
commit
2c2e638d89
4 changed files with 21 additions and 9 deletions
|
|
@ -1,7 +1,13 @@
|
|||
/* File : example.i */
|
||||
%module example
|
||||
|
||||
// placeholder() used to help SWIG generate "SWIG_From_int" call
|
||||
%{
|
||||
int placeholder();
|
||||
%}
|
||||
int placeholder() { return 0; }
|
||||
|
||||
// actual demo code
|
||||
%wrapper
|
||||
%{
|
||||
#ifdef SWIG_V8_VERSION /* Engine: Node || V8 */
|
||||
|
|
@ -38,4 +44,4 @@
|
|||
%}
|
||||
|
||||
|
||||
%native(num_to_string) void JavaScript_exampleV8_callback_function();
|
||||
%native(magicNumber) void JavaScript_do_work();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
var example = require("example");
|
||||
|
||||
function callback(msg) { console.log(msg); }
|
||||
|
||||
example.num_to_string(callback);
|
||||
console.info("My magic number is: ", example.magicNumber());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue