Skip to content

Fix nan_weak.h for V8 >= 14.2.194 (missing EmbedderDataTypeTag)#1013

Merged
kkoopa merged 1 commit intonodejs:mainfrom
gdavidkov:fix/nan-weak-v8-14.2-embedder-tag
Mar 18, 2026
Merged

Fix nan_weak.h for V8 >= 14.2.194 (missing EmbedderDataTypeTag)#1013
kkoopa merged 1 commit intonodejs:mainfrom
gdavidkov:fix/nan-weak-v8-14.2-embedder-tag

Conversation

@gdavidkov
Copy link
Contributor

@gdavidkov gdavidkov commented Mar 18, 2026

Summary

  • Commit fcc7b7d added V8 >= 14.2.194 compatibility guards to nan.h for GetAlignedPointerFromInternalField and SetAlignedPointerInInternalField (which now require an additional v8::kEmbedderDataTypeTagDefault tag parameter), but missed the same unguarded calls in nan_weak.h
  • This causes build failures with Electron 41+ / V8 >= 14.2.194:
    error C2661: 'v8::Object::GetAlignedPointerFromInternalField': no overloaded function takes 1 arguments
    error C2660: 'v8::Object::SetAlignedPointerInInternalField': function does not take 2 arguments
    
  • Applies the exact same preprocessor guard pattern from nan.h to the two call sites in nan_weak.h (inside the V8 >= 4.3 block, which is the only block compiled with V8 14.2+)

Test plan

  • Build a native addon using NAN against Electron 41+ (V8 >= 14.2.194) and verify no compilation errors
  • Verify existing builds against older V8 versions are unaffected (the # else branches preserve the original calls)

Commit fcc7b7d added V8 >= 14.2.194 compatibility guards to nan.h for
GetAlignedPointerFromInternalField and SetAlignedPointerInInternalField
which now require an additional v8::kEmbedderDataTypeTagDefault tag
parameter. However, the same unguarded calls in nan_weak.h were missed,
causing build failures with Electron 41+ / V8 >= 14.2.194.

Apply the exact same preprocessor guard pattern to all occurrences in
nan_weak.h.
@kkoopa kkoopa merged commit 794124c into nodejs:main Mar 18, 2026
17 checks passed
@kkoopa
Copy link
Collaborator

kkoopa commented Mar 18, 2026

Thank you, I shall get this out right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants