Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Add a (known failing) Dictionary weak key test #18132

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

torokati44
Copy link
Member

@torokati44 torokati44 commented Oct 1, 2024

I salvaged this from #10069.

Seems like the other half of that didn't ever land. I tried to rebase the implementation too, but things look so much different now, that I haven't managed to do it.

@torokati44 torokati44 changed the title tests: Add (a known failing) Dictionary weak key test tests: Add a (known failing) Dictionary weak key test Oct 1, 2024
@torokati44 torokati44 added T-compat Type: Compatibility with Flash Player A-tests Area: Tests & Test Framework labels Oct 1, 2024
@torokati44
Copy link
Member Author

How much do we care about the AS source not being easily accessible without proprietary tools? Not much, given that ffdec (JPEXS Free Flash Decompiler) exists...?

@torokati44
Copy link
Member Author

The AS in the SWF decompiles to this in JPEXS:

package test_fla
{
   import adobe.utils.*;
   import flash.accessibility.*;
   import flash.desktop.*;
   import flash.display.*;
   import flash.errors.*;
   import flash.events.*;
   import flash.external.*;
   import flash.filters.*;
   import flash.geom.*;
   import flash.globalization.*;
   import flash.media.*;
   import flash.net.*;
   import flash.net.drm.*;
   import flash.printing.*;
   import flash.profiler.*;
   import flash.sampler.*;
   import flash.sensors.*;
   import flash.system.*;
   import flash.text.*;
   import flash.text.engine.*;
   import flash.text.ime.*;
   import flash.ui.*;
   import flash.utils.*;
   import flash.xml.*;
   
   public dynamic class MainTimeline extends MovieClip
   {
       
      
      public var d:*;
      
      public var count:*;
      
      public var value:*;
      
      public var i:*;
      
      public var o:*;
      
      public function MainTimeline()
      {
         super();
         addFrameScript(0,this.frame1,1,this.frame2,2,this.frame3,3,this.frame4);
      }
      
      internal function frame1() : *
      {
         this.d = new Dictionary(true);
         this.obj1 = {};
         this.obj2 = {};
         this.obj3 = {};
         this.obj4 = {};
         this.obj5 = {};
         this.d[this.obj1] = 0;
         this.d[this.obj2] = 1;
         this.d[this.obj3] = 2;
         this.d[this.obj4] = 3;
         this.d[this.obj5] = 4;
         this.counter = 0;
         this.d = this.d;
      }
      
      internal function frame2() : *
      {
         this.count = 0;
         for each(this.value in this.d)
         {
            ++this.count;
         }
         trace(this.count);
         if(this.counter)
         {
            return;
         }
         this.obj1 = null;
         this.obj3 = null;
         this.obj5 = null;
      }
      
      internal function frame3() : *
      {
         if(this.counter >= 20)
         {
            this.counter = 0;
            gotoAndStop(2);
            return;
         }
         for(this.i = 0; this.i <= 300; ++this.i)
         {
            this.o = new Object();
         }
         ++this.counter;
      }
      
      internal function frame4() : *
      {
         gotoAndPlay(3);
      }
   }
}

I guess it's straightforward enough...

@JL2210
Copy link

JL2210 commented Oct 3, 2024

I tried rebasing the implementation before I commented on that issue but had the same issues as you probably did. I don't know how Ruffle (or Rust, for that matter) works well enough to implement it from scratch.

@Dinnerbone
Copy link
Contributor

Dinnerbone commented Oct 3, 2024

How much do we care about the AS source not being easily accessible without proprietary tools? Not much, given that ffdec (JPEXS Free Flash Decompiler) exists...?

Nice to have, not critical if the (actual-)source isn't available. Sometimes it's not due to the swf being crafted by hand (usually via ffdec)

@torokati44 torokati44 enabled auto-merge (rebase) October 3, 2024 20:55
@torokati44 torokati44 merged commit 019934b into ruffle-rs:master Oct 3, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tests Area: Tests & Test Framework T-compat Type: Compatibility with Flash Player
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants