JPEXS Free Flash Decompiler Issue Tracker

If you are looking for the decompiler itself, visit https://github.com/jindrapetrik/jpexs-decompiler

NEW : We have got a new blog where we post some interesting SWF internals info.

List of issuesList of issues

#2517 Decompilation error on for/switch statement
Author:
Date created:
Type: bug
Visibility: Everybody
Assigned to:
State: closed Help

> What steps will reproduce the problem? Compile this code ``` function isItemOnMyPlayer(item_id) { if (!isNaN(item_id)) { var player = getPlayerObjectFromRoomById(getMyPlayerId()); var unused; for(var key in player) { switch (key) { case "head": if (player[key] == item_id) { return true; } case "face": if (player[key] == item_id) { return true; } case "neck": if (player[key] == item_id) { return true; } case "body": if (player[key] == item_id) { return true; } case "hand": if (player[key] == item_id) { return true; } case "feet": if (player[key] == item_id) { return true; } case "flag_id": if (player[key] == item_id) { return true; } case "photo_id": if (player[key] == item_id) { return true; } break; } } } else { $e("[shell] isItemOnMyPlayer() -> item id is not a real number! item_id: " + item_id); } return false; } ``` > What is the expected output? What do you see instead? Should compile correctly. Instead produces code with ``` §§enumerate(_loc1_); loop0: while(true) { if((_loc0_ = §§enumeration()) != null) ``` > What version of the product are you using? Is it "nightly build"? Which operating system do you have? 24.0.1 > Please provide any additional information below. If the problem is related to a SWF file, attach it here, otherwise we can't help you. This code originates in frame 1 of the shell SWFs attached. I believe I figured out the correct decompilation after a lot of trial and error. I think the else statement is necessary for exactly matching compilation, but not the main issue here.
This is fixed in nightly 3284.
State: new→upgraded
Thanks, it is nice to see this large file decompile without error. In hindsight, I don't know why I left that break statement in the code...
State: upgraded→closed