1. `added`/`addedToStage` on the new state
2. `removed` (presumably) on the old state
3. `frameConstructed` on the new state
4. Any frame scripts on the new state
5. `exitFrame` on the new state
This is a rough approximation; I have several tests that fail in weird and interesting ways. Also, this only happens if you set the *active* state; presumably these events are all fired when the state changes but I can't automate tests for that yet.
If a textfield has word wrapping enabled, is very small in size and
tries to layout a single character onto it, the layout code can run into
an endless loop where it's creating new lines and trying to fit the text
again.
If text doesn't fit at the start of a line, it won't fit on the next
either, so abort and display the whole text span on the line. Text will
be cut-off.
This can be reproduced with a AS2 file like this:
class Test {
static var app : Test;
function Test() {
_root.createTextField("tf",0,0,0,6,20);
_root.tf.text = "0";
_root.tf.wordWrap = true;
}
static function main(mc) {
app = new Test();
}
}
Build it with `mtasc -main -header 100💯30 test.as -swf test.swf`
Both InitArray and InitObject should bail-out without popping anything
off the stack when the elements/properties count is negative or greater
than or equals 2147483648.
Previously, if the arguments count was greater than the actual
stack size, then a stack underflow occurred which resulted in a
sequence of undefined values. That didn't match Flash's behavior.
Also, this prevents potential huge allocations that hang Ruffle.
In addition, num_args seems like it should use coerce_to_u32
(wraps at 4294967297). This also means that -1 ends up acting like
u32::MAX and would pop all values off of the stack.
The string will now be surrounded with quotes (`"`), non-ASCII characters (UTF-8 or not) will be escaped in hexadecimal form (`\xNN`) and ASCII control characters will be escaped (`\x01`, `\n`, `\t`).
Toss out any shared objects that contain ".." in the name
to avoid accessing files outside of the Ruffle data directory.
The DiskStorageBackend also will fail any requests with a ".."
component as an extra precaution.
Fixes#3961.
Also, prefix the shared object name with # if it contains a
slash, (e.g. `#mygame/foo`). This matches Flash's directory
structure and makes it easier to transfer saved data to Ruffle.