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
David Wendt
ee4b47d062
Add interface support, and add interface checking to `ActionInstanceOf`.
2019-12-15 13:17:41 -08:00
David Wendt
ca93bba5c1
Implement ActionExtends.
2019-12-15 13:14:21 -08:00
Mike Welsh
81e5c7ba1d
core: Rename get_length etc. -> length
2019-12-15 12:33:24 -08:00
Mike Welsh
bc42004db5
core: Implement From for Object variants to Value/ReturnValue
2019-12-15 12:33:24 -08:00
Nathan Adams
133a1c3c91
core: Interacting with memebers on something that isn't an object isn't a hard error
2019-12-15 12:33:24 -08:00
Nathan Adams
aca746eee7
core: Implemented Array.splice with tests
2019-12-15 12:33:24 -08:00
Nathan Adams
31b84c5f19
core: Made arrays a storage property of objects, not a unique object type. Added more corner case tests.
2019-12-15 12:33:24 -08:00
Nathan Adams
3bdf710af6
core: Add another array.concat test
2019-12-15 12:33:24 -08:00
Nathan Adams
32a1eda080
core: Implement Arrays & array prototype
2019-12-15 12:33:24 -08:00
Nathan Adams
46b6ce570b
core: Added array tests
2019-12-15 12:33:24 -08:00
Mike Welsh
3c83d9ac9d
docs: Shuffle some docs in DisplayObject
2019-12-15 10:17:33 -08:00
Mike Welsh
95755b5fb3
tests: Add test for TransformedByScript flag
2019-12-15 10:17:33 -08:00
Mike Welsh
d7393dc81d
core: Add DisplayObjectFlags::TransformedByScript
...
This is set when a DisplayObject is dynamically moved by AS code,
which causes further modification from PlaceObject tags to be
ignored.
2019-12-15 10:17:33 -08:00
Mike Welsh
f6c50efe5a
tests: Clean up stage_object_propreties and add _name and _target
2019-12-15 10:17:33 -08:00
Mike Welsh
8c27097240
core: Implement _target property
...
Add DisplayObject::slash_path to get the Flash 4-style slash path
to the clip. This fixes the tellTarget regression test and removes
the superfluous `target_path` from `UpdateContext`.
2019-12-15 10:17:33 -08:00
Mike Welsh
d5f7521061
core: Ignore NaN in StageObject setters
2019-12-15 10:17:33 -08:00
Mike Welsh
e36dbad7d2
tests: Add stage_object_properties test
2019-12-15 10:17:33 -08:00
Mike Welsh
c9864eb557
core: Add StageObject properties
2019-12-15 10:17:33 -08:00
Mike Welsh
3986a8dc4a
tests: Add regression test for display object properties
2019-12-15 08:54:26 -08:00