Commit Graph

6446 Commits

Author SHA1 Message Date
relrelb d8df22fab0 tests: Add `is_finite`
Based on `as3_is_finite`.
2022-03-06 23:15:18 +01:00
relrelb 88f6856723 avm1: Fix `isFinite()` for SWF<7
Previously, `isFinite()` with no arguments on SWF<7 incorrectly
returned `true`, as `undefined` coerced to `f64` is `0.0`, which
is finite. Fix this by not defaulting to `undefined`, similarly to
the `isNaN()` implementation.
2022-03-06 23:15:18 +01:00
Aaron Hill 8d58c6974c Display `Muliname` when trying to lookup a non-public property
This will make these errors easier to debug.
2022-03-06 22:56:23 +01:00
Aaron Hill 4a534086b8 Make `Date` class prototype methods non-enumerable 2022-03-06 22:48:15 +01:00
Aaron Hill 2d1b3a2834 Also declare Date methods on class prototype 2022-03-06 22:48:15 +01:00
Aaron Hill 59ef987210 Declare AVM2 'Date' class methods in the AS3 namespace
We now declare these methods in the 'http://adobe.com/AS3/2006/builtin'
namespace. This corresponds to the 'AS3' namespace modifier shown on the
docs page: https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html

Previously, we would fail to lookup these methods, since the namespace
used by the SWF would not match the namespace defined by Ruffle.
2022-03-06 22:48:15 +01:00
relrelb 26f3d1e321 avm1: Fix typo 2022-03-06 23:10:09 +02:00
relrelb d0edffaed3 avm1: Remove unneeded `pub` 2022-03-06 23:10:09 +02:00
relrelb 6504dc8ffc avm1: Simplify `MovieClip::get_bounds`
The String and Object cases are already handled by `resolve_target_display_object`.
2022-03-06 23:10:09 +02:00
Daniel Jacobs 31446785f9 ci: Use windows-latest again 2022-03-03 16:55:13 -07:00
relrelb 2faabfb58e xml: Remove `Error`
Directly use `quick_xml::Error` instead.
2022-03-02 08:56:23 +02:00
dependabot[bot] e12b540f00 build(deps-dev): bump webpack from 5.68.0 to 5.69.1 in /web
Bumps [webpack](https://github.com/webpack/webpack) from 5.68.0 to 5.69.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.68.0...v5.69.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 08:55:02 +02:00
dependabot[bot] aaccc86a12 build(deps-dev): bump eslint from 8.8.0 to 8.10.0 in /web
Bumps [eslint](https://github.com/eslint/eslint) from 8.8.0 to 8.10.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.8.0...v8.10.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 08:54:52 +02:00
dependabot[bot] 6018e5999a build(deps-dev): bump ts-node from 10.5.0 to 10.6.0 in /web
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.5.0 to 10.6.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.5.0...v10.6.0)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-02 08:54:42 +02:00
dependabot[bot] cbbdb7baa9 build(deps-dev): bump mocha from 9.2.0 to 9.2.1 in /web
Bumps [mocha](https://github.com/mochajs/mocha) from 9.2.0 to 9.2.1.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.2.0...v9.2.1)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 22:41:29 +02:00
dependabot[bot] ed9972122e build(deps-dev): bump @types/chrome from 0.0.178 to 0.0.179 in /web
Bumps [@types/chrome](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chrome) from 0.0.178 to 0.0.179.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chrome)

---
updated-dependencies:
- dependency-name: "@types/chrome"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 22:41:18 +02:00
dependabot[bot] 031f9abd91 build(deps-dev): bump typedoc from 0.22.10 to 0.22.12 in /web
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.22.10 to 0.22.12.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.22.10...v0.22.12)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 22:41:09 +02:00
dependabot[bot] 6ea5fd0f39 build(deps-dev): bump wdio-chromedriver-service in /web
Bumps [wdio-chromedriver-service](https://github.com/webdriverio-community/wdio-chromedriver-service) from 7.2.6 to 7.2.8.
- [Release notes](https://github.com/webdriverio-community/wdio-chromedriver-service/releases)
- [Commits](https://github.com/webdriverio-community/wdio-chromedriver-service/compare/v7.2.6...v7.2.8)

---
updated-dependencies:
- dependency-name: wdio-chromedriver-service
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 22:40:58 +02:00
dependabot[bot] 2ea482f955 build(deps-dev): bump copy-webpack-plugin from 10.2.0 to 10.2.4 in /web
Bumps [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) from 10.2.0 to 10.2.4.
- [Release notes](https://github.com/webpack-contrib/copy-webpack-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/copy-webpack-plugin/compare/v10.2.0...v10.2.4)

---
updated-dependencies:
- dependency-name: copy-webpack-plugin
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 22:40:48 +02:00
dependabot[bot] 69e92f2664 build(deps-dev): bump @wdio/local-runner from 7.16.14 to 7.16.16 in /web
Bumps [@wdio/local-runner](https://github.com/webdriverio/webdriverio) from 7.16.14 to 7.16.16.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v7.16.14...v7.16.16)

---
updated-dependencies:
- dependency-name: "@wdio/local-runner"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 22:40:39 +02:00
dependabot[bot] 093e68d967 build(deps-dev): bump @typescript-eslint/parser in /web
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.9.1 to 5.13.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.13.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 22:40:26 +02:00
relrelb e901999b4c xml: Silently fail in `insert_child`
Instead of returning a `Result` which is anyway always handled with
a `log::warn!()`, simply `log::warn!()` in place of errors. This
removes the last 3 remaining `Error` enum members besides `InvalidXml`.
2022-03-01 19:56:36 +02:00
relrelb 48d0737cd9 xml: Inline `adopt_child` into `insert_child`
There's no point in calling `adopt_child` alone. This makes 2 `Error`
enum members redundant.
2022-03-01 19:56:36 +02:00
Toad06 dcca61073b core: Display the appropriate mouse cursor after interacting with a button 2022-02-28 15:28:18 -07:00
dependabot[bot] 8e6ed37ba4 build(deps): bump enum-map from 2.0.2 to 2.0.3
Bumps [enum-map](https://gitlab.com/KonradBorowski/enum-map) from 2.0.2 to 2.0.3.
- [Release notes](https://gitlab.com/KonradBorowski/enum-map/tags)
- [Changelog](https://gitlab.com/KonradBorowski/enum-map/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/KonradBorowski/enum-map/commits/master)

---
updated-dependencies:
- dependency-name: enum-map
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-28 23:20:04 +02:00
dependabot[bot] 3252da19a4 build(deps): bump rfd from 0.7.0 to 0.8.0
Bumps [rfd](https://github.com/PolyMeilex/rfd) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/PolyMeilex/rfd/releases)
- [Changelog](https://github.com/PolyMeilex/rfd/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PolyMeilex/rfd/compare/0.7.0...0.8.0)

---
updated-dependencies:
- dependency-name: rfd
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-28 22:47:45 +02:00
dependabot[bot] 9657bde02c build(deps): bump clap from 3.1.2 to 3.1.3
Bumps [clap](https://github.com/clap-rs/clap) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.1.2...v3.1.3)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-28 22:31:25 +02:00
dependabot[bot] b5f65463b6 build(deps): bump png from 0.17.3 to 0.17.4
Bumps [png](https://github.com/image-rs/image-png) from 0.17.3 to 0.17.4.
- [Release notes](https://github.com/image-rs/image-png/releases)
- [Changelog](https://github.com/image-rs/image-png/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image-png/commits)

---
updated-dependencies:
- dependency-name: png
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-28 22:31:11 +02:00
Chris Midgley cf7b6b2515
web: Don't include query parameters in downloaded SWF name (#6368)
* fix: don't include query parameters in downloaded SWF name

* refactor: store swfUrl as URL
2022-02-28 22:27:56 +02:00
elliot 2b162e8532
web: Add `isPlaying` property to `RufflePlayer` (#6294) 2022-02-28 21:28:19 +02:00
relrelb 7313913127 xml: Turn `remove_child` into `remove_node`
The 2 existing usages of `remove_node` always operated on a child and
its parent: One iterates over all of its children and removes each one,
and the other explicitly grabs the parent of a given node.

As a simplification, `remove_node` operates only on a child node,
without the need for the parent node in addition; it grabs the parent
from the child by itself. As such, it's non-failable.
2022-02-28 08:34:16 +02:00
relrelb 73c1be8dcc xml: Remove `Error::TextNodeCantHaveChildren`
Text nodes are guaranteed to not be parents, as `adopt_child`
refuses to adopt children into them. So instead of returning an
`Err(Error::TextNodeCantHaveChildren)` in case of a text node parent,
mark those code paths as `unreachable!()`. This makes `orphan_child`
non-failable.
2022-02-28 08:34:16 +02:00
Toad06 66c132017f avm1: Allow strings in `new Sound(target)` 2022-02-28 08:30:38 +02:00
relrelb 0401b3c447 avm2: Replace `json` with `serde_json`
The `json` crate seems unmaintained, and recently also causes compile
errors with stable Rust 1.59.0. On the other hand, `serde_json` is
very maintained and more popular.

However, from some reason a cyclic package dependency has introduced
by this change. For now use a workaround from: https://github.com/tkaitchuck/aHash/issues/95#issuecomment-903560879
2022-02-27 23:19:46 +02:00
relrelb fa459f7547 core: Require `serde` feature
Enable it unconditionally as a preparation for depending on `serde_json`,
which will need `serde::Serialize`.
2022-02-27 23:19:46 +02:00
relrelb 841d0f7efd avm1: Remove legacy JSON SharedObject deserialization
This is basically a revert of 61298b2be3.

`SharedObject`s used to be saved as JSON in Ruffle, but since #4238
they're saved in AMF to match Flash's behavior. The legacy JSON
deserialization remained for backwards-compatibility, but from what it
seems, it has never worked; cd1cde1708
changed `LocalStorageBackend` to store base64-encoded strings instead
of plain ones. Therefore, Ruffle attempts to base64-decode old JSON
data, and unsurprisingly fails.

In addition, this removes 1 out of 2 usages of the unmaintained `json`
crate, which recently also causes compile errors with stable Rust 1.59.0.
2022-02-27 23:19:46 +02:00
relrelb b645c01ce7 xml: Silently fail in `disown_parent`
Instead of returning a `Result` which is anyway always handled with
a `log::warn!()`, simply `log::warn!()` in place of error.
2022-02-24 18:02:52 +02:00
relrelb 056eee8b46 chore: Re-generate `Cargo.lock`
`Cargo.lock` seems to got broken by #6265.
Fix it using `cargo generate-lockfile`.
2022-02-23 22:22:25 +01:00
Chris Midgley 7df5370ec1 chore: add rfd to master license list 2022-02-23 22:45:26 +02:00
Chris Midgley b2af0667fb build: add libgtk-3-dev 2022-02-23 22:45:26 +02:00
Chris Midgley 453b0f1fe3 desktop: swap out tinyfiledialogs for rfd 2022-02-23 22:45:26 +02:00
relrelb f7117824df xml: Silently fail in `set_{prev,next}_sibling`
Instead of returning a `Result` which is anyway always handled with
a `log::warn!()`, simply `log::warn!()` in place of errors.
2022-02-23 22:45:07 +02:00
dependabot[bot] ff3aadd134 build(deps): bump clap from 3.0.14 to 3.1.1
Bumps [clap](https://github.com/clap-rs/clap) from 3.0.14 to 3.1.1.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v3.0.14...v3.1.1)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 23:36:57 +02:00
relrelb ce6e90c027 avm1: Store `status` in `XmlObject`, instead of `ParseError`
The only use of `last_parse_error` was in the `XML.prototype.status`
property, where it was converted into a number. Avoid storing it by
storing just the number.
2022-02-21 23:21:14 +02:00
dependabot[bot] befa2a36cd build(deps): bump sha2 from 0.10.1 to 0.10.2
Bumps [sha2](https://github.com/RustCrypto/hashes) from 0.10.1 to 0.10.2.
- [Release notes](https://github.com/RustCrypto/hashes/releases)
- [Commits](https://github.com/RustCrypto/hashes/compare/sha2-v0.10.1...sha2-v0.10.2)

---
updated-dependencies:
- dependency-name: sha2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 22:56:23 +02:00
dependabot[bot] 8597b35b6c build(deps): bump enum-map from 2.0.1 to 2.0.2
Bumps [enum-map](https://gitlab.com/KonradBorowski/enum-map) from 2.0.1 to 2.0.2.
- [Release notes](https://gitlab.com/KonradBorowski/enum-map/tags)
- [Changelog](https://gitlab.com/KonradBorowski/enum-map/blob/master/CHANGELOG.md)
- [Commits](https://gitlab.com/KonradBorowski/enum-map/commits/master)

---
updated-dependencies:
- dependency-name: enum-map
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 22:55:54 +02:00
dependabot[bot] 6bb49e6420 build(deps): bump webbrowser from 0.5.5 to 0.6.0
Bumps [webbrowser](https://github.com/amodm/webbrowser-rs) from 0.5.5 to 0.6.0.
- [Release notes](https://github.com/amodm/webbrowser-rs/releases)
- [Changelog](https://github.com/amodm/webbrowser-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/amodm/webbrowser-rs/compare/v0.5.5...v0.6.0)

---
updated-dependencies:
- dependency-name: webbrowser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 22:55:39 +02:00
relrelb 2ca62ecf4b web: Remove tests on Node.js 14
There seems to be no good reason for testing on Node.js other than
the current LTS. Moreover, npm@6 has a wontfix issue when upgrading
to 8.4 on Windows, which requires a complex workaround: https://github.com/npm/cli/issues/4341#issuecomment-1040608101.

So avoid it by simply not supporting it.
2022-02-18 17:01:09 +02:00
relrelb 4037707ce5 ci: Migrate to Windows Server 2022
Per https://github.com/actions/virtual-environments/issues/4856,
`windows-latest` will default to `windows-2022` soon (not later than
March, 6). Since it seems like we still run on `windows-2019`, force the
migration by specifying `windows-2022` explicitly.

Since https://github.com/actions/virtual-environments/pull/5050 is
merged, this should fix the failing Web tests on mismatched Chrome and
chromedriver versions.

TODO: Once `windows-latest` defaults to `windows-2022` (again, March, 6),
change back to `windows-latest`.
2022-02-16 22:11:35 -07:00
dependabot[bot] 40f356a385 build(deps): bump rand from 0.8.4 to 0.8.5
Bumps [rand](https://github.com/rust-random/rand) from 0.8.4 to 0.8.5.
- [Release notes](https://github.com/rust-random/rand/releases)
- [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand/compare/0.8.4...0.8.5)

---
updated-dependencies:
- dependency-name: rand
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-14 22:34:09 +02:00