Commit graph

2,733 commits

Author SHA1 Message Date
William S Fulton
0431664b18 Guile OUTPUT typemap fix
Fixes 'attempt to free a non-heap object' in some OUTPUT typemaps.
2013-09-15 10:43:49 +01:00
Vladimir Menshakov
325b5445d6 removed Clear before Dispose from newer v8 code, consider the following code:
template <class T>
void Persistent<T>::Dispose() {
  if (this->IsEmpty()) return; //Clear will trigger this
  V8::DisposeGlobal(reinterpret_cast<internal::Object**>(this->val_));
  ...
}
2013-09-14 16:19:47 +04:00
Vladimir Menshakov
89fd7ed9c1 fixed newer v8 compilation 2013-09-14 16:17:21 +04:00
Sylvestre Ledru
7a88729c87 Remove trailing spaces in the generated code.
No functional changes
2013-09-13 10:02:39 +02:00
Artem Serebriyskiy
c3f3880d0c Lua static member access improvements.
1) Static members and static functions inside class can be accessed as ModuleName.ClassName.FunctionName (MemberName respectively). Old way aka ModuleName.ClassName_FunctionName still works.
2) Same goes for enums inside classes: ModuleName.ClassName.EnumValue1 etc.
3) More 'runme' tests for lua + modifications to existing tests to test new changes.

Code is loosely based upon python implemenation of the same thing.

Patch #62.
2013-09-12 21:32:26 +01:00
William S Fulton
a91cd0bc5c Infinity is now by default an acceptable value for type 'float'.
This fix makes the handling of type 'float' and 'double' the same. The implementation requires the
C99 isfinite() macro, or otherwise some platform dependent equivalents, to be available.
2013-09-12 07:28:12 +01:00
Oliver Buchtala
477b2393b1 Add stub 'typemaps.i' files. 2013-09-12 05:26:22 +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
001f38c6a9 Fix settings for building nodejs tests.
Removed the `-node` command line flag.
Instead one has to use `-v8 -DBUILDING_NODE_EXTENSION=1`.
2013-09-10 13:29:16 +03:00
Oliver Buchtala
be35d94fdb Add support for PackedData to Javascript generator. 2013-09-10 11:53:12 +03:00
Oliver Buchtala
571c516a0b Some fixes for the Javascript generator.
- added missing `exception.i`
- added missing generator block `wrappers` for v8
2013-09-09 22:25:51 +03:00
Oliver Buchtala
407d8ef5ac Clean up in javascripttypemaps.swg.
- following the same layout/order as pytypemaps
- added typemaps for `long long` and `unsigned long long`, which are
  only copies of those for `long` and `unsigned long` and hence are
  just experimental.
2013-09-09 17:34:53 +03:00
Oliver Buchtala
fc4d9b665c Fix v8 generator to use a non clashing name for built-in 'equals' method. 2013-09-09 16:28:29 +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
Oliver Buchtala
740da9c733 Merge pull request #17 from whoozle/devel
fixed v8-3.20+ compilation and deprecation warnings.
2013-09-04 09:18:42 -07:00
Vladimir Menshakov
2a39abebb6 moved common swig v8 definitions in javascriptruntime.swg, fixed obsoleted api calls 2013-09-04 20:10:42 +04:00
Oliver Buchtala
315287b656 Put the SWIG_V8_VERSION macro into "runtime" block. 2013-09-04 17:55:44 +02:00
Oliver Buchtala
4068f31c6b Use a diffent name for the V8_VERSION provided via command line. 2013-09-04 17:54:35 +02:00
Vladimir Menshakov
b7db2a84c9 fixed return values and added missing newer v8 dtor wrapper. 2013-09-04 19:33:48 +04:00
Oliver Buchtala
8778146b4b Relax type check in SWIG_AsVal_int.
The array_member test-case revealed that integers
come in as `Numbers`.
2013-09-04 12:10:08 +02:00
Oliver Buchtala
cef82c720f Replace old style v8 version switches. 2013-09-03 14:41:35 +02:00
Oliver Buchtala
d3074ba4c1 Fix error in SWIG_V8_GetInstancePtr. 2013-09-03 14:02:52 +02:00
Kota Iguchi
f70c0e16f2 Add "equals" to compare between pointers
Add "getCPtr" to retrieve pointer value
2013-09-03 13:58:22 +02:00
Kota Iguchi
a29975c69a Typemap for natural support for arrays 2013-09-03 13:58:09 +02:00
Kota Iguchi
78a3cc9e3e Added the finalize callback (JSObjectFinalizeCallback) 2013-09-03 13:49:36 +02: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
4503c53903 Since this code uses assert, #include <assert.h> is needed. 2013-08-31 03:46:07 +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
Vladimir Menshakov
3af7d543cb fixed crash while instantiating generic-wrapped objects from external code, please review 2013-08-31 03:46:06 +02:00
Vladimir Menshakov
9e74bdb97e added virtual dtor to V8ErrorHandler 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
9b6a4870dd added missing scope.Close() 2013-08-31 03:34:39 +02:00
Vladimir Menshakov
fe25e2dfc8 replaced GetInternalField with GetAlignedPointer (it does not work with SetAlignedPointer, btw) 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
827cef75a3 Add an ifndef-guard to resolve a warning when building nodejs extension. 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