From 4bcfca05dd0eff51c4ecfa11ed182a6bcf147dbf Mon Sep 17 00:00:00 2001 From: Oliver Buchtala Date: Sat, 8 Sep 2012 00:46:31 +0000 Subject: [PATCH] Add some implementation details to specification of v8 code generator. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13742 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- .../Javascript/V8_CodeGeneratorSpecification.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Doc/Devel/Javascript/V8_CodeGeneratorSpecification.md b/Doc/Devel/Javascript/V8_CodeGeneratorSpecification.md index 2990f1d00..b7d06e220 100644 --- a/Doc/Devel/Javascript/V8_CodeGeneratorSpecification.md +++ b/Doc/Devel/Javascript/V8_CodeGeneratorSpecification.md @@ -46,7 +46,8 @@ v8::Persistent SWIGV8_$CLASSNAME; Notes: - it is very important to consider namespaces from the beginning. - `CLASSNAME` should be fully canonical, e.g., `foo_bar_MyClass` for `foo::bar::MyClass` + `CLASSNAME` should be the mangled qualified class name, e.g., `foo_bar_MyClass` for `foo::bar::MyClass`, + which is retrieved ny `Swig_string_mangle(Getattr(n, "name"))` - namespaces do not need a function template, as they will not be instantiated @@ -84,7 +85,8 @@ v8::Handle $CLASSNAME_new(const v8::Arguments& args) { } ~~~~ -- `$CLASS_LVAL`: should be the canonical name of the class, e.g. `ns1::ns2::MyClass` +- `$CLASS_LVAL`: should be the canonical name of the class, e.g. `ns1::ns2::MyClass`, + which can be retrieved using `Getattr(n, "name")` - `$ARGS`: arguments should be declared at the beginning and checked and set in the input typemap block @@ -189,7 +191,8 @@ in the according parent contexts. SWIGV8_$CLASSNAME = SWIGV8_CreateClassTemplate("$LOCAL_CLASSNAME" , $CLASSNAME_new); ~~~~ -- `LOCAL_CLASSNAME`: the class name without context, i.e., namespaces +- `LOCAL_CLASSNAME`: the class name without context, i.e., namespaces, + which is retrieved by `Getattr(n, "sym:name")` ## Add Member Function @@ -198,8 +201,8 @@ in the according parent contexts. ~~~~ - `METHODNAME`: the name of the function as in C++ -- `METHOD_WRAPPER`: the name of the generated wrapper function - TODO: specify different versions +- `METHOD_WRAPPER`: the name of the generated wrapper function, which + should have the form `wrap__` ## Add Property