Skip to content

avm1: Add Value::from_usize_lossy and Value::from_u64_lossy#23476

Open
kjarosh wants to merge 1 commit intoruffle-rs:masterfrom
kjarosh:avm1-value-lossy
Open

avm1: Add Value::from_usize_lossy and Value::from_u64_lossy#23476
kjarosh wants to merge 1 commit intoruffle-rs:masterfrom
kjarosh:avm1-value-lossy

Conversation

@kjarosh
Copy link
Copy Markdown
Member

@kjarosh kjarosh commented Apr 17, 2026

Similarly to AVM2, the From impl for Value was not compliant with the expectations: the conversions were not always lossless.

This patch removes the impls and instead moves the conversions to Value::from_usize_lossy and Value::from_u64_lossy, which make it clear that the conversion is lossy.

@kjarosh kjarosh added A-avm1 Area: AVM1 (ActionScript 1 & 2) T-refactor Type: Refactor / Cleanup labels Apr 17, 2026
Similarly to AVM2, the From impl for Value was not compliant with the
expectations: the conversions were not always lossless.

This patch removes the impls and instead moves the conversions to
Value::from_usize_lossy and Value::from_u64_lossy, which make it clear
that the conversion is lossy.
@kjarosh kjarosh added the waiting-on-review Waiting on review from a Ruffle team member label Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-avm1 Area: AVM1 (ActionScript 1 & 2) T-refactor Type: Refactor / Cleanup waiting-on-review Waiting on review from a Ruffle team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant