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
This commit is contained in:
parent
e888d7a892
commit
4bcfca05dd
1 changed files with 8 additions and 5 deletions
|
|
@ -46,7 +46,8 @@ v8::Persistent<v8::FunctionTemplate> SWIGV8_$CLASSNAME;
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
- it is very important to consider namespaces from the beginning.
|
- 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
|
- namespaces do not need a function template, as they will not be
|
||||||
instantiated
|
instantiated
|
||||||
|
|
||||||
|
|
@ -84,7 +85,8 @@ v8::Handle<v8::Value> $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
|
- `$ARGS`: arguments should be declared at the beginning and checked and set in the
|
||||||
input typemap block
|
input typemap block
|
||||||
|
|
||||||
|
|
@ -189,7 +191,8 @@ in the according parent contexts.
|
||||||
SWIGV8_$CLASSNAME = SWIGV8_CreateClassTemplate("$LOCAL_CLASSNAME" , $CLASSNAME_new);
|
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
|
## Add Member Function
|
||||||
|
|
||||||
|
|
@ -198,8 +201,8 @@ in the according parent contexts.
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
- `METHODNAME`: the name of the function as in C++
|
- `METHODNAME`: the name of the function as in C++
|
||||||
- `METHOD_WRAPPER`: the name of the generated wrapper function
|
- `METHOD_WRAPPER`: the name of the generated wrapper function, which
|
||||||
TODO: specify different versions
|
should have the form `wrap_<mangled_classname>_<method_name>`
|
||||||
|
|
||||||
## Add Property
|
## Add Property
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue