Commit Graph

1223 Commits

Author SHA1 Message Date
Mike Welsh 1476930e0c avm1: Implement MovieClip.removeMovieClip 2019-12-17 03:20:01 -08:00
Mike Welsh 1668e823e6 avm1: Implement MovieClip.createEmptyMovieClip 2019-12-17 03:02:07 -08:00
Mike Welsh d33a8278d7 avm1: Implement MovieClip.duplicateMovieClip 2019-12-17 03:00:56 -08:00
Mike Welsh 009da39f12 avm1: Implement MovieClip.attachMovie 2019-12-17 03:00:56 -08:00
Mike Welsh d0504104b7 core: Use i32 for display object depth 2019-12-17 02:48:55 -08:00
Mike Welsh 4cb2cefc5b swf: Switch depth to u16 2019-12-17 02:48:55 -08:00
Mike Welsh 0f3bad8f1b core: Wrap Font in a Gc 2019-12-17 02:48:55 -08:00
Mike Welsh 289e0b8aff core: Handle ExportAssets SWF tag 2019-12-16 19:32:34 -08:00
Mike Welsh 24d8fa6298 swf: Add public method for read_export_assets 2019-12-16 19:32:34 -08:00
Mike Welsh b6df9fded0 core: Remove boxes from library items 2019-12-16 19:32:34 -08:00
Nathan Adams 45e497826b avm1: Implement `Mouse` listeners & events (excluding scroll) 2019-12-16 19:22:10 -08:00
Mike Welsh c2f4633cdb avm1: Trace constant_pool in Collect for Activation 2019-12-16 16:14:49 -08:00
Mike Welsh c61842a72a tests: Add test for slash syntax 2019-12-16 15:33:57 -08:00
Mike Welsh f270a278c0 avm1: Push Undefined on GetVariable with invalid slash path 2019-12-16 15:33:16 -08:00
Mike Welsh 8b85212513 avm1: Handle .. in slash syntax 2019-12-16 15:24:25 -08:00
Mike Welsh f4f755e958 avm1: Remove warnings on _currentframe/_totalframe 2019-12-16 10:21:37 -08:00
Nathan Adams 84ff69854a avm1: Pass mouse events down to movie clips 2019-12-16 10:11:23 -08:00
Nathan Adams c8e42123cf avm1: Implemented `_xmouse` and `_ymouse` 2019-12-16 10:11:23 -08:00
Nathan Adams 783037e8cc chore: Removed array debug code that snuck in. Oops! 2019-12-16 09:56:46 -08:00
dependabot-preview[bot] 76413dd3c6 build(deps): bump serde from 1.0.103 to 1.0.104
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.103 to 1.0.104.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.103...v1.0.104)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-16 17:56:19 +00:00
dependabot-preview[bot] d2cf865ebf build(deps-dev): bump webpack from 4.41.2 to 4.41.3 in /web/selfhosted
Bumps [webpack](https://github.com/webpack/webpack) from 4.41.2 to 4.41.3.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.41.2...v4.41.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-16 17:55:53 +00:00
Mike Welsh e4af2502dc avm1: Fix mismatched action/init_action stack frames
DoAction was accidentally creating its stack frame using
Avm1::insert_stack_frame_for_init_action, causing a dummy
Undefined to be pushed and blowing out the stack.
2019-12-16 01:14:06 -08:00
Mike Welsh b2cdc19f55 tests: Add test for goto MovieClip methods 2019-12-16 00:52:27 -08:00
Mike Welsh bf0b777246 avm1: Use ECMA-262 ToInt32 modulo behavior
Everything is a double in ES land, so when converting a number to
int, the double is modulo'd to allow for wrapping 32-bit int
semantics.

See ToInt32 and ToUInt32 in the specs:
https://www.ecma-international.org/publications/files/ECMA-ST-ARCH/ECMA-262,%202nd%20edition,%20August%201998.pdf
2019-12-16 00:52:27 -08:00
Mike Welsh 39f54b4a16 avm1: Add gotoAndPlay and gotoAndStop MovieClip methods 2019-12-16 00:52:27 -08:00
Mike Welsh a3e316847b core: Clamp goto frame in range 2019-12-16 00:52:27 -08:00
Mike Welsh fa5a168fad avm1: Clean up MovieClip prototype 2019-12-16 00:52:27 -08:00
Mike Welsh 7f5d2923be
avm1: Initial clip event implementation (merge #152)
Initial clip event implementation: load, enterFrame, and unload are functional.
2019-12-15 20:21:44 -08:00
Mike Welsh 46365c5702 avm1: Implement clip event method callbacks 2019-12-15 20:01:50 -08:00
Mike Welsh eb3aa1c878 core: Move `ClipAction` into crate::events 2019-12-15 19:22:23 -08:00
Mike Welsh 1fe170400c tests: Add clip_events regression test 2019-12-15 19:22:23 -08:00
Mike Welsh 76e94dda1c core: Implement "unload" clip event
Fire unload clip event when a movie clip is removed. Added
`ActionType` enum used by `ActionQueue::queue_actions` that
determines the type of action that is running (replaces `is_init`
parameter).
2019-12-15 19:00:16 -08:00
Mike Welsh 38ebdd9d05 core: Fire "load" and "enterFrame" clip events
MovieClips will now fire their "load" and "enterFrame" clip events.
Added `MovieClipFlags` to store various flags for the movie clip.
2019-12-15 19:00:16 -08:00
Mike Welsh da13b36e47 swf: Use EnumSet for ClipEventFlag 2019-12-15 19:00:16 -08:00
Mike Welsh f55e8036bb
avm1: Merge #147, AS2 OOP operations
ActionScript 2 OOP operations
2019-12-15 14:44:31 -08:00
Mike Welsh 174426856f avm1: Use `EnumSet::from_bits` in `object::as_set_prop_func` 2019-12-15 14:26:43 -08:00
David Wendt d9aac0f2cf Adjust `SuperObject` based on actual Flash behavior. 2019-12-15 13:32:04 -08:00
David Wendt edf7a19eb7 Implement `Function.prototype.toString`. 2019-12-15 13:32:04 -08:00
David Wendt 33c66571f5 Allow `is_instance_of` to inspect the prototype chains of implemented interfaces.
This makes the `extends_chain` test pass.
2019-12-15 13:32:04 -08:00
David Wendt 854526923e Calls to `super` inherently bind to itself.
This requires some subclassing nonsense to be able to smuggle a self-reference into `SuperObject`s. When successfully smuggled, all calls to `call` will be invoked with the `super` object as `this`. This allows constructor chaining to work.

Note that not all `Object` trait methods are implemented on `SuperObject`, so things like `delete this.x` in super constructors will randomly fail. This should be fixed.
2019-12-15 13:32:04 -08:00
David Wendt 548f19ffbb `ActionExtends` uses the class's explicit prototype, not it's implicit prototype which should almost always be `Function.prototype`. 2019-12-15 13:32:04 -08:00
David Wendt eb06501492 Since `get_local` doesn't scale the prototype chain anymore, we don't need to change the prototype chain traversal anymore. 2019-12-15 13:32:04 -08:00
David Wendt e08cfcd288 Enable the `as2-oop` test since it now passes. 2019-12-15 13:32:04 -08:00
David Wendt 5c1ac19c1b Implement `super`, mostly.
We implement `super` by way of a new `Object` impl which wraps arbitrary objects with a modified prototype chain. Specifically, the lowest layer of the prototype chain is omitted. This new `SuperObject` script is composable: a chain of two `SuperObject`s will go two levels of inheritance upwards while still maintaining non-prototype property access.
2019-12-15 13:32:04 -08:00
David Wendt 681b4adfa4 Functions close over the constant pool they were defined with. 2019-12-15 13:17:41 -08:00
David Wendt 71d9655f6d Implement `ASSetPropFlags` 2019-12-15 13:17:41 -08:00
David Wendt d173e91de6 AS2 OOP test. This won't actually pass until we have interfaces, init actions, and constant pool closures merged in. Hence, it's ignored. 2019-12-15 13:17:41 -08:00
David Wendt 213b3cfca1 Store implemented interfaces on the prototype, not the constructor, so that InstanceOf can get at them. 2019-12-15 13:17:41 -08:00
David Wendt fcb37bd273 Implement `ActionCastOp`. 2019-12-15 13:17:41 -08:00
David Wendt 1b459f522d Implement `ActionImplementsOp`.
This commit title has won the "World's Lowest-Entropy Commit Title" award for 2019.
2019-12-15 13:17:41 -08:00