Commit graph

16 commits

Author SHA1 Message Date
Oliver Buchtala
be35d94fdb Add support for PackedData to Javascript generator. 2013-09-10 11:53:12 +03:00
Oliver Buchtala
29ccb270af Renamed object provided to JS initializers.
JSC initializer create a new module object.
V8 initializer fill a provided 'exports' object.
2013-09-06 00:40:29 +03:00
Kota Iguchi
78a3cc9e3e Added the finalize callback (JSObjectFinalizeCallback) 2013-09-03 13:49:36 +02:00
Eric Wing
ed729f7d3a This brings over the memory leak fixes for pointers to structs with a %extend destructor from my Neha fork. The generator was not generating and connecting the needed code for the requested destructor to the v8 dtor finalizer.
I did not realize this branch has some JavaScriptCore stuff in it too. Unfortunately, it seems to have its own unique problems (like creating C++ files when it should be generating C files). My changes are targeted for v8, and I don't think my JSCore changes fully reach in this JSCore implementation so more work would need to be done to get this branch working. I think my Neha fork is in better shape at the moment.

Also, I did port over the 'NULL out the dtor function pointer' in the %nodefaultdtor fix to v8.

Usage case:
struct MyData {
%extend {
~MyData() {
FreeData($self);
}
}
};
%newobject CreateData;
struct MyData* CreateData(void);
%delobject FreeData;
void FreeData(struct MyData* the_data);

where the use case is something like:
var my_data = example.CreateData();
my_data = null;
2013-08-31 03:46:07 +02:00
Oliver Buchtala
2c4a90a37d Generate defines for initializer function. 2013-08-31 03:23:11 +02:00
Oliver Buchtala
fb9c4955fb Not a real change: removed some trailing spaces. 2013-08-31 03:23:11 +02:00
Oliver Buchtala
9d22644563 Rename a argument variable to avoid errors with overloaded functions. 2013-08-31 03:23:11 +02:00
Oliver Buchtala
86cb621466 Add comments to v8 code templates.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13829 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:16:42 +00:00
Oliver Buchtala
217ffb11d0 Fix regressions of latest commits.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13828 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:16:26 +00:00
Oliver Buchtala
131a106204 Improve names and comments of code templates for javascript emitters.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13826 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:15:51 +00:00
Oliver Buchtala
d13289cc91 Fix function dispatching for v8.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13812 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:12:18 +00:00
Oliver Buchtala
9b0c8dae83 Add argcount checking to functions and ctors.
Before argument counts were only checked for overloaded functions/ctors.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13791 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:06:26 +00:00
Oliver Buchtala
d5c5f7ebee Generalize ctor overloading.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13790 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:06:08 +00:00
Oliver Buchtala
8d72616e65 Refactor emitter and code templates to use defined template variables.
Also switched from "${...}" to $..., which is swig's common notation
of typemap variables.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13787 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:05:11 +00:00
Oliver Buchtala
07d5ec24ce Add support for type-based dispatching of overloaded functions.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13779 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:02:16 +00:00
Oliver Buchtala
050219d998 Merge branch 'devel' of https://github.com/Neha03/gsoc2012-javascript into devel
Conflicts:
	.project
	COPYRIGHT
	Doc/Manual/style.css
	Examples/Makefile.in
	Examples/test-suite/common.mk
	Lib/typemaps/strings.swg
	Makefile.in
	Source/DOH/fio.c
	Source/Makefile.am
	Source/Modules/emit.cxx
	Source/Modules/javascript.cxx
	configure.in

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13764 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:56:48 +00:00