Skip to content

[V8] Define trait ToValue for primitive types#2946

Merged
Centril merged 2 commits into
masterfrom
centril/to-value-v8
Jul 16, 2025
Merged

[V8] Define trait ToValue for primitive types#2946
Centril merged 2 commits into
masterfrom
centril/to-value-v8

Conversation

@Centril
Copy link
Copy Markdown
Contributor

@Centril Centril commented Jul 16, 2025

Description of Changes

Define a trait ToValue for all primitive types:

trait ToValue {
    fn to_value<'s>(&self, scope: &mut HandleScope<'s>) -> Local<'s, Value>;
}

The original code contained more macro logic which has been simplified in favor of functions.
Comments have also been added.

API and ABI breaking changes

None

Expected complexity level and risk

1

Testing

The next PR with a trait FromValue will add proptests for roundtrips.

@Centril Centril force-pushed the centril/to-value-v8 branch from 9e56930 to e5de872 Compare July 16, 2025 19:22
@Centril Centril enabled auto-merge July 16, 2025 19:45
@Centril Centril added this pull request to the merge queue Jul 16, 2025
Merged via the queue into master with commit 96a1ad4 Jul 16, 2025
20 checks passed
@Centril Centril deleted the centril/to-value-v8 branch July 17, 2025 05:32
mamcx pushed a commit that referenced this pull request Aug 26, 2025
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