Skip to content

avm2: Partially implement the rest of flash.trace.Trace - #24344

Open
ChrisCPI wants to merge 1 commit into
ruffle-rs:masterfrom
ChrisCPI:avm2-flash-trace
Open

avm2: Partially implement the rest of flash.trace.Trace#24344
ChrisCPI wants to merge 1 commit into
ruffle-rs:masterfrom
ChrisCPI:avm2-flash-trace

Conversation

@ChrisCPI

@ChrisCPI ChrisCPI commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Description

In the non-debugger version of Flash Player, the setLevel and setListener functions are no-ops, which makes it pretty simple to implement in this way. The actual functionality of Trace, which is only present in the FP debugger, is not yet implemented.

Testing

Test included (the Flash Player output can't be gotten normally, see the test.toml for details)

Checklist

  • I, a human, have self-reviewed this PR and fully understand the changes within.
  • I have made or updated tests where possible.
  • All of my commits are properly scoped, compile successfully, and pass all tests.
  • This PR does not make sense to split up into smaller PRs.
  • An LLM was involved in the authoring of this code.

In the non-debugger version of Flash Player, the `setLevel` and `setListener` functions are no-ops, which makes it pretty simple to implement in this way. The actual functionality of `Trace`, which is only present in the FP debugger, is not yet implemented.
@ChrisCPI ChrisCPI added A-avm2 Area: AVM2 (ActionScript 3) T-compat Type: Compatibility with Flash Player labels Aug 1, 2026
private static var _listener:Function = null;

public static function getLevel(target:int = LISTENER):int {
if (target <= FILE) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be more obvious to just return 0? Which is what this does anyway.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it this way to be closer to how Trace actually functions in the debugger (there are 2 different levels that can be set), but I can simplify it to that if it would be better for now.

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

Labels

A-avm2 Area: AVM2 (ActionScript 3) T-compat Type: Compatibility with Flash Player

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants