Commit Graph

18 Commits

Author SHA1 Message Date
William S Fulton 28d92ed341 [JavaScript] Fix the v8 and node engines for v8 14.x (Node.js 26)
v8 14.1 added an EmbedderDataTypeTag to the v8::Object aligned internal field
pointer accessors and 14.2 removed the versions without one, so the generated
code did not compile with Node.js 26. The new SWIGV8_ALIGNED_POINTER_GET and
SWIGV8_ALIGNED_POINTER_SET macros select between them, switching at 14.2 as
14.1 only has the tagged setter.

The default tag is used rather than a SWIG specific one. The tag used when
setting must match the tag used when getting, and modules pass proxy objects
between each other, so a SWIG specific tag would stop a module wrapped by an
older SWIG being read by one wrapped by a newer SWIG.

v8 14.3 similarly added a type tag to v8::External and deprecated the versions
without one, which is fatal as the examples are compiled with -Werror.
SWIGV8_EXTERNAL_NEW now selects between them and the new SWIGV8_EXTERNAL_VALUE
macro does the same for reading the value back.

Node.js 26 is added to the CI test matrix for both the node and napi engines.

The minimum supported v8 version is unchanged at 7.4.

Assisted-by: Claude Code (Opus 5)
2026-08-01 09:42:44 +01:00
Olly Betts 7c97bd5ab3 [js] Remove code to handle v8 < 5.0
We require at least node v6 which means v8 5.0, so code to handle
older v8 is no longer useful.
2021-12-02 14:04:25 +13:00
Andy Polyakov b0c01ea851 Lib/javascript/v8: use context-aware initialization.
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.
2021-03-02 15:31:28 +01:00
Yegor Yefremov 26fc996ad6 Replace Handle with Local depending on Node.js version
Use newly introduced macros like SWIGV8_VALUE to use v8::Handle or
v8::Local depending on the selected Node.js version where possible.
2020-04-07 14:13:12 +02:00
William S Fulton 4f7106cda2 Merge branch 'js-v8-52-tests'
* js-v8-52-tests:
  fixed nvm
  node tests: use provided version if present
  travis tests for different node versions
  fix travis tests
  Test NodeJS 4, 6, 8, and 10
  Remove warnings on Node 6.x aka V8 5.0 and 5.1
  Add Node 7.x aka V8 5.2+ support
2018-08-02 07:10:55 +01:00
William S Fulton 1f7689fa8f Javascript assert.h - move to header section
Fixes compile problem due to throw macro skullduggery in the director_throws testcase
2018-05-06 23:10:33 +01:00
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
Richard 00457b6599 Making generated code more readable 2014-09-30 12:33:49 -03: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 8829230641 Fixes for v8 3.17.10 (0x031710) 2014-08-28 19:46:49 -05:00
William S Fulton 3191473523 Fix compiler warnings in generated code when using -std=c++98 -std=gnu89 -pedantic -Wreturn-type 2014-05-24 14:13:19 +01: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
Eric Wing 4503c53903 Since this code uses assert, #include <assert.h> is needed. 2013-08-31 03:46:07 +02:00
Oliver Buchtala 868803ce2a Merge replayed as done by c778d16abed35829b103d607a53c8f88e3b2d595 2013-08-31 03:44:44 +02: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 35e6b73d2a Add swig configuration files for v8.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/oliverb-javascript-v8@13765 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2012-09-08 00:57:42 +00:00