Skip to content

Conversation

@moulins
Copy link
Contributor

@moulins moulins commented Dec 6, 2025

  • only coerce RHS when the LHS is object-like
  • prototype access should ignore __proto__, properties, and version attributes

This exposes some Flash weirdness; see the second commit message for details.

@moulins moulins added A-avm1 Area: AVM1 (ActionScript 1 & 2) T-compat Type: Compatibility with Flash Player labels Dec 6, 2025
@moulins moulins force-pushed the avm1-instanceof-and-cast branch from e3f53be to fba415d Compare December 6, 2025 21:35
@moulins moulins added the waiting-on-review Waiting on review from a Ruffle team member label Dec 6, 2025
@moulins moulins force-pushed the avm1-instanceof-and-cast branch from fba415d to 5c1d88e Compare December 7, 2025 22:01
- only coerce RHS when the LHS is object-like
- `prototype` access should ignore __proto__, properties, and version attributes

This exposes some Flash weirdness; in FP, the following code traces `false` if
placed on frame 1, but hangs if placed on any other frame.

```
a = {};
b = {};
a.__proto__ = b;
b.__proto__ = a;
trace(a instanceof b);
```

Prior to this PR, Ruffle raised an `Error::PrototypeRecursionLimit`, for slightly
wrong reasons (we tried to crawl b's `__proto__` chain to find a `prototype`
property); now it returns `false`.

This affects Gnash's `Inheritance-*` tests, as they run the above code on frame 2,
and so hang in FP.
@moulins moulins force-pushed the avm1-instanceof-and-cast branch from 5c1d88e to 01c60bd Compare December 8, 2025 14:52
@moulins moulins removed the waiting-on-review Waiting on review from a Ruffle team member label Dec 8, 2025
@moulins moulins merged commit 1530a74 into ruffle-rs:master Dec 8, 2025
26 checks passed
@moulins moulins deleted the avm1-instanceof-and-cast branch December 8, 2025 15:12
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-compat Type: Compatibility with Flash Player

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants