Fixes the `as3_virtual_properties` test, where the old approach would accidentally grab a `Getter` and then think there's no setter (there is, you just have to look further down the list).
This is a temporary fix for failing tests; it is invalid in the sense that attempting to grab loader events will now fail. We can't actually correctly init the loader without two planned changes:
1. Moving all object initialization into the object helper functions (e.g. `LoaderInfoObject::from_movie`)
2. A notion of "native-only" constructors separate from the existing constructor chain
Once those are in place, loaders should be proper event dispatchers again.
This also incurred a large number of ancillary changes, as it turns out nearly every native object is currently pulling a prototype and sticking it into an object. Right now, I have it instead pulling the constructor out of the prototype, but a future PR will also remove `system_prototypes` as well.
Other ancillary changes include:
* `Domain` now supports partial initialization to avoid an order-of-events issue. Accessing domain memory on a partially-initialized `Domain` will panic.
* `Domain` construction requires a full `activation` now, except for `global_scope` which needs to be initialized later with valid domain memory before user code runs.
* Pretty much every native object constructor now takes a proto/constr pair
* Trait lookup was rewritten to handle this. It's still buggy - seven tests don't work
* `TObject.construct` now actually does the full object construction dance. This allows `ClassObject` to implement the ES4 object construction pathway directly while `FunctionObject` maintains ES3 compatibility.
This is a tentative commit; there are still seven failing tests that I need to fix.
* The properties parameter is evaluated last. This is observable by
the order the `toString`/`valueOf` methods of the parameters are
called.
* Only `null` in the property list parameter configures all properties,
as opposed to `undefined`, `null`, numbers and booleans previously.
* Objects in the property list parameter are not handled specially.
Instead, they're also coerced to string and split by comma.
* Remove `buildProduction` as it was equivalent to `build`.
* Fix `build:avm_debug` and change it to `build:debug`, which also
disables Webpack optimizations.
Each function is reduced to just 3 opcodes on x86:
https://godbolt.org/z/n6q6zxnh6
WebAssembly benefits as well: https://godbolt.org/z/fcETE9GYn
This should improve load-time performance because read_f64_me is
used frequently (for each AVM1 double constant).
It seems that these two classes were totally equivalent, so simply
drop "active" and use only "menu_item".
Also, don't highlight disabled context menu items on hover.
i fully intended to press "run anyway" just to see what happened, and it was annoying that Ruffle took me to another page so i had to re-load the flash.. (from a page with 10 seconds worth of ads before playing the flash, even)
Let the `Reader` outlive outside the loop, so it tracks its own
position, instead of doing so manually.
Also move `read_from_file` outside and reuse it.
Change two cases to use `Reader::read_slice` instead of `self.input`.
Not only this avoids relying on an implementation detail, this also
raises an `UnexpectedEof` error if the read is beyond the SWF.
* tests: add tests for scroll
* avm1: implement scroll, maxscroll, bottomScroll
* chore: fmt
* docs: note that scroll is 1-based
* fix: non-word wrapped text with manual breaks is scrollable
* chore: move magic number to const
* chore: avoid mut with extra if
* chore: moving clamping behaviour into core
* refactor: eagerly compute line data
* fix: make scroll work when text is aligned right
* chore: clippy
* docs: add more information about line_data
* tests: add more test cases for scroll
The current version just doesn't make any sense.
The fixed version is akin to the `target.starts_with("_level") && target.len() > 6` line a bit earlier in this file.
* Extend from the recommended config.
* Remove the exclude field that doesn't contribute to the file
inclusion (include alone should be enough).
* Remove the esModuleInterop field that shouldn't be necessary.
* `eslint:recommended` is not needed in the each file as it already
appears in the root config.
* The default `@typescript-eslint/naming-convention` rule is preferred.
* Other formatting improvements.