What's this strange syntax in AS3. Why does this make my browser hang//crash silently - actionscript-3

I've stumbled over this in AS3.
while(y.t<ys) y.(y.t++, 0);
And I'm wondering, what's this strange dot parentheses syntax .() ? What is it supposed to do ?
Moreover i've tried a snippet of code including this in a browser and this make Flash hang//crash silently.
Any idea why ?
Thanks you
edit: The original code is there as3-crypto
ps: I would infer it's some kind of dot notation followed by comma operator but i can't be sure at this point.

So, I investigated that thing a bit. First, I located the mentioned as3crypto repo and checked that the given code line is, indeed, there. The line there was not documented in any way and still makes no actual sense in AS3 terms.
Second, I viewed the deployed SWC library with decompiler, and, yet again, exactly that one place makes no sense and comes out malformed, which might be the sign that library was initially composed not in AS3 but maybe in HAXE.
Finally, I moved to the repo issues section seeking for the way to inquire the owner about that line, but then I have just noticed that such an issue is already open: https://github.com/timkurvers/as3-crypto/issues/14
So, the conclusion remains the same as I initially announced: it is not any valid AS3 syntax and probably just an error (maybe a translation mistake) in the repo.

Related

Is there a way to trigger an error in Stylus when missing a variable?

I recently migrated from Sass to Stylus, and I'm loving it.
However, there is 1 thing that really made sense in Sass that doesn't exist in stylus. The compiler should yell at me if a variable is undefined, instead of just spitting it out as a string like nothing ever happened.
Is there a way to make the compiler yell at me ?
Assuming all options are in this page, you cannot do what you want at the moment.
You can still add this feature yourself or request it (by creating an issue) on the official github repo
By the way, this would be a good feature.

Library with identifier LabelServices is missing (perhaps it was deleted?) / Something went wrong. Please reload

I have posted this on google-apps-script-issues (https://code.google.com/p/google-apps-script-issues/issues/detail?id=4723&can=4&colspec=Stars%20Opened%20ID%20Type%20Status%20Summary%20Component%20Owner) but with no response I am getting desperate as all my sheets and scripts are breaking down. So I hope someone here might have encountered this and have some idea for me how to handle this.
Some of my exiting scripts (including some in spreadsheets) suddenly started throwing the exception 'Library with identifier LabelServices is missing (perhaps it was deleted?)'.
I tried deleting the library reference in some of the scripts that were throwing this error and re-adding it but the same error comes up. I even defined a new library with the same name and try to use it instead. Still the same error.
Most likely a related error, when trying to open project properties to these scripts I see the message 'Something went wrong. Please reload.' and the hourglass never stops. This happens at both standalone scripts and ones embeded in spreadsheets.
Please note that if I add the same library to a new script then there is no problem and the library works perfectly.
I would like to add that even if I remove the library and also any calls or references to the library the problem still persists.
Link to a script where this happens is available at https://script.google.com/d/1ptevXwu25z9Vo88zX0XOyaQk5pE5MmzwDbb-lMglNY1lzz1HBBiAeJxn/edit?usp=drive_web
You can copy it and play with it. You should get the same problem.
Appreciate any help!!!
Andrew. First of all thank you as you triggered something in my mind. I went all the way bottom up and checked each script and a library it was calling. There were obviously dependencies, however nothing that should have been a problem. a couple of libraries even though in development mode seem to cause a problem. I had to create a new version but it was not enough just to update their version in other scripts. In the calling scripts I had to remove all libraries and re-add them one by one while testing whether the project properties shows up or not. I just wish Google would have a utility to clearly highlight what was wrong because I can't figure it out though I went twice through their documentation in regard to libraries and development mode. Since I have about 30 libraries or so, not to mention spreadsheets and apps it took me nearly a whole day... Thanks again!
To all, it seems that there is a problem where sometimes libraries get out of sync (at least that's the best way I can describe it). You may need to create new versions for the libraries (even though these are in development mode. And in each problematic script remove and re-add the libraries (in at lease a couple of transactions - first remove and confirm then add - and better one at the time while checking that your project properties opens properly). This solved the problem for me.

How to deobfuscate AS3 source code?

Is there a way to de-obfuscate AS3? With de-obfuscation I mean making it compilable again. At this moment I lost some source code and only have the Flash file left. The problem I now face is that the compiler is not able to compile it as the class names contain illegal characters.
I could start manually naming all classes again however I'm not even certain if the de-compiler worked.
To compile the SWF again I use flash develop and the FlashSDK.
Regards.
This depends on how the code was obfuscated to begin with. If it was simply obfuscated by changing class/variable/function names, then you could use an IDE such as FlashDevelop which allows you to Refactor->Rename by right clicking the instance name which would rename it across the entire project. Or just do a simple find/replace using a text editor.
Knowing how the code was obfuscated is the most important thing though. Whichever program you used to obfuscate is probably going to provide you with the most information.
I would suggest, however, doing the bare minimum by removing all illegal characters first to see if it will compile.

Trace Flash Builder compiling commands

is there a way to trace the compiler command for flash builder? I mean, I want to know the parameters and files that is compiling internally when I click "build" on FB.
Basically I moved a project to Flash Builder, and everything works fine but I have some runtime issues, and looks like the compiler is doing something wrong with some files (like using old files instead of using the one im changing, this occur only for a particular file, the rest works fine or I think that works fine). Also is different the way to embed some file, that's another reason to check what's doing internally.
I ran the game with mxmlc before, and probably I can compare what's the difference if I get the command executed by FB.
Also, I want to know how to do it if I need to research something in future.
Thanks for any help,
Regards
Flash Builder only recompiles if there has been a change to the code. So if you are changing an asset (image), for example, you won't recompile unless you also make a change to the project.
There are a few ways around this:
Easiest way is to just go into a file and press the space bar at the end of a line. It will add an extra byte to your file, but not to the project (compiler is "smart" and gets rid of unused files, classes, and characters). Since this is not a common thing, it shouldn't be an issue
Project->Clean.... That will force your workspace to rebuild and, in most cases, will also recompile your project
If #2 is failing, first delete bin-debug or whatever you are using as your debug folder, then run Project->Clean...
It's a tad bit annoying (especially when editing external libraries), but it allows for quicker re-launches of the debugger, which is the ultimate goal of that behavior.

How to compile the generated AS

hope you can help me with this question.
So, I've been working for a while with Flex, and had the crazy idea to create pure AS project.
If I compile a Flex app with the -keep flag, the generated actionscript gets generated.
Do you guys know of a way to make it compile, without going trough the code and gluing it all together?
Thanks.
Generated ActionScript is really only provided for reference; it's not really intended to be repurposed in that sense. Indeed, if you even have any, you've most likely compiled your project already anyway (unless you got it from somewhere else), so one might ask why you'd want to compile the generated stuff rather than your own source -- but nonetheless, although I haven't actually tried it, you should be able to point the Flex compiler mxmlc at your generated source to compile it, provided you're able to get all your dependencies to line up (which may be what you mean by "gluing it all together").
Just a thought, although again, I haven't actually tried it, so your results may vary. What is it you're trying to do, though? Just curious. :)
Like Christian mentioned, the generated AS code is pretty much there to serve as a reference. Just for fun, I tried compiling it from the command line using mxmlc, but part of the problem with doing that is that the class files generated don't match the classes they represent. So, you'd need to start renaming a bunch of your class files so that compiling those could even work. Many of the other classes in Flex won't be compiled in either, for the same reason.
As an example, the project I tested this with, had only one mxml file of source code in it. The generated output was 45 files. I'm sure that if you really wanted to do this, and were willing to invest the time in cleaning things up you could. But I'm curious too - why would you want to do this?
Actually it was just mere curiosity. I wanted to understand how the framework works and see how it merges it all together to make the final application, as I thought that the generated actionscript files were just a step in between the final SWF file, so I tought there should be a way for it to grab those files and generate the final application.
Eventually I would have tried to create a pure actionscript project just for the heck of it to see how complicated it was and what errors could happen when developing other stuff.
I know it sounds crazy, but I had some spare time, ha ha ha.