Commit Graph

2518 Commits

Author SHA1 Message Date
David Wendt 4c1489a814 Promote bytes to signed representation before pushing.
For whatever reason, `pushbyte` appears to be processed as a *signed* byte, despite the clear wording of "*byte_value* is an unsigned byte" in avm2overview.pdf. I guess it's supposed to be manually converted and promoted in this manner.
2020-08-10 16:38:04 -07:00
David Wendt 736a94a244 Implement numerical coercions according to ECMA-262 3rd Edition spec. 2020-08-10 16:38:04 -07:00
David Wendt 24fd30652d Allow tracing numbers to the console. 2020-08-10 16:38:04 -07:00
David Wendt 60f9613365 Implement and test for `convert_b`. 2020-08-10 16:38:04 -07:00
David Wendt 6cf48eb543 Implement and test `not`. 2020-08-10 16:38:04 -07:00
David Wendt b972c24f7e Oh look, I figured out how to emit `istrue`, so that's tested, too. 2020-08-10 16:38:04 -07:00
David Wendt 850ebc88a2 Add test for truthiness.
As compiled by Adobe Animate CC 2020, this test appears to only use `iffalse`. However, both `op_is_false` and `op_is_true` coerce in the same manner, so I'm not entirely sure this is a problem for now.
2020-08-10 16:38:04 -07:00
David Wendt e5c8c5b340 Expose `Infinity` to AS3. 2020-08-10 16:38:04 -07:00
David Wendt 5bb8c1836f Replace `as_bool` with `coerce_to_bool`.
Functions that need to assert Boolness without coercion should either:

1. Ensure their function declaration requires a Boolean. (We don't enforce type errors on ES4 typehints yet, but we should.)
2. Check the value type themselves and raise their own errors if necessary.

As it stands the only users of `as_bool` either needed to check the type themselves or use `coerce_to_bool`. Notably, `setPropertyIsEnumerable` doesn't appear to coerce *or* throw an error: it instead fails silently if you hand it a non-`Boolean` value.
2020-08-10 16:38:04 -07:00
David Wendt 95ca978034 f64 constants in ABC files are not stored in Flash mixed-endian. 2020-08-10 16:38:04 -07:00
dependabot-preview[bot] 04b146ffc4 build(deps): bump enumset from 1.0.0 to 1.0.1
Bumps [enumset](https://github.com/Lymia/enumset) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/Lymia/enumset/releases)
- [Changelog](https://github.com/Lymia/enumset/blob/master/RELEASES.md)
- [Commits](https://github.com/Lymia/enumset/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-09 13:15:38 -07:00
dependabot-preview[bot] 178178d9dd build(deps): bump indexmap from 1.5.0 to 1.5.1
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/bluss/indexmap/releases)
- [Commits](https://github.com/bluss/indexmap/compare/1.5.0...1.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-08 13:37:32 -07:00
dependabot-preview[bot] 962187bb89 build(deps-dev): bump @wdio/static-server-service in /web
Bumps [@wdio/static-server-service](https://github.com/webdriverio/webdriverio) from 6.1.14 to 6.4.0.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v6.1.14...v6.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-06 17:12:04 -07:00
dependabot-preview[bot] 40e92616cd build(deps-dev): bump @wdio/mocha-framework from 6.3.6 to 6.4.0 in /web
Bumps [@wdio/mocha-framework](https://github.com/webdriverio/webdriverio) from 6.3.6 to 6.4.0.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v6.3.6...v6.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-06 17:11:52 -07:00
dependabot-preview[bot] 629177372f build(deps-dev): bump @wdio/sync from 6.3.6 to 6.4.0 in /web
Bumps [@wdio/sync](https://github.com/webdriverio/webdriverio) from 6.3.6 to 6.4.0.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v6.3.6...v6.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-06 17:11:41 -07:00
dependabot-preview[bot] f67733f6f2 build(deps-dev): bump @wdio/local-runner from 6.3.6 to 6.4.0 in /web
Bumps [@wdio/local-runner](https://github.com/webdriverio/webdriverio) from 6.3.6 to 6.4.0.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v6.3.6...v6.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-06 17:11:28 -07:00
dependabot-preview[bot] 3bc0a66dd7 build(deps-dev): bump @wdio/spec-reporter from 6.3.6 to 6.4.0 in /web
Bumps [@wdio/spec-reporter](https://github.com/webdriverio/webdriverio) from 6.3.6 to 6.4.0.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v6.3.6...v6.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-06 17:11:17 -07:00
dependabot-preview[bot] 8c9aec93e2 build(deps-dev): bump @wdio/cli from 6.3.6 to 6.4.0 in /web
Bumps [@wdio/cli](https://github.com/webdriverio/webdriverio) from 6.3.6 to 6.4.0.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v6.3.6...v6.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-06 17:11:06 -07:00
Mike Welsh 94771a49c6 desktop: Rollback to winit 0.22.1 (fix #757 and #980) 2020-08-06 15:11:07 -07:00
dependabot-preview[bot] 29060984e2 build(deps-dev): bump mocha from 8.1.0 to 8.1.1 in /web
Bumps [mocha](https://github.com/mochajs/mocha) from 8.1.0 to 8.1.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/v8.1.0...v8.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-05 16:34:07 -07:00
dependabot-preview[bot] 53d32d4dac build(deps): bump num_enum from 0.5.0 to 0.5.1
Bumps [num_enum](https://github.com/illicitonion/num_enum) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/illicitonion/num_enum/releases)
- [Commits](https://github.com/illicitonion/num_enum/compare/0.5.0...0.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-05 16:00:27 -07:00
dependabot-preview[bot] 0c7edda6c2 build(deps): bump syn from 1.0.37 to 1.0.38
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.37 to 1.0.38.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.37...1.0.38)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-05 15:59:02 -07:00
unknown 47a8eb6f3e avm1: Copy broadcast functions for MovieClipLoader 2020-08-04 07:02:14 -07:00
dependabot-preview[bot] f8aa185c3e build(deps): bump syn from 1.0.36 to 1.0.37
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.36 to 1.0.37.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.36...1.0.37)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-03 16:57:45 -07:00
dependabot-preview[bot] d05a8af32b build(deps): bump lyon from 0.15.9 to 0.16.0
Bumps [lyon](https://github.com/nical/lyon) from 0.15.9 to 0.16.0.
- [Release notes](https://github.com/nical/lyon/releases)
- [Changelog](https://github.com/nical/lyon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nical/lyon/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-03 11:32:00 -07:00
Mike Welsh 9dd809d881
avm: Refactor Activation and UpdateContext (merge #938) 2020-08-03 11:31:29 -07:00
Mike Welsh 42f138592b chore: Bump CircleCI to Rust 1.45.1 and clear cache 2020-08-01 23:44:31 -07:00
David Wendt 8cb6e4af39 Further adjustments that fell through before. 2020-08-01 16:11:11 -04:00
David Wendt 4dbd26807e Remove useless lifetime in `notify_system_listeners` 2020-08-01 15:49:29 -04:00
David Wendt 8ebf5405e2 Move AVM2 into the UpdateContext. 2020-08-01 15:49:29 -04:00
David Wendt bfa5f8ae35 Further compilation fixes necessary to get the refactor to compile again.
Notably, all of the `Avm1` "run stack frame" functions can no longer take a self parameter as the update context they will be getting also has that same parameter. Ergo, they're associated functions that get the moral equivalent of self from the update context.

This also introduces a new `Activation::from_stub` which creates a stub frame that runs everything on the main movie in layer 0. This significantly reduces boilerplate code elsewhere in the project.
2020-08-01 15:49:28 -04:00
David Wendt 9b089ae1d7 Convert `array.rs` to the new activation-only format.
This also removes the function parameter on `sort_compare_numeric`. As it was only being used for string comparisons, and it was causing unfixable lifetime issues, I have instead had it take the case-sensitivity flag and call the two functions it would have been passed anyway. This fixes the lifetime issue.
2020-08-01 15:49:26 -04:00
David Wendt a19595c8b4 Embed `UpdateContext` in `Activation` directly.
The process of constructing an `Activation` now involves calling `UpdateContext.reborrow`, which "sheds" a lifetime by copying all of the borrows into a new "owned" context with that lifetime.

Likewise, to call out to functions that don't need an `Activation`, just borrow the context out of the current activation. You can also construct child-frame activations by reborrowing the parent activation's context.
2020-08-01 15:49:19 -04:00
David Wendt 7c7b019087 Move AVM1 inside UpdateContext. 2020-08-01 13:44:04 -04:00
David Wendt 14bfbc358f wip: Move UpdateContext into Activation 2020-08-01 13:33:04 -04:00
David Wendt 9f76a7b964 Ensure that `Player` always has a movie in level zero, even if no movie has been queued up yet.
There is a race condition inadvertently caused by allowing movies to be fetched in slot 0: it is possible for the player to be caught mid-load without a root movie. A lot of code assumes level 0 always exists (e.g. `levels.get(0).unwrap()`), while our initialization methods assumed no Player methods would be called until the root movie is installed. This is an unreasonable assumption, as among other things users can trigger the race condition by just playing the movie too quickly.
2020-08-01 02:35:00 -07:00
Nathan Adams 26b14bd904 avm1: Undone some __constructor__ setting on objects that don't actually construct 2020-08-01 02:33:14 -07:00
Nathan Adams db4f5007f3 avm1: TObject::create_bare_object doesn't use or need args 2020-08-01 02:33:14 -07:00
Nathan Adams 79af3ffe44 avm1: Rename TObject::new to TObject::create_bare_object 2020-08-01 02:33:14 -07:00
Nathan Adams 2131f7860b avm1: Change Object::construct to create and return a new object, instead of requiring the caller to do that first 2020-08-01 02:33:14 -07:00
Nathan Adams e74d4f0abb avm1: Make FunctionObject::allocate_function require prototype, it's not optional 2020-08-01 02:33:14 -07:00
Nathan Adams fb7fb6f99a avm1: Make FunctionObject::functional require prototype, it's not optional 2020-08-01 02:33:14 -07:00
Nathan Adams 9123d92513 avm1: Make FunctionObject::constructor require prototype, it's not optional 2020-08-01 02:33:14 -07:00
Nathan Adams 691e3b6804 avm1: Make FunctionObject::function_and_constructor require prototype, it's not optional 2020-08-01 02:33:14 -07:00
Nathan Adams 88a31cc5a9 avm1: Ensure we call movie constructors through Function::construct, not manually, to set __constructor__ 2020-08-01 02:33:14 -07:00
Nathan Adams 69a4d10338 avm1: Replace manual constructor calling with Function::construct, to ensure we set __constructor__ 2020-08-01 02:33:14 -07:00
Nathan Adams 2faf35d43e avm1: Set __constructor__ in Function::construct 2020-08-01 02:33:14 -07:00
dependabot-preview[bot] d9c8c43cf3 build(deps-dev): bump eslint from 7.5.0 to 7.6.0 in /web
Bumps [eslint](https://github.com/eslint/eslint) from 7.5.0 to 7.6.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.5.0...v7.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-01 01:18:25 -07:00
dependabot-preview[bot] 5e804fe041 build(deps): bump wasm-bindgen-test from 0.3.15 to 0.3.17
Bumps [wasm-bindgen-test](https://github.com/rustwasm/wasm-bindgen) from 0.3.15 to 0.3.17.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-31 10:31:21 -07:00
dependabot-preview[bot] 13830cbdba build(deps-dev): bump mocha from 8.0.1 to 8.1.0 in /web
Bumps [mocha](https://github.com/mochajs/mocha) from 8.0.1 to 8.1.0.
- [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/v8.0.1...v8.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-30 15:28:36 -07:00