summaryrefslogtreecommitdiff
path: root/Lib/javascript
Commit message (Collapse)AuthorAgeFilesLines
* Allow using snprintf() instead of sprintf() in wrappersOlly Betts2023-04-272-2/+2
| | | | | | | | | | | | | | | | | | | We aim to produce code that works with C90 or C++98 so we can't assume snprintf() is available, but it almost always is (even on systems from before it was standardised) so having a way to use it is helpful. Enable this automatically if the compiler claims conformance with at least C90 or C++98 and check SWIG_HAVE_SNPRINTF to allow turning on manually, but disable if SWIG_NO_SNPRINTF if defined. The fallback is to call sprintf() without a buffer size check - checking after the call is really shutting the stable door after the horse has bolted, and most of our uses either have a fixed maximum possible size or dynamically allocate a buffer that's large enough. Fixes: #2502 (sprintf deprecation warnings on macos) Fixes: #2548
* Merge branch 'fix-cast'William S Fulton2022-10-141-2/+2
|\ | | | | | | | | | | | | | | | | * fix-cast: add tests for new casting behavior skip tests when value is out of range refactor integers JS testcase to avoid repeating code Return uint64_t as double if is bigger than uint32_t Use SWIG_TypeCast in SWIG_V8_ConvertInstancePtr if types don't match (#3)
| * Merge branch 'fix-cast' into masterSergio Garcia Murillo2021-11-2912-228/+151
| |\
| * | Return uint64_t as double if is bigger than uint32_tSergio Garcia Murillo2021-11-291-2/+2
| | |
| * | Use SWIG_TypeCast in SWIG_V8_ConvertInstancePtr if types don't match (#3)Sergio Garcia Murillo2021-03-051-1/+5
| | | | | | | | | Use SWIG_TypeCast in SWIG_V8_ConvertInstancePtr if types don't match
* | | Javascript v8 object to string exceptions improvementWilliam S Fulton2022-09-191-1/+1
| | |
* | | Javascript, Octave, R - Improve exceptions for %catchesWilliam S Fulton2022-09-194-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | and exception specifications for native types. Now the raised exception contains the string value as the exception message instead of just the C/C++ type of the exception. R exceptions were completely swallowed beforehand
* | | Add missing typecheck typemaps for std::auto_ptr and std::unique_ptrWilliam S Fulton2022-09-174-0/+24
| | | | | | | | | | | | To fix overloading when using these types.
* | | Provide SWIGTYPE MOVE typemaps in swigmove.iWilliam S Fulton2022-09-162-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For implementing full move semantics when passing parameters by value. Based on SWIGTYPE && and std::unique_ptr typemaps which implement move semantics. Added for all languages, but untested for: Go, Ocaml, R, Scilab (and unlikely to be fully functional for same reasons as for std::unique_ptr support). Issue #999
* | | Add Javascript support for std::unique_ptr and std::auto_ptrWilliam S Fulton2022-08-046-4/+150
| | | | | | | | | | | | Equivalent to Ruby/Python implementations.
* | | Correct warning message for wchar_t * typemapsWilliam S Fulton2022-05-061-0/+2
| | | | | | | | | | | | | | | Use separate warning for char * and wchar_t * typemaps SWIGWARN_TYPEMAP_CHARLEAK_MSG and SWIGWARN_TYPEMAP_WCHARLEAK_MSG
* | | [Javascript] Fix handling of functions which take void*Olly Betts2022-03-072-2/+2
| | | | | | | | | | | | Fixes #682
* | | Fix typos in docs and commentsOlly Betts2022-02-272-2/+2
| | |
* | | [js] Remove code to handle v8 < 5.0Olly Betts2021-12-026-413/+10
| | | | | | | | | | | | | | | We require at least node v6 which means v8 5.0, so code to handle older v8 is no longer useful.
* | | Merge branch 'fix_SWIG_V8_VERSION'William S Fulton2021-12-011-1/+4
|\ \ \ | |_|/ |/| | | | | | | | * fix_SWIG_V8_VERSION: [javascript][v8] SWIG_V8_VERSION generation method corrected.
| * | [javascript][v8] SWIG_V8_VERSION generation method corrected.Hirokazu MORIKAWA2021-05-011-1/+4
| | | | | | | | | | | | | | | | | | "SWIG_V8_VERSION" generation method was incorrectly fixed. Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
* | | Fix mismatched new char[] and free() - JavascriptWilliam S Fulton2021-11-121-1/+1
|/ / | | | | | | | | | | | | | | Javascript - v8 and node only. When wrapping C code char arrays. Now calloc is now used instead of new char[] in SWIG_AsCharPtrAndSize. Fixes gcc-11 warning -Wmismatched-new-delete in arrays and memberin_extend testcases.
* | Merge branch 'v8-context-aware-race-free-preparation'William S Fulton2021-03-115-41/+25
|\ \ | | | | | | | | | | | | | | | | | | | | | * v8-context-aware-race-free-preparation: Lib/javascript/v8: use ::Cast instead of To* when possible. Lib/javascript/v8/javascriptrun.swg: clean up pre-processor conditions. Lib/javascript/jsc/javascriptinit.swg: shortcut JSGlobalContextRef casts. Examples/test-suite/grouping.i: resolve compiler warning.
| * | Lib/javascript/v8: use ::Cast instead of To* when possible.Andy Polyakov2021-03-102-5/+5
| | | | | | | | | | | | | | | If type is checked with Is*, it's safe to use corresponding ::Cast, which is more optimal.
| * | Lib/javascript/v8/javascriptrun.swg: clean up pre-processor conditions.Andy Polyakov2021-03-103-25/+14
| | | | | | | | | | | | | | | Harmonize javascriptcode.swg javascripthelpers.swg and clarify documentation.
| * | Lib/javascript/jsc/javascriptinit.swg: shortcut JSGlobalContextRef casts.Andy Polyakov2021-03-101-11/+6
| | |
* | | Add Javascript (JSC) support for type conversionWilliam S Fulton2021-03-112-16/+15
| | | | | | | | | | | | | | | Fix types_directive testcase to ensure the %types code is actually called and not just cast from one type to the other.
* | | Javascript type conversion supportWilliam S Fulton2021-03-112-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Add testcase for previous commit. Add missing assert for future type conversions support that will use the heap instead of pointer casts (for smart pointer type conversions). Closes #1963
* | | Use SWIG_TypeCast in SWIG_V8_ConvertInstancePtr if types don't match (#3)Sergio Garcia Murillo2021-03-101-1/+5
|/ / | | | | | | Use SWIG_TypeCast in SWIG_V8_ConvertInstancePtr if types don't match
* | Merge branch 'array_fix'William S Fulton2021-03-064-145/+77
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * array_fix: add javascript_arays.i fix to changes file Convert javascript_arrays.i example into testcase Update .gitignore for java doxygen output Javascript code formatting corrections Fix Javascript arrays for modern node versions Fix for new SWIGV8_ARRAY_NEW definition Proper array typemaps in Javascript
| * | Javascript code formatting correctionsWilliam S Fulton2021-03-032-21/+15
| | |
| * | Fix Javascript arrays for modern node versionsWilliam S Fulton2021-03-031-2/+2
| | |
| * | Fix for new SWIGV8_ARRAY_NEW definitionWilliam S Fulton2021-03-031-1/+1
| | |
| * | Merge branch 'master' into array_fixWilliam S Fulton2021-03-0324-165/+483
| |\ \ | | |/
| * | Proper array typemaps in JavascriptNickolay Shmyrev2017-01-143-124/+62
| | | | | | | | | | | | https://github.com/swig/swig/issues/865
* | | Merge pull request #1957 from dot-asm/v8-context-awareWilliam S Fulton2021-03-054-26/+32
|\ \ \ | |_|/ |/| | Lib/javascript/v8: use context-aware initialization.
| * | Lib/javascript/v8: use context-aware initialization.Andy Polyakov2021-03-023-25/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | Context-aware initialization allows to instantiate add-ons multiple times, most importantly in multiple Workers' contexts. Workers made first appearance in v10.5. Context-aware initialization was option earlier than that, even before supported minimum v6.x, yet condition is chosen more conservatively as NODE_MODULE_VERSION >= 64, a.k.a. v10.0.
| * | Lib/javascript/v8/javascriptrun.swg: minor versioning cleanup.Andy Polyakov2021-03-021-1/+1
| | | | | | | | | | | | || (SWIG_V8_VERSION < 0x0704) is better handled in SWIGV8_MAYBE_CHECK.
* | | Merge branch 'vaughamhong-master'William S Fulton2021-03-031-6/+56
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | * vaughamhong-master: fixed build error - ISO C90 forbids mixed declarations and code for jsc touch to kickoff another build - from accidental close pull request Implemented SetModule / GetModule for JSC to allow type sharing across modules - with fix for passing NULL to non-pointer argument Implemented SetModule / GetModule for JSC to allow type sharing across modules
| * | fixed build error - ISO C90 forbids mixed declarations and code for jscVaugham Hong2015-12-311-15/+34
| | |
| * | touch to kickoff another build - from accidental close pull requestVaugham Hong2015-12-311-1/+1
| | |
| * | Implemented SetModule / GetModule for JSC to allow type sharing across ↵Vaugham Hong2015-12-311-1/+1
| | | | | | | | | | | | modules - with fix for passing NULL to non-pointer argument
| * | Implemented SetModule / GetModule for JSC to allow type sharing across modulesVaugham Hong2015-12-281-6/+37
| | |
* | | Add table of v8/node versionsWilliam S Fulton2021-03-011-0/+1
| | |
* | | OUTPUT typemaps on methods that don't return voidWilliam S Fulton2021-03-011-0/+26
| | | | | | | | | | | | | | | | | | | | | SWIGJSC_ValueIsArray could be implemented by JSValueIsArray in later versions of Javascript webkit, similar fix to previous commits for v8. Enhance testing of OUTPUT typemaps to test more than one output.
* | | Merge branch 'js-fix-626'William S Fulton2021-02-281-2/+4
|\ \ \ | | | | | | | | | | | | | | | | * js-fix-626: Added check to prevent crash on illegal constructor call
| * | | Added check to prevent crash on illegal constructor callPatrick Schneider2017-04-131-2/+4
| | |/ | |/| | | | | | | Constructors not called as part of object instantiation (using "new" or via inheritance) will not crash the VM anymore.
* | | Modify SWIGV8_AppendOutput to work with newer versions of nodeWilliam S Fulton2021-02-281-13/+5
| | |
* | | Fix SWIGV8_AppendOutput for OUTPUT typemapsOlegs Jeremejevs2021-02-281-0/+8
| | | | | | | | | | | | | | | | | | | | | Create array to append to if the existing return type is not void. Closes #405 Closes #1121
* | | Cosmetic whitespaceWilliam S Fulton2021-02-281-1/+1
| | |
* | | Restore complex number support for ancient v8 versionsWilliam S Fulton2021-02-272-12/+16
| | |
* | | Fixes for node v12.0-12.5William S Fulton2021-02-273-11/+9
| | |
* | | -Wunused-result fixes for Node < 12William S Fulton2021-02-274-7/+12
| | | | | | | | | | | | | | | Fix 0533fc26c which adds in calls to Check(), which was added in Node 12. Also fix e6315eedd which calls the new Set() and Check() method.
* | | Use SWIGV8_INTEGER_NEW_UNS always for unsigned long longWilliam S Fulton2021-02-261-2/+1
| | |
* | | Use SWIGV8_INTEGER_NEW_UNS always for unsigned valuesSergio Garcia Murillo2021-02-261-2/+1
| | |