Aaron Hill
4f23500779
avm2: Implement most of `flash.external.ExternalInterface`
...
This re-uses the logic we have for handling AVM1's `ExternalInterface`.
For now, serialization/deserialization of non-array objects is
left unimplemented.
2022-03-31 22:40:09 -07:00
Mike Welsh
a9aaa0b0de
tests: Add test for Add2 op
2022-03-31 16:57:07 -07:00
dependabot[bot]
e5a3365957
build(deps): bump image from 0.23.14 to 0.24.1
...
Bumps [image](https://github.com/image-rs/image ) from 0.23.14 to 0.24.1.
- [Release notes](https://github.com/image-rs/image/releases )
- [Changelog](https://github.com/image-rs/image/blob/master/CHANGES.md )
- [Commits](https://github.com/image-rs/image/commits )
---
updated-dependencies:
- dependency-name: image
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-03-30 08:55:55 +03:00
Mike Welsh
02fe467bd2
tests: Reduce epsilon for autosize tests
2022-03-29 22:22:32 -07:00
Mike Welsh
f0836eb7fa
tests: Add test for String(function) to string_coercion
2022-03-28 19:07:12 -07:00
Mike Welsh
bda8db5a34
tests: Add Object < Object tests to lessthan2 tests
2022-03-28 19:07:12 -07:00
Mike Welsh
02a66e938c
tests: Unignore avm1 string_coercion test
2022-03-28 19:07:12 -07:00
David Wendt
d38e5e166b
tests: Add regression tests for image loading
2022-03-27 18:55:38 -07:00
relrelb
161071e8c4
core: Re-implement `NullExecutor`
...
Make it a thin abstraction layer over either the `futures` or `wasm-bindgen-futures`
crates, as already done in `render/wgpu/src/uniform_buffer.rs`,
instead of a hand-made single-thread executor.
Ideally this would also be usable on desktop, but I didn't manage to
get `LocalPool` working with `winit` (it needs to post a task to the
`EventLoopProxy` as a wake procedure).
2022-03-26 10:03:42 -07:00
relrelb
bee70c99de
tests: Expand `xml_to_string`
...
Test that a set `nodeName` is included in the final string
representation.
2022-03-19 16:31:24 -07:00
relrelb
bac6f50fa3
tests: Expand `xml_append_child`
...
Test that document roots can be appended as children.
2022-03-19 16:31:24 -07:00
relrelb
031126a1b8
core: Remove `LocaleBackend`
...
Previously there were 3 implementations of `LocaleBackend`:
`DesktopLocaleBackend`, `WebLocaleBackend` and `NullLocaleBackend`.
While `DesktopLocaleBackend`, `WebLocaleBackend` were identical,
`NullLocaleBackend` always returned a fixed date/time for tests
determinism.
Unify them in a single file, and use `cfg!(test)` and a new dedicated
`deterministic` feature to decide whether to mock date/time or not.
This should not cause any behavioral changes.
2022-03-16 19:57:53 +02:00
dependabot[bot]
50ab1e6130
build(deps): bump pretty_assertions from 1.1.0 to 1.2.0
...
Bumps [pretty_assertions](https://github.com/colin-kiegel/rust-pretty-assertions ) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/colin-kiegel/rust-pretty-assertions/releases )
- [Changelog](https://github.com/colin-kiegel/rust-pretty-assertions/blob/main/CHANGELOG.md )
- [Commits](https://github.com/colin-kiegel/rust-pretty-assertions/commits )
---
updated-dependencies:
- dependency-name: pretty_assertions
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-03-14 22:35:54 +02:00
relrelb
95a0ef993b
tests: Merge `roots_and_levels` into `stage_object_children`
...
And add some more cases along the way.
2022-03-12 16:48:55 +02:00
relrelb
efc60094a5
tests: Expand `transform`
2022-03-12 15:59:05 +02:00
relrelb
d8df22fab0
tests: Add `is_finite`
...
Based on `as3_is_finite`.
2022-03-06 23:15:18 +01:00
dependabot[bot]
4e2f7b02fc
build(deps): bump futures from 0.3.19 to 0.3.21
...
Bumps [futures](https://github.com/rust-lang/futures-rs ) from 0.3.19 to 0.3.21.
- [Release notes](https://github.com/rust-lang/futures-rs/releases )
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.19...0.3.21 )
---
updated-dependencies:
- dependency-name: futures
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 19:44:57 +02:00
dependabot[bot]
4a90d5f7ad
build(deps): bump pretty_assertions from 1.0.0 to 1.1.0
...
Bumps [pretty_assertions](https://github.com/colin-kiegel/rust-pretty-assertions ) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/colin-kiegel/rust-pretty-assertions/releases )
- [Changelog](https://github.com/colin-kiegel/rust-pretty-assertions/blob/main/CHANGELOG.md )
- [Commits](https://github.com/colin-kiegel/rust-pretty-assertions/compare/v1.0.0...v1.1.0 )
---
updated-dependencies:
- dependency-name: pretty_assertions
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-02-13 17:02:18 +02:00
relrelb
26025a0446
tests: Expand `register_class` and `register_class_swf6`
2022-02-10 07:58:30 +02:00
TÖRÖK Attila
81c8f040fa
tests: Adjust avm2/edittext_leading for the updated fake device font
2022-02-09 20:09:52 +01:00
Adrian Wielgosik
9059e199e2
avm2: Add tests for class calling
2022-02-07 00:49:00 +01:00
TÖRÖK Attila
43b21e5d4d
chore: Bump approx to 0.5.1, remove clippy lint suppressions
2022-01-25 18:34:35 -08:00
Mike Welsh
3e9f9741ea
tests: Edit funky_function_calls to test undefined this
...
Test `this` instead of `this == other_this` to verify when it is
indeed an unboxed undefined.
2022-01-24 02:04:57 -08:00
Mike Welsh
d9bedffb9f
tests: Add tests for Object-to-String coercion
2022-01-23 17:19:09 -08:00
David Wendt
c42984a990
avm2: Implement `MouseEvent.toString`.
...
This also rearranges some things about how we construct events, because `MouseEvent` has different defaults from `Event`. When we finally support parameter metadata on methods we should remove that code.
We also remove the `value_of` code on `EventObject` as that was a mistake. Events don't do anything special in there and I misinterpreted the test results the first time around.
2022-01-22 19:58:32 -08:00
David Wendt
59d735a034
tests: Add a test for `MouseEvent.stageX`/`stageY`
2022-01-22 19:58:32 -08:00
David Wendt
69c66fe720
tests: Add a test of `MouseEvent`'s constructor
2022-01-22 19:58:32 -08:00
Mike Welsh
e11e1e870f
avm1: Improve Object comparisons in SWFv5
...
SWFv5 always calls `Object.valueOf` at least once and sometimes
twice in the Equals2 op, even when comparing two Objects.
For example, `Object(1) == Object(1)` is true in SWFv5 but false
in SWFv6.
2022-01-21 16:40:19 -08:00
Mike Welsh
bf599d9107
avm1: Clean up Value::abstract_eq
...
Consolidate several cases and fix some issues:
* Object-to-primitive comparison always goes through `valueOf`.
* `Object(undefined) == undefined` is true; this will coerce
to a bare object with no `valueOf`, resulting in
`undefined==undefined`.
* `{valueOf:function() { return NaN; }} == NaN` is true.
2022-01-21 16:40:19 -08:00
Mike Welsh
4d8db1e64d
avm1: Fix function closures inside `with`
...
When creating a scope for a closure, any `with` scopes were being
filtered out, but this was incorrect; `with` scopes are still on
the scope chain when the function is called.
2022-01-19 20:29:26 -08:00
Adrian Wielgosik
5358940774
avm2: Support basic string.replace
...
Supports:
- string.replace(string, string)
- string.replace(regex, simple_string)
Does not support:
- string.replace(regex, string_with_replacement_codes)
- string.replace(any, function)
2022-01-17 20:10:20 -08:00
relrelb
7dad98e3a8
tests: Expand `mcl_getprogress`
2022-01-15 13:08:01 -08:00
relrelb
6ec69dcae1
tests: Expand `mcl_loadclip`
2022-01-15 13:08:01 -08:00
relrelb
6b80b296fc
tests: Expand `mcl_loadclip`
2022-01-07 10:39:16 -08:00
Mike Welsh
ab88f9a23e
tests: Add test case for #5598
2022-01-01 22:24:08 -08:00
dependabot[bot]
a99b23dcf5
build(deps): bump futures from 0.3.18 to 0.3.19
...
Bumps [futures](https://github.com/rust-lang/futures-rs ) from 0.3.18 to 0.3.19.
- [Release notes](https://github.com/rust-lang/futures-rs/releases )
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.18...0.3.19 )
---
updated-dependencies:
- dependency-name: futures
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-12-21 08:36:06 +02:00
relrelb
ccef61d076
tests: Unignore `edittext_html_roundtrip` and `as3_edittext_html_roundtrip`
2021-12-20 08:31:59 +02:00
Adrian Wielgosik
726ec47f19
avm2: Support inheritance of protected traits
2021-12-15 22:26:41 +01:00
Adrian Wielgosik
11534a4b34
avm2: Implement parseInt, parseFloat
2021-12-15 22:16:49 +01:00
EmperorBale
30f2e0f8b1
avm2: Implement JSON ( #5172 )
...
* avm2: Implement JSON.parse
* avm2: Add AvmSerializer for serializing AVM values to JSON
* avm2: Add support for replacer objects
* avm2: use *const ObjectPtr for object stack
* avm2: Add support for space parameter is JSON.stringify
* avm2: Refactor AvmSerializer design
* avm2: Restrict spaces to a maximum of 10
* avm2: Refactor map_value
* tests: Add JSON.parse test
* chore: Appease clippy
* avm2: Check if value is undefined before inserting
* tests: Add test for JSON.stringify
* tests: Improve JSON.stringify test
* chore: Replace map_or with explicit match statements
* chore: Use QName::dynamic_name
* avm2: Use Object<'gc> instead of ObjectPtr
* chore: Use explicit match in deserialize_value
* Rebase fixes
Co-authored-by: Adrian Wielgosik <adrian.wielgosik@gmail.com>
2021-12-13 18:32:04 +01:00
Adrian Wielgosik
b4d444175d
Update failing tests, drag one always-failing case to separate test
2021-12-11 20:48:09 +01:00
relrelb
e801ab234e
tests: Expand `as3_trace`
2021-12-10 19:54:35 +02:00
relrelb
6e70379054
tests: Add `trace`
2021-12-10 19:54:35 +02:00
relrelb
7966d850dd
core: Normalize `\r` to `\n` in `avm_trace`
...
Fixes #3120 .
2021-12-10 19:54:35 +02:00
Daniel Jacobs
ed7a13ab05
Chore: Alphabetize regression tests
2021-12-04 13:45:22 +02:00
dependabot[bot]
ea254b53b7
build(deps): bump futures from 0.3.17 to 0.3.18
...
Bumps [futures](https://github.com/rust-lang/futures-rs ) from 0.3.17 to 0.3.18.
- [Release notes](https://github.com/rust-lang/futures-rs/releases )
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.17...0.3.18 )
---
updated-dependencies:
- dependency-name: futures
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-11-29 22:35:40 +02:00
David Wendt
7569994f1f
avm2: Impl `Boolean.toString` and `Boolean.valueOf`.
2021-11-28 18:40:21 -07:00
David Wendt
aa01a682e1
avm2: Implement `uint`'s various formatting methods, too.
2021-11-28 18:40:21 -07:00
David Wendt
e43d18f7b0
avm2: Impl `int` versions of `toFixed`, `toString`, `toExponential`, and `toPrecision`
2021-11-28 18:40:21 -07:00
David Wendt
9e62b05157
avm2: Implement `Number.AS3::toString` and `Number.AS3::valueOf`.
...
This method has an odd flaw that we don't emulate yet. Actually, two:
1. Precision limits that are specific to the chosen radix
2. Occasional and intermittent corruption in the resulting 0 padding; usually manifesting as `x`, `W`, or `°` characters
The first could be emulated, but I've chosen not to... because the second thing listed not only isn't really possible to emulate, but actively prohibits approx-testing the results. So I'm marking the test as ignored and hoping no movies actually rely on the precision limits in `toString`.
2021-11-28 18:40:21 -07:00
David Wendt
4a09dfa3d0
avm2: Implement `Number.toFixed` and `Number.toPrecision`
2021-11-28 18:40:21 -07:00
David Wendt
55a7a1882d
avm2: Implement `Number.toExponential`
2021-11-28 18:40:21 -07:00
relrelb
8fb77b34d6
tests: Add `bitmap_data_compare`
2021-11-20 14:11:14 +02:00
relrelb
7c6d006862
avm2: Correct `TextFormat` properties coercion
2021-11-20 13:36:06 +02:00
relrelb
10b7c69719
avm1: Correct `TextFormat` properties coercion
2021-11-20 13:36:06 +02:00
relrelb
ae189c5a0d
tests: Fix image tests
...
Seems like CI was upgraded to use LLVM 13.
Rename image tests (currently only color) to match it.
2021-11-19 21:40:30 +02:00
relrelb
2083d77100
tests: Expand `sound`
...
Add cases of `Sound.setVolume()` and `Sound.setPan()` with no arguments.
Also correct `Sound` to `sound` in traces.
2021-11-14 20:25:45 +02:00
relrelb
2e5a8922ae
tests: Uncomment `Sound.getDuration` tests
...
`NullAudioBackend` returns real durations by now.
2021-11-14 20:25:45 +02:00
David Wendt
19f9c11854
tests: Add test for `Function`'s type.
2021-11-11 17:12:49 -07:00
David Wendt
e89d85c3f6
tests: Add tests for the four remaining primitive constructors
2021-11-11 16:34:11 -07:00
Tal Hayon
7ed38850fd
core: implement displayState for Stage in avm1/2
2021-11-11 16:20:05 -07:00
David Wendt
c4b680fef9
tests: Add test for `EventDispatcher.toString`
2021-11-10 18:16:26 -07:00
David Wendt
360ae1f044
avm2: Private classes in different scripts are allowed to share the same name without conflicting.
2021-11-10 17:43:02 -07:00
David Wendt
5b58301795
tests: Fix all remaining test bugs caused by discrepancies between how Ruffle and Flash Player handle dynamic `Namespace`s.
...
For some reason, in Flash Player, `RTQName`s that use a dynamic namespace do *not* pick the same namespace that you would ordinarily get if declaring or referencing that namespace statically. My suspicion is that this has something to do with E4X namespaces, which are flagged as a separate space from ES4 namespaces.
2021-11-09 17:28:33 -07:00
David Wendt
427b2bf17a
avm2: Implement `Proxy.deleteproperty`
2021-11-09 17:28:33 -07:00
David Wendt
452a87da84
tests: In the `getproperty` test, test each multiname type directly to rule out any funny business.
...
For some reason, Flash Player treats `getlex`ing `flash.utils.flash_proxy` as a separate namespace from `pushnamespace`ing it. Don't ask why.
2021-11-09 17:28:33 -07:00
David Wendt
685d386389
tests: Add a test for every part of `Proxy` that does not involve E4X.
2021-11-09 17:28:33 -07:00
David Wendt
95f105aadd
core: `Stage`, `EditText`, and `Avm2Button` should also be interactive objects.
2021-11-09 16:48:29 -07:00
David Wendt
e71c749db5
avm2: Implement accessors for new `InteractiveObject` flags.
2021-11-09 16:48:29 -07:00
David Wendt
9d3e249cf9
tests: Add test for interface namespaces (accessed via coercion semantic sugar)
2021-11-02 16:54:38 -06:00
Mike Welsh
92977e0430
tests: Add hitTest test for unclosed drawing path
2021-10-31 19:01:55 -07:00
Mike Welsh
64cc6fc80f
tests: Add test for duplicateMovieClip w/ drawing API
2021-10-31 19:01:55 -07:00
David Wendt
039777c41e
avm2: `Object.hasOwnProperty`, `propertyIsEnumerable`, and `setPropertyIsEnumerable` only work with public-NS properties.
2021-10-30 11:44:29 -06:00
Mike Welsh
a1130b973f
tests: Add test for GotoFrame2 after bogus tellTarget
2021-10-28 10:18:18 -07:00
Mike Welsh
6ac49b3d0d
tests: Add test for tellTarget with removed base clip
2021-10-28 10:18:18 -07:00
EmperorBale
1e9189dffc
tests: Improve AMF3 test
2021-10-25 16:32:55 -07:00
EmperorBale
84a7b3d148
tests: Add test for reading AMF0 objects
2021-10-25 16:32:55 -07:00
EmperorBale
e7a723f250
tests: Add test for reading AMF3 objects
2021-10-25 16:32:55 -07:00
EmperorBale
f6c5e2e0dc
avm2: Add test for array enumeration on elements
2021-10-25 13:45:29 -07:00
Mike Welsh
df270c55af
wgpu: Make WgpuRenderBackend::build_descriptors async
...
This will be necessary for using wgpu on web, where the whole
renderer creation will need to be async.
2021-10-24 17:20:19 -07:00
Mike Welsh
0cbdad1ff2
wgpu: Bump to wgpu 0.11
2021-10-24 17:20:19 -07:00
David Wendt
5abb11482e
avm2: Make builtin class prototypes also instances of `Object`, with the sole exception of `Function`, whose prototype is an instance of it's class.
2021-10-22 20:12:48 -07:00
David Wendt
469f8cb9db
avm2: All prototypes are instances of `Object`, not their own class.
2021-10-22 20:12:48 -07:00
Adrian Wielgosik
bc82a4f705
build: Bump Rust edition to 2021
2021-10-21 10:24:05 -07:00
EmperorBale
2793c3b556
tests: Add test for getouterscope
2021-10-19 18:39:41 -06:00
EmperorBale
a9f5823074
tests: Add test for with
2021-10-19 18:39:41 -06:00
EmperorBale
edee0a713c
tests: Add test for #5292
2021-10-19 18:39:41 -06:00
relrelb
7816938e9b
tests: Expand avm1 `SuperObject` tests
2021-10-16 11:14:38 -07:00
Mike Welsh
af244c1c66
tests: Add test for function w/ removed base clip
2021-10-12 17:23:01 -07:00
Mike Welsh
f008fc4474
tests: Add test for avm2 self-goto execution order
2021-10-10 18:27:30 -07:00
Mike Welsh
279834a499
tests: Add test for default null-ish slot values
2021-10-10 14:01:36 -07:00
EmperorBale
2b77fff8f7
tests: Add test for vector enumeration
2021-10-10 11:02:42 -07:00
EmperorBale
9bca63375f
tests: Add test for array enumeration
2021-10-10 11:02:42 -07:00
dependabot[bot]
cd9206f08d
build(deps): bump pretty_assertions from 0.7.2 to 1.0.0
...
Bumps [pretty_assertions](https://github.com/colin-kiegel/rust-pretty-assertions ) from 0.7.2 to 1.0.0.
- [Release notes](https://github.com/colin-kiegel/rust-pretty-assertions/releases )
- [Changelog](https://github.com/colin-kiegel/rust-pretty-assertions/blob/main/CHANGELOG.md )
- [Commits](https://github.com/colin-kiegel/rust-pretty-assertions/compare/v0.7.2...v1.0.0 )
---
updated-dependencies:
- dependency-name: pretty_assertions
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-10-04 15:02:30 -07:00
TÖRÖK Attila
8cf39f3001
Allow the if_then_panic clippy lint in one more place
2021-10-03 15:50:54 -07:00
David Wendt
aaca3460d4
avm2: `QName` overrides `toString` and `valueOf` in both namespaces
2021-10-01 16:30:58 -06:00
David Wendt
44b5536fb6
tests: Add tests for `QName`.
2021-10-01 16:30:58 -06:00
David Wendt
2007b0e5c3
tests: Remove superfluous `^M` characters from ActionScript source
2021-09-25 16:54:36 -06:00
David Wendt
c299f63784
avm2: Implement object space enumeration.
...
This required making enumerants into `Value`s, rather than `QName`s.
2021-09-25 16:54:36 -06:00
David Wendt
66ac5d0693
tests: Add tests for various operations on `Dictionary`.
2021-09-25 16:54:36 -06:00