Commit Graph

451 Commits

Author SHA1 Message Date
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
Mike Welsh d30506dc59 tests: Add test for enumerating child instances 2019-12-15 08:54:26 -08:00
Mike Welsh f2422a2c9f avm1: Add attributes for _global/_root/_parent 2019-12-15 08:54:26 -08:00
Mike Welsh 11f2b46b6a tests: Add test for stage instances 2019-12-15 08:54:26 -08:00
Mike Welsh c29b042f5e avm1: Get child clip instances in StageObject
Add the logic to get children display objects as properties in
`StageObject`.
2019-12-15 08:54:26 -08:00
Mike Welsh 783ede6f79 core: Add DisplayObject::path 2019-12-15 08:54:26 -08:00
Mike Welsh 73604a891e core: Move get_child_by_name to DisplayObject 2019-12-15 08:54:26 -08:00
David Wendt 724f845037 Remove the `DisplayNode` slot from `ScriptObject`, since all display node objects should be `StageObject`s now. 2019-12-15 08:54:26 -08:00
David Wendt fa9329df68 Instantiate all MovieClips as StageObjects. 2019-12-15 08:54:26 -08:00
David Wendt 3df6c7eeef Always post-instantiate display objects when running tests. 2019-12-15 08:54:26 -08:00
David Wendt 73655c0c88 Add a separate native object type for objects tied to the stage. 2019-12-15 08:54:26 -08:00
Mike Welsh f0c6b2d8d8 core: Remove this from Object::get/set 2019-12-15 08:54:26 -08:00
dependabot-preview[bot] 251fb01572 build(deps): bump jpeg-decoder from 0.1.17 to 0.1.18
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.1.17 to 0.1.18.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-11 18:21:42 +00:00
Mike Welsh b59bf40c78 core: Remove this from Object::get/set 2019-12-10 01:36:02 -08:00
Mike Welsh f7822141b7 core: Rename display_node methods to display_object 2019-12-10 01:36:02 -08:00
Mike Welsh 71e4eb87d7 core: Remove as_*_mut methods on DisplayObject/Object 2019-12-10 01:36:02 -08:00
Mike Welsh d7740bc3ad core: Don't touch UpdateContext::active_clip in DisplayObjects
DisplayObject code no longer has to manage
UpdateContext::active_clip before calling out to children, because
each child still has access to its Gc pointer.
2019-12-10 01:36:02 -08:00