Skip to content

Conversation

moulins
Copy link
Contributor

@moulins moulins commented Oct 5, 2025

  • Makes avm1::function::Executable private for better encapsulation;
  • Deduplicate and clean up some code in avm1/function.rs;
  • Replace some matches by let-elses in native methods (for shorter code).

This has no behavioral changes.

@moulins moulins changed the title avm1: Some Function refactors DRAFT: avm1: Some Function refactors Oct 7, 2025
@moulins moulins marked this pull request as draft October 7, 2025 04:25
@moulins moulins force-pushed the avm1-function-refactors branch from 1e6b6dc to e7c1f3c Compare October 7, 2025 23:19
@moulins moulins marked this pull request as ready for review October 7, 2025 23:19
@moulins moulins changed the title DRAFT: avm1: Some Function refactors avm1: Some Function refactors Oct 7, 2025
@moulins moulins added A-avm1 Area: AVM1 (ActionScript 1 & 2) T-refactor Type: Refactor / Cleanup labels Oct 7, 2025
@moulins moulins force-pushed the avm1-function-refactors branch from e7c1f3c to 0e682d3 Compare October 7, 2025 23:40
@moulins moulins added the waiting-on-review Waiting on review from a Ruffle team member label Oct 8, 2025
@moulins moulins force-pushed the avm1-function-refactors branch from 0e682d3 to bd553b9 Compare October 11, 2025 08:55
- Remove some outdated comments
- Deduplicate code for `__constructor__/constructor` property definitions
- Move (most of) `Executable::exec` to `Avm1Function::exec`
Also adds `Function::exec_constructor` for use by `super` calls.
It's slightly shorter, and cleaner.
This splits creating the raw `FunctionObject`, and
builf the actual AVM1 `Object` that contains it.
@moulins moulins force-pushed the avm1-function-refactors branch from bd553b9 to 5bc91a2 Compare October 12, 2025 10:26
@moulins moulins enabled auto-merge (rebase) October 12, 2025 10:28
@moulins moulins merged commit 531f1ac into ruffle-rs:master Oct 12, 2025
22 of 25 checks passed
@moulins moulins mentioned this pull request Oct 12, 2025
@moulins moulins deleted the avm1-function-refactors branch October 12, 2025 11:41
@Lord-McSweeney Lord-McSweeney removed the waiting-on-review Waiting on review from a Ruffle team member label Oct 16, 2025
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants