Commit Graph

67 Commits

Author SHA1 Message Date
Patrick Schneider 9ce8d7e7c9 Remove warnings on Node 6.x aka V8 5.0 and 5.1
The proposed changes targetted at 5.2 (or 5.4 to be more precise, since there is no Node release with V8 5.2 or 5.3) work for lower versions as well and bust the deprecation warnings there.
2017-04-13 19:39:44 +02:00
Patrick Schneider f08d7a63a9 Add Node 7.x aka V8 5.2+ support
* Use WeakCallbackInfo instead of WeakCallbackData
* Use GetPrivate instead of GetHiddenValue
* Adopted new signature for SetWeak to support destructor calling
* SetAccessor deprecation fixed
* Proper version checks where applicable
2017-04-13 15:02:53 +02:00
Olly Betts b138f054e5 [Javascript] Fix SWIG_exception() macro (#792)
Fix SWIG_exception() macro to return from the current function.
Fixes #789, reported by Julien Dutriaux.
2016-09-17 17:29:42 +12:00
Olly Betts b3bedc210c [Javascript] For v8 >= 4.3.0, use V8_MAJOR_VERSION.
Fixes https://github.com/swig/swig/issues/561.
2016-01-12 09:33:13 +13:00
Richard 00457b6599 Making generated code more readable 2014-09-30 12:33:49 -03:00
Richard 0dfc1b090f Fix duplicate symbol linker errors for Javascript/v8 2014-09-09 10:08:30 -03:00
Richard 911fd761b0 Minor improvements 2014-08-28 19:46:52 -05:00
Richard eeb4b5497e Fixes for v8 3.24.17 (0x032417) 2014-08-28 19:46:51 -05:00
Richard fee5748499 Fixes for 3.23.18 (0x032318) 2014-08-28 19:46:51 -05:00
Richard d4920591d4 Fixes for v8 3.24.3 (0x032403) 2014-08-28 19:46:51 -05:00
Richard e0c0670540 Partially fixed for 3.25.30 (0x032530) - unfinished 2014-08-28 19:46:50 -05:00
Richard e98a659246 Fixes for v8 3.21.17 (0x032117) 2014-08-28 19:46:50 -05:00
Richard 013fb3d22d Fixes for v8 3.19.2 (0x031902) 2014-08-28 19:46:50 -05:00
Richard 8829230641 Fixes for v8 3.17.10 (0x031710) 2014-08-28 19:46:49 -05:00
William S Fulton 9587c133c5 Fix typo in Javascript exception 2014-04-19 15:55:12 +01:00
Oliver Buchtala 0528fd3ac3 Bugfix for Javascript generator. 2013-09-16 11:46:00 +02:00
Oliver Buchtala 1f07195812 Rearrange generation of init block to have custom init code within the initializer body. 2013-09-16 03:53:00 +02:00
Oliver Buchtala dd84e6f9e0 Some fixes and cleanup in Javascript generator.
- v8 generator uses the correct mangled name for class templates
- removed symbols for template variables in favor of using the string
  literals directly, as it is easier to understand when debugging.
2013-09-10 14:16:36 +03:00
Oliver Buchtala be35d94fdb Add support for PackedData to Javascript generator. 2013-09-10 11:53:12 +03:00
Oliver Buchtala 8408e9b193 Merge pull request #19 from whoozle/devel
fixed deprecation warnings for v8-3.21
2013-09-06 19:50:51 -07: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
Vladimir Menshakov b49da78b0a fixed deprecation warnings for v8-3.21 2013-09-05 19:50:15 +04:00
Vladimir Menshakov 2a39abebb6 moved common swig v8 definitions in javascriptruntime.swg, fixed obsoleted api calls 2013-09-04 20:10:42 +04:00
Vladimir Menshakov b7db2a84c9 fixed return values and added missing newer v8 dtor wrapper. 2013-09-04 19:33:48 +04:00
Oliver Buchtala 14a137adca Fix regression. 2013-09-03 06:27:14 +02:00
Oliver Buchtala a48438c562 Better v8 version handling.
You should start to specify a version on command line, e.g.,

    swig -javascript -v8 -DSWIG_V8_VERSION=0x032007
2013-09-03 05:39:37 +02:00
Vladimir Menshakov cb5f4dc47e ported to newer, more efficient v8 api 2013-08-31 05:00:32 +02:00
Oliver Buchtala 32f9cce600 Merged whoozle branch with ewmailing branch.
Conflicts:
	Lib/javascript/v8/javascriptcode.swg
2013-08-31 03:47:43 +02:00
Oliver Buchtala 306b265af9 Merge branch 'devel' of git://github.com/oliver----/swig-v8 into devel
Conflicts:
	Lib/javascript/v8/javascriptcode.swg
2013-08-31 03:47:08 +02:00
Eric Wing 65a0be8876 v8: variable name bug fix in my template modifications for pointers to structs. 2013-08-31 03:46:07 +02:00
Eric Wing f8feeacb68 v8: Removed the extern "C" around the initialize function because it makes no sense since it requires a C++ templates object as a parameter. 2013-08-31 03:46:07 +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
Eric Wing d5df0bb721 Added #if defined guard for V8_3_14 to allow users from the original SWIG v8 implementation to continue using the new changes. It works similarly to the BUILDING_NODE_EXTENSION in all but two places. This define must be explicitly set by users because there is no way to auto detect. (Perhaps a command line switch can be added to generate this on request?) 2013-08-31 03:46:06 +02:00
Jason Turner 046ca7686b Adjust for v8::Persistent API which was deprecated @ 3.19.16
https://groups.google.com/forum/#!topic/v8-users/oBE_DTpRC08
2013-08-31 03:46:06 +02:00
Jason Turner cf9b7e89ac Get memory updates working with Node.js again. 2013-08-31 03:46:06 +02:00
Oliver Buchtala 868803ce2a Merge replayed as done by c778d16abed35829b103d607a53c8f88e3b2d595 2013-08-31 03:44:44 +02:00
Vladimir Menshakov 45bfc97ef4 converted function templates to the persistent ones (fixed crash on large wrappers) 2013-08-31 03:34:39 +02:00
Vladimir Menshakov 9111773400 generate v8-3.19.x compatible code 2013-08-31 03:34:39 +02:00
Oliver Buchtala b511e33121 Remove std::iostream relicts from generated v8 wrapper code. 2013-08-31 03:34:38 +02:00
Oliver Buchtala d3aa8e06fb Bugfix: treat persistent V8 references correctly.
V8 is somewhat inconvenient regarding invoke of destructors for C++ proxies.
2013-08-31 03:34:38 +02:00
Oliver Buchtala 31feff8586 Add missing return statement in v8 code template. 2013-08-31 03:34:38 +02:00
Oliver Buchtala 31844ac72a Simplify the signature of the v8 module intializer. 2013-08-31 03:23:11 +02:00
Oliver Buchtala 008adca72f Provide more control about the target object/namespace where a v8 module is registered to. 2013-08-31 03:23:10 +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 9b06144d39 Fix handling of overloaded ctors in v8 emitter.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13827 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:16:09 +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 7c7d1cf3b9 Fix errors related to wrapping and destruction of (undefined) SWIG_TYPES.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13824 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:15:12 +00:00
Oliver Buchtala f814a8e702 Fix errors concerning object wrapping and cleanup in v8 emitter.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13819 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:14:02 +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 68f0f859f8 Fix name collision in generated v8 initializer.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13811 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 01:11:51 +00:00