From faab78439cc37ae056f2535d08c6e871ec1ea5cd Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Mon, 31 Mar 2014 03:09:43 +0200 Subject: [PATCH] Updated Javascript documentation. Added note about v8 being c++ only. --- Doc/Manual/Javascript.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Doc/Manual/Javascript.html b/Doc/Manual/Javascript.html index d088aadfb..7acf37fe3 100644 --- a/Doc/Manual/Javascript.html +++ b/Doc/Manual/Javascript.html @@ -45,6 +45,9 @@ bool example_initialize(JSGlobalContextRef context, JSObjectRef *exports)
 void example_initialize (v8::Handle exports)
+
+

Note: be aware that v8 comes as a C++ API, and thus, the generated modules must be compiled as C++.

+

Running Tests and Examples

The configuration for tests and examples currently supports Linux and Mac only, MinGW not yet.

The default interpreter is node.js as it is available on all platforms and convenient to use.

@@ -91,13 +94,14 @@ $ make SMOKE=1 ENGINE=jsc check-javascript-test-suite - Windows 7 64bit (VS 2010) - Node.js -

Note: a CMake based configuration can be found in the cmake branch on which can be used to generate a Visual Studio solution. It is rather limited building only the SWIG executable and Javascript examples.

+
+

Note: a CMake based configuration can be found in the cmake which can be used to generate a VisualStudio solution. It is rather limited and can only be used for building the SWIG executable.

+

Future work

The Javascript module is not yet as mature as other modules and some things are still missing. As it makes use of Swigs Unified typemap library (UTL), many typemaps are inherited. We could work on that if requested:

Integration

This chapter gives a short introduction how to use a native Javascript extension: as a node.js module, and as an extension for an embedded Webkit.

@@ -113,7 +117,7 @@ $ sudo apt-get install nodejs

You have to install it using npm:

-$ npm install -g node-gyp
+$ sudo npm install -g node-gyp

node-gyp expects a configuration file named binding.gyp which is basically in JSON format and conforms to the same format that is used with Google's build-tool gyp.

binding.gyp:

@@ -224,6 +228,10 @@ int main(int argc, char* argv[]) return 0; } +

Creating Applications with node-webkit

+
+

TODO: documentation is coming soon

+

Examples

Some basic examples are shown here in more detail.

Simple