Skip to content

[TD] Add jsg::JsFunction#4891

Merged
jasnell merged 1 commit intomainfrom
jasnell/add-jsfunction
Aug 27, 2025
Merged

[TD] Add jsg::JsFunction#4891
jasnell merged 1 commit intomainfrom
jasnell/add-jsfunction

Conversation

@jasnell
Copy link
Copy Markdown
Collaborator

@jasnell jasnell commented Aug 25, 2025

Scratching a long-time itch. Not to be confused with jsg::Function, which is a type-safe wrapper around a JS function that passes arguments and return values through the JSG type wrapper layer, the JsFunction is a thin wrapper around a v8::Function that aligns with jsg::JsValue and friends. This can be used to replace direct uses of v8::Function to simplify calling functions and handling the check(...) for error handling.

(TD == Technical Debt... this probably doesn't strictly qualify but it's something that's been on my backlog for many many months... there are a number of places throughout the code that can be updated to use this to simplify function call sites)

@jasnell jasnell requested review from a team as code owners August 25, 2025 19:43
@jasnell jasnell force-pushed the jasnell/add-jsfunction branch from f22f763 to 937f71c Compare August 25, 2025 20:08
@jasnell jasnell requested review from a team and anonrig August 25, 2025 20:14
Scratching a long-time itch. Not to be confused with jsg::Function,
which is a type-safe wrapper around a JS function that passes
arguments and return values through the JSG type wrapper layer,
the JsFunction is a thin wrapper around a v8::Function that
aligns with jsg::JsValue and friends. This can be used to replace
direct uses of v8::Function to simplify calling functions and
handling the check(...) for error handling.
@jasnell jasnell force-pushed the jasnell/add-jsfunction branch from 937f71c to d8019c9 Compare August 25, 2025 20:41
@jasnell

This comment was marked as resolved.

@jasnell jasnell added the jsg label Aug 25, 2025
@jasnell jasnell merged commit 8c37321 into main Aug 27, 2025
22 checks passed
@jasnell jasnell deleted the jasnell/add-jsfunction branch August 27, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants