David Wendt
3a7dd48c81
avm2: Build a flattened traits list per class and use that in lieu of a full trait lookup.
2021-12-02 16:30:21 -07:00
David Wendt
722dd6aabf
avm2: Refactor multiname resolution to take advantage of the new value storage structure.
2021-12-02 16:30:21 -07:00
David Wendt
c99231b610
avm2: Index the property map by local name and bucket all namespaces together into a single list.
2021-12-02 16:30:21 -07:00
David Wendt
0bc2ddfc7b
avm2: Remove prototype lookups from `resolve_any`
2021-12-02 16:30:21 -07:00
David Wendt
d83a7c909c
avm2: Don't scan the prototype for each multiname check.
2021-12-02 16:30:21 -07:00
David Wendt
fa179dc63f
avm2: Unpublish a bunch of primclass methods
2021-11-28 18:40:21 -07:00
David Wendt
6d48126124
avm2: And, finally, `uint`.
2021-11-28 18:40:21 -07:00
David Wendt
640763bfda
avm2: Also do the same for `int`
2021-11-28 18:40:21 -07:00
David Wendt
593158cb04
avm2: Also allow calling `Number` methods on the prototype in the `public` namespace.
2021-11-28 18:40:21 -07:00
David Wendt
6bfca1af5f
avm2: Expose `Boolean` methods in the `public` namespace via prototypes.
2021-11-28 18:40:21 -07:00
David Wendt
3e8f13b70a
avm2: `Number.MIN_VALUE` is the machine epsilon, not the lowest possible finite value.
2021-11-28 18:40:21 -07:00
David Wendt
7569994f1f
avm2: Impl `Boolean.toString` and `Boolean.valueOf`.
2021-11-28 18:40:21 -07:00
David Wendt
aa01a682e1
avm2: Implement `uint`'s various formatting methods, too.
2021-11-28 18:40:21 -07:00
David Wendt
e43d18f7b0
avm2: Impl `int` versions of `toFixed`, `toString`, `toExponential`, and `toPrecision`
2021-11-28 18:40:21 -07:00
David Wendt
cabfe5e20c
avm2: All documented primitive class methods are in the AS3 namespace.
2021-11-28 18:40:21 -07:00
David Wendt
9e62b05157
avm2: Implement `Number.AS3::toString` and `Number.AS3::valueOf`.
...
This method has an odd flaw that we don't emulate yet. Actually, two:
1. Precision limits that are specific to the chosen radix
2. Occasional and intermittent corruption in the resulting 0 padding; usually manifesting as `x`, `W`, or `°` characters
The first could be emulated, but I've chosen not to... because the second thing listed not only isn't really possible to emulate, but actively prohibits approx-testing the results. So I'm marking the test as ignored and hoping no movies actually rely on the precision limits in `toString`.
2021-11-28 18:40:21 -07:00
David Wendt
4a09dfa3d0
avm2: Implement `Number.toFixed` and `Number.toPrecision`
2021-11-28 18:40:21 -07:00
David Wendt
55a7a1882d
avm2: Implement `Number.toExponential`
2021-11-28 18:40:21 -07:00
David Wendt
16597e0d7b
avm2: Fill out class constants for `uint`, `int`, and `Number`.
2021-11-28 18:40:21 -07:00
Varun Ramesh
7c87f35d8d
avm2: Implement `flash.display.PixelSnapping` ( #5718 )
...
* Add flash.display.PixelSnapping enum class
* Run 'cargo format --all'
* Add 'final' class attribute
2021-11-28 07:31:39 +02:00
Moulins
9701b817f5
core: Replace WStr<'_> and WStrMut<'_> by a single DST type WStr
2021-11-27 11:20:47 -07:00
Moulins
ee326e31b7
core: Reduce allocations in AvmString::new_utf8
...
Also remove some useless back-and-forth conversions between
AvmString and String
2021-11-27 11:20:47 -07:00
Moulins
fa30e1bc43
chore: rename AvmString::{new -> new_utf8, new_ucs2 -> new}
2021-11-27 11:20:47 -07:00
Moulins
45fe1e86ae
core: remove AvmString::as_str, and the extra UTF8 String inside
2021-11-27 11:20:47 -07:00
Moulins
e24af59197
core: remove last instances of AvmString::as_str
2021-11-27 11:20:47 -07:00
Moulins
824263d2bc
core: adapt TextField, Font & Html handling code to use WStr
2021-11-27 11:20:47 -07:00
Moulins
f149c9efce
core: remove some AvmString::as_str calls
2021-11-27 11:20:47 -07:00
Moulins
053758d77c
avm2: use WString in QName methods
2021-11-27 11:20:47 -07:00
Moulins
5ca911209b
core: implement WStr::join
2021-11-27 11:20:47 -07:00
Moulins
87400b829d
core: use WStrings for display object's frame and scene labels
2021-11-27 11:20:47 -07:00
Moulins
84b4e33036
core: implement FromWStr for various enum types
2021-11-27 11:20:47 -07:00
Moulins
5db23ddbf3
avm2: use WStr in date parsing logic
2021-11-27 11:20:47 -07:00
Moulins
f49ce49d28
core: add FromWStr trait and WStr::parse
2021-11-27 11:20:47 -07:00
Moulins
d850085d2b
avm1: partially rewrite Value::primitive_as_number
2021-11-27 11:20:47 -07:00
Moulins
4a09088d42
avm2: rewrite regexp module to not rely on AvmString::as_str
...
This is a little tricky, because we have to map the utf8 indices
returned by the regex engine to utf16 indices usable by Ruffle.
To limit the impact on performance, the regex, the string we're
currently matching on, and the last known (utf8, utf16) positions
are cached, avoiding extra utf8 conversions in common use cases
where a single string is repeatedly searched with increasing
`lastIndex`.
2021-11-27 11:20:47 -07:00
Moulins
110f568aa4
core: Remove some useless utf8<->utf16 conv. in {avm1,avm2}/activation.rs
2021-11-27 11:20:47 -07:00
Moulins
8885175550
core: Replace string::utils *_ignore_case functions by methods on WStr
2021-11-27 11:20:47 -07:00
Moulins
7f4af210b8
core: Reimplement AVM string methods using our UCS2 API
...
This generally means that methods are more efficient, as we
don't need to encode to UTF16 on-the-fly to have correct indices.
This also fix some bugs:
- charCode now properly handle surrogate pairs
- calling lastIndexOf with the empty pattern and an OoB index now
properly returns the string length
Still missing is AVM2's String.match
2021-11-27 11:20:47 -07:00
relrelb
e2b821e92f
chore: Replace `min` + `max` with `clamp`
...
`clamp` is a bit more efficient, in both runtime and size terms.
2021-11-26 20:54:48 +02:00
Adrian Wielgosik
da4ed75bc8
avm2: Compare QNames by local name first
2021-11-22 17:59:00 -07:00
Adrian Wielgosik
c2d521df41
avm2: refactor: Merge has-setter-and-no-getter into one lookup
2021-11-22 17:59:00 -07:00
Adrian Wielgosik
370186dc3c
avm2: refactor: Make trait lookups return a single item
2021-11-22 17:59:00 -07:00
relrelb
3760e0e275
core: De-duplicate `round_to_even` function
...
Put a single implementation in `ecma_conversions.rs`.
Need to consider what to do with the similar implementation in `matrix.rs`.
2021-11-20 13:36:06 +02:00
relrelb
7c6d006862
avm2: Correct `TextFormat` properties coercion
2021-11-20 13:36:06 +02:00
David Wendt
068e7acc6f
avm2: Remove the need for `lazy_static`
2021-11-19 20:43:53 -07:00
David Wendt
dda8a73899
avm2: Refactor so we don't need to rebox and unbox the numbers into values.
...
Also, use an actual constant table for the ellipsises.
2021-11-19 20:43:53 -07:00
David Wendt
4665a6c210
avm2: None of `Graphics`' methods need to be `pub`.
2021-11-19 20:43:53 -07:00
David Wendt
c719e69693
avm2: Also implement `drawEllipse` using `drawRoundRect`.
2021-11-19 20:43:53 -07:00
David Wendt
ef46d780ba
avm2: Implement `Graphics.drawCircle` using `drawRoundRect`
2021-11-19 20:43:53 -07:00
David Wendt
b318eb9969
avm2: Implement `Graphics.drawRoundRect`
2021-11-19 20:43:53 -07:00
David Wendt
c0874f445d
avm2: Functions are functions.
2021-11-11 17:12:49 -07:00
David Wendt
7dd9776d40
avm2: Implement `uint`, `Number`, and `Boolean`'s constructors, too.
2021-11-11 16:34:11 -07:00
David Wendt
7cc7f0fe7f
avm2: Impl `int`'s instance initializer.
2021-11-11 16:34:11 -07:00
David Wendt
be3e126ebb
avm2: Stub the `Sprite` constructor as just creating a `MovieClip`.
2021-11-11 16:33:33 -07:00
Tal Hayon
7ed38850fd
core: implement displayState for Stage in avm1/2
2021-11-11 16:20:05 -07:00
relrelb
cf05137c1f
core: `EditText::html_text` cannot fail
2021-11-11 08:05:33 +02:00
relrelb
a900aae63e
core: Make `EditText::set_html_text` accept a `&str`
2021-11-11 08:05:33 +02:00
relrelb
0787662079
core: Make `EditText::set_text` accept a `&str`
2021-11-11 08:05:33 +02:00
David Wendt
67e7526517
avm2: `EventDispatcher` contains an undocumented `toString` method.
2021-11-10 18:16:26 -07:00
David Wendt
360ae1f044
avm2: Private classes in different scripts are allowed to share the same name without conflicting.
2021-11-10 17:43:02 -07:00
David Wendt
60eb88b326
avm2: Note currently incorrect behavior intended to be fixed in a future PR.
2021-11-09 17:28:33 -07:00
David Wendt
4cfa3253d5
avm2: Impl `Proxy`'s enumeration-related methods.
2021-11-09 17:28:33 -07:00
David Wendt
4289f89350
avm2: Split out enumerant values into a separate method as well.
2021-11-09 17:28:33 -07:00
David Wendt
297526269c
avm2: Allow objects to assign arbitrary enumerant indexes, by having objects drive the enumeration process rather than just counting from one
2021-11-09 17:28:33 -07:00
David Wendt
1170385c3b
avm2: Implement `Proxy.hasproperty`
2021-11-09 17:28:33 -07:00
David Wendt
427b2bf17a
avm2: Implement `Proxy.deleteproperty`
2021-11-09 17:28:33 -07:00
David Wendt
503dc08594
avm2: Refactor `Object.delete_property` to work similar to get/set
2021-11-09 17:28:33 -07:00
David Wendt
e67ca1afe0
avm2: Implement `Proxy.callproperty`
2021-11-09 17:28:33 -07:00
David Wendt
301fd1020f
avm2: Implement `Proxy.setproperty`
2021-11-09 17:28:33 -07:00
David Wendt
8f47f494e7
avm2: Implement `Proxy`'s `getproperty` behavior.
2021-11-09 17:28:33 -07:00
David Wendt
f05e92c974
avm2: Fix `RTQNameL`'s parameters being popped backwards
2021-11-09 17:28:33 -07:00
David Wendt
d225d03043
avm2: Implement `flash.utils.Proxy`
2021-11-09 17:28:33 -07:00
David Wendt
c78e5e31fd
core: Store `DisplayObjectBase` in `InteractiveObjectBase`.
...
This also necessitated removing the `impl_display_object` family of macros, as you cannot name a field of a field in a macro expression. I tried. So instead I've reverted to standard default method inheritance, in the same way we did with AVM2 objects.
2021-11-09 16:48:29 -07:00
David Wendt
e71c749db5
avm2: Implement accessors for new `InteractiveObject` flags.
2021-11-09 16:48:29 -07:00
relrelb
89718475df
avm2: Introduce `TextFormatObject`
2021-11-09 16:21:35 -07:00
relrelb
9308513ae8
chore: Appease clippy
2021-11-06 10:44:01 +02:00
David Wendt
6c7d10e4d4
avm2: Requests for instance traits instead resolve to an associated public-namespace method
2021-11-02 16:54:38 -06:00
David Wendt
b0b1c79143
avm2: Split the `slot_id` and `disp_id` accessors.
2021-10-31 00:52:58 -07:00
David Wendt
0cc55df5ca
avm2: Remove `FINAL` flag and associated machinery as we now validate traits at class construction time.
2021-10-31 00:52:58 -07:00
David Wendt
a1be42abfb
avm2: Exempt system classes from class validation.
2021-10-31 00:52:58 -07:00
David Wendt
dd4717e08e
avm2: Move `final`/`override` check enforcement to class construction time.
...
This is an O(n^2) algorithm, which sucks, but at least it only runs once per class rather than per *object allocation*.
2021-10-31 00:52:58 -07:00
David Wendt
8d40e41ee1
avm2: Make `Executable` zero-alloc
2021-10-31 00:52:58 -07:00
David Wendt
cea3997396
avm2: Remove `superclass_object` and related parameters from `TObject.call` and other downstream functions.
...
Turns out there's a *lot* of downstream functions.
2021-10-31 00:52:58 -07:00
David Wendt
272b1784b8
avm2: Don't skip method binding in `callproperty` if the method requires `arguments`, as it may access `callee`.
2021-10-31 00:52:58 -07:00
David Wendt
1b5869e15a
avm2: Preserve ability to `callmethod` on slot IDs that have not yet been bound, by binding them at that time.
2021-10-31 00:52:58 -07:00
David Wendt
d0d19bcf38
avm2: Stop instantiating methods at object construction time.
2021-10-31 00:52:58 -07:00
David Wendt
bfbd2271b0
avm2: Allow uninstantiated methods to be created on-the-fly.
2021-10-31 00:52:58 -07:00
David Wendt
3562c50dee
avm2: `call_property` on classes should also call unbound methods
2021-10-31 00:52:58 -07:00
David Wendt
477add3dd0
avm2: Add `ClassObject` methods for pulling unbound methods or bound method objects from the class or instance.
2021-10-31 00:52:58 -07:00
David Wendt
9c031070b3
avm2: `ClassObject` should include class traits in `TObject` methods that reference the current object's traits.
2021-10-31 00:52:58 -07:00
David Wendt
74fb965301
avm2: Call methods directly if we can find a class with an instance trait matching it's name.
2021-10-31 00:52:58 -07:00
David Wendt
039777c41e
avm2: `Object.hasOwnProperty`, `propertyIsEnumerable`, and `setPropertyIsEnumerable` only work with public-NS properties.
2021-10-30 11:44:29 -06:00
EmperorBale
5ac8e75239
avm2: Make ObjectEncoding C-like
2021-10-25 16:32:55 -07:00
EmperorBale
bab74f83fc
avm2: Remove all unsafe from bytearray
2021-10-25 16:32:55 -07:00
EmperorBale
9126c9297c
avm2: Derive PartialEq and Eq for enums
2021-10-25 16:32:55 -07:00
EmperorBale
69f2002d2a
avm2: Add todo comment
2021-10-25 16:32:55 -07:00
EmperorBale
da601a4984
chore: Improve safety comments
2021-10-25 16:32:55 -07:00
EmperorBale
3b2a84ef9b
chore: Small cleanups
2021-10-25 16:32:55 -07:00
EmperorBale
b257e5537c
chore: Appease clippy
2021-10-25 16:32:55 -07:00
EmperorBale
42fe351c0d
avm2: Optimize readBytes & writeBytes by implementing write_at_within
2021-10-25 16:32:55 -07:00
EmperorBale
e86bdfdc3e
avm2: Remove unneeded condition
2021-10-25 16:32:55 -07:00
EmperorBale
3f3e600820
chore: Appease clippy
2021-10-25 16:32:55 -07:00
EmperorBale
83005a7ce5
avm2: Update flash-lso version
2021-10-25 16:32:55 -07:00
EmperorBale
efb3062d98
avm2: Add flash.net.ObjectEncoding
2021-10-25 16:32:55 -07:00
EmperorBale
e2c2ac8961
avm2: Implement ByteArray.readObject + flash.net.ObjectEncoding
2021-10-25 16:32:55 -07:00
EmperorBale
c191340972
avm2: Refactor readBytes & writeBytes
2021-10-25 16:32:55 -07:00
EmperorBale
67ffc7bcc8
avm2: Forward get_enumerant_name and property_is_enumerable to base when not found
2021-10-25 13:45:29 -07:00
Mike Welsh
8ae8de4d51
chore: Appease clippy
...
Squelch some false positives from `question_mark` and
`match_str_case_mismatch` lints.
2021-10-24 15:33:09 -07:00
Mike Welsh
3fc0209e03
chore: Appease clippy
2021-10-22 22:48:26 -07:00
David Wendt
5abb11482e
avm2: Make builtin class prototypes also instances of `Object`, with the sole exception of `Function`, whose prototype is an instance of it's class.
2021-10-22 20:12:48 -07:00
David Wendt
469f8cb9db
avm2: All prototypes are instances of `Object`, not their own class.
2021-10-22 20:12:48 -07:00
Adrian Wielgosik
c1850d0d54
avm2: Stub flash.net.SharedObject
...
Just enough for the following to not crash:
```
var so = SharedObject.getLocal("name");
so.data.stuff = "xyz";
so.flush();
trace(so.data.stuff);
```
2021-10-22 10:02:35 -07:00
Adrian Wielgosik
8cc00f32bb
chore: Stop using traits available in prelude
2021-10-21 10:24:05 -07:00
EmperorBale
70cbd13201
avm2: Global scope should be null instead of undefined by default
2021-10-19 18:39:41 -06:00
EmperorBale
903246d5af
chore: Appease clippy
2021-10-19 18:39:41 -06:00
EmperorBale
ab3ff34944
avm2: Derive Collect for NativeExecutable
2021-10-19 18:39:41 -06:00
EmperorBale
2a84b0cbbb
avm2: Instance traits and class traits should use seperate scopechains
2021-10-19 18:39:41 -06:00
EmperorBale
77bf5973a7
chore: Appease clippy
2021-10-19 18:39:41 -06:00
EmperorBale
1dd899a76f
avm2: Allow small mutations to ScopeChain
2021-10-19 18:39:41 -06:00
EmperorBale
9de7d7ba7a
chore: Add todo comment for callstatic
2021-10-19 18:39:41 -06:00
EmperorBale
a19488c048
chore: Cleanup comments
2021-10-19 18:39:41 -06:00
EmperorBale
d71188e80c
avm2: Change code_context to caller_domain
2021-10-19 18:39:41 -06:00
EmperorBale
4667921259
avm2: Push global scope when property is not found
2021-10-19 18:39:41 -06:00
EmperorBale
7e251cfe05
avm2: Add support for pushwith
2021-10-19 18:39:41 -06:00
EmperorBale
388fdbd513
avm2: Scope redesign
...
avm2: Update scopechain design
2021-10-19 18:39:41 -06:00
Mike Welsh
60f5dc2477
avm2: Implement SoundChannel.position
...
Fix various issues with `SoundChannel`:
* Change `avm2::Object::as_sound_instance` to `as_sound_channel`.
* Cache sound position in `SoundChannelObject`.
* `SoundInfo::in_sample` is in units of 44100Hz.
* Clamp `num_loops` to 1.
2021-10-16 22:53:25 -07:00
Mike Welsh
57be2397ef
avm2: Initialize slots to appropriate values when no default given
...
Slots and const traits should initialize to an appropriate value
for their type if no default is specified. Remove the `Option`
from `default_value`, and always set it to an appropriate null-ish
value (`0` for ints, `NaN` for `Number`, `null` for objects, etc.)
2021-10-10 14:01:36 -07:00
EmperorBale
34ecb32b85
avm2: Add custom implementations for get_enumerant_name and property_is_enumerable for VectorObject
2021-10-10 11:02:42 -07:00
EmperorBale
6eea0f2067
avm2: Add custom get_enumerant_name & property_is_enumerable implementations for ArrayObject
2021-10-10 11:02:42 -07:00
relrelb
4fcf0907ac
core: Remove `SwfSlice` usage from `MovieClip::new`
2021-10-08 13:22:45 -07:00
Moulins
4ad6e1e698
avm1: Propagate AvmString<'gc>s to all methods on Object
...
Some frequently-used Object methods have an Into<impl AvmString<'gc>>
parameter to reduce the size of the changes.
2021-10-06 19:47:35 -06:00
David Wendt
ee9341cb1c
avm2: Remove `is_boxed_primitive`, as we are no longer accepting boxed primitives on the stack.
2021-10-03 15:57:43 -07:00
David Wendt
f2e7457bc0
avm2: Move `QNameObject` specific methods behind an `as_qname_object` downcast.
2021-10-01 16:30:58 -06:00
David Wendt
aaca3460d4
avm2: `QName` overrides `toString` and `valueOf` in both namespaces
2021-10-01 16:30:58 -06:00
David Wendt
513965b624
avm2: `Function.call` and `Function.apply` need to be accessible in the public namespace.
...
We should be able to move the AS3 versions to traits, but that breaks two other tests.
2021-10-01 16:30:58 -06:00
David Wendt
273872e2ab
avm2: `Any` namespaces are represented as `*` in `QName`'s string form
2021-10-01 16:30:58 -06:00
David Wendt
294b0fc53e
avm2: Impl `QName`'s constructor and properties
2021-10-01 16:30:58 -06:00
David Wendt
5387b1a4e0
avm2: Add stub boxed `QName` object type and class
2021-10-01 16:30:58 -06:00
Adrian Wielgosik
5ce2266be7
chore: clippy
2021-09-27 11:03:48 +02:00
Adrian Wielgosik
87625fa302
avm2: Change core types from Object to ClassObject where possible
2021-09-27 11:03:48 +02:00
Adrian Wielgosik
83b7420a3f
avm2: Remove unneeded indirection from ClassObject methods
2021-09-27 11:03:48 +02:00
David Wendt
6753608e78
chore: Fix incorrect doccomment
2021-09-25 16:54:36 -06:00
David Wendt
c299f63784
avm2: Implement object space enumeration.
...
This required making enumerants into `Value`s, rather than `QName`s.
2021-09-25 16:54:36 -06:00
David Wendt
dbe9dffe0e
avm2: Implement object-space overrides for `getproperty`, `setproperty`, `deleteproperty`, and `in`.
2021-09-25 16:54:36 -06:00
David Wendt
925604f730
avm2: Implement `DictionaryObject` and `Dictionary`
2021-09-25 16:54:36 -06:00
EmperorBale
28b34cbe25
chore: Typo
2021-09-23 23:14:30 -06:00
EmperorBale
3f81910bb6
avm2: Remove custom_object macros
2021-09-23 23:14:30 -06:00
David Wendt
f298a23ec8
avm2: Ensure all bare function calls pull an appropriate `superclass_object`
2021-09-23 15:59:06 -06:00
David Wendt
7ef7b80395
avm2: Prototypes are not instances of their class
2021-09-23 15:59:06 -06:00
David Wendt
b8c086eb7a
avm2: Calls to object properties should use the new `call_property` method
2021-09-23 15:59:06 -06:00
David Wendt
7cefeb2b2a
avm2: Add a `constructprop` method for objects, too.
2021-09-23 15:59:06 -06:00
David Wendt
b07ad8070c
avm2: Make `get_property`, `set_property`, `init_property`, and various other derivative methods take a `Multiname` and run the search inside `Object`.
...
This also introduces a `call_property` method.
2021-09-23 15:59:06 -06:00
David Wendt
945cb2c4bf
avm2: Global class inheritance issues should report which class cannot be found
2021-09-23 15:59:06 -06:00
David Wendt
8f8134e4f4
avm2: Add private instance slots for `FrameLabel`'s properties
2021-09-23 15:59:06 -06:00
David Wendt
5ba2421225
avm2: Add private instance slots for `Scene`'s properties
2021-09-23 15:59:06 -06:00
David Wendt
97924d20ad
avm2: Add private instance slots for `Point`'s properties
2021-09-23 15:59:06 -06:00
David Wendt
dfc90984dc
avm2: Add private instance slots for `Rectangle`'s properties
2021-09-23 15:59:06 -06:00
David Wendt
81da1aad4b
avm2: `Video` is not a subclass of `flash.media.DisplayObject` (which doesn't exist)
2021-09-23 15:59:06 -06:00
EmperorBale
1874223224
avm2: Remove ignore_next
2021-09-23 00:01:50 +02:00
EmperorBale
31abe5d9d7
avm2: Specify that date should coerce to string by default
2021-09-23 00:01:50 +02:00
EmperorBale
64eb47a65c
avm2: Remove YearType
2021-09-23 00:01:50 +02:00
EmperorBale
bd6ca72510
avm2: Implement Date.parse
2021-09-23 00:01:50 +02:00
EmperorBale
10be7ef3bf
avm2: Implement toUTCString
2021-09-23 00:01:50 +02:00
EmperorBale
292a9bda4b
avm2: Implement toLocaleString, toLocaleTimeString, toDateString, toLocaleDateString
2021-09-23 00:01:50 +02:00
EmperorBale
b9fd7f5977
avm2: Implement toString, toTimeString
2021-09-23 00:01:50 +02:00
EmperorBale
931080cd49
avm2: Implement valueOf
2021-09-23 00:01:50 +02:00
EmperorBale
aca23b744e
chore: Appease clippy
2021-09-23 00:01:50 +02:00
EmperorBale
7f8e01b426
avm2: Implement UTC
2021-09-23 00:01:50 +02:00
EmperorBale
453486265f
avm2: Implement timezoneOffset
2021-09-23 00:01:50 +02:00
EmperorBale
0732efc9d9
avm2: Impement day, dayUTC
2021-09-23 00:01:50 +02:00
EmperorBale
fe584f7508
chore: Fix typos
2021-09-23 00:01:50 +02:00
EmperorBale
97da4d1b7b
avm2: Implement UTC variants
2021-09-23 00:01:50 +02:00
EmperorBale
0dc0bc9694
avm2: Implement month, fullYear
2021-09-23 00:01:50 +02:00
EmperorBale
273ae48654
avm2: Refactor date implementation
2021-09-23 00:01:50 +02:00
EmperorBale
6ab0d89040
avm2: Implement minutes, hours, date
2021-09-23 00:01:50 +02:00
EmperorBale
d5621c1ce7
avm2: Implement time, seconds, milliseconds
2021-09-23 00:01:50 +02:00
EmperorBale
32eb9d1579
avm2: Implement Dates instance initializer
2021-09-23 00:01:50 +02:00
EmperorBale
db550b035c
avm2: Add Date stub
2021-09-23 00:01:50 +02:00
kmeisthax
42275f43f3
avm2: Properly make all classes an instance of `Class`. ( #57 )
...
* avm2: Properly make all classes an instance of `Class`.
Also, does this technically mean that `Class` is a metaclass?
* avm2: Remove `Function::from_method_and_proto` as it will no longer be needed
* avm2: Ensure builtin classes are also instances of `Class`.
This requires tying a veritable gordian knot of classes; everything needs to be allocated up-front, linked together, and then properly initialized later on. This necessitated splitting the whole class construction process up into three steps:
1. Allocation via `from_class_partial`, which does everything that can be done without any other classes
2. Weaving via `link_prototype` and `link_type`, which links all of the allocated parts together correctly. This also includes initializing `SystemClasses` and `SystemPrototypes`.
3. Initialization via `into_finished_class`, which must be done *after* the weave has finished.
Once complete you have core classes that are all instances of `Class`, along with prototypes that have their usual legacy quirks.
Note that this does *not* make prototypes instances of their class. We do need to do that, but doing so breaks ES3 legacy support. This is because we currently only work with bound methods, but need to be able to call unbound methods in `callproperty`.
* tests: Add a test for all core classes' instance-of relationships
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
f8c32d3a68
avm2: Fix get_own_class_definition users to use either instance_of or as_.
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
71e41e2c92
chore: cargo fmt
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
22482ed080
avm2: Remove unwrap in get_own_class_definition
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
7736818069
avm2: Rename as_class -> get_own_class_definition
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
26e60fa8ea
avm2: Rename as_class_object_really -> as_class_object
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
008162c514
avm2: Replace all uses of as_class_object by instance_of
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
4b7f8b3dbd
avm2: inner_class_definition is not an Option
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
3e1764aa1e
avm2: Reimplement as_class_object() in terms of other methods
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
e02feb919a
avm2: Reimplement as_class() in terms of other methods
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
4380978b2a
avm2: Move instance_allocator() to ClassObject
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
1d22009c6b
avm2: Drop seemingly-unused set_class_object()
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
f3ab6c9da3
avm2: Move as_class_params() to ClassObject
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
0679fd1a9e
amv2: Move superclass_object() to ClassObject
2021-09-22 00:29:37 +02:00
Adrian Wielgosik
2dfa875712
avm2: Move interfaces to ClassObject
2021-09-22 00:29:37 +02:00
Chris Midgley
6f0b026f13
chore: cargo fmt
2021-09-18 18:42:36 +02:00
Chris Midgley
7bab1de1e7
avm2: implement coerce_x opcodes
2021-09-18 18:42:36 +02:00
Adrian Wielgosik
ba35611c47
chore: cargo fmt
2021-09-18 18:37:46 +02:00
lukaszN
a76f2403ac
avm2: String rename PUBLIC_CLASS_METHODS to AS3_CLASS_METHODS
2021-09-18 18:37:46 +02:00
lukaszN
0f41193c3b
avm2: String.match match lastIndex behavior
2021-09-18 18:37:46 +02:00
lukaszN
d5588f3f90
avm2: String refactor index_of, match
2021-09-18 18:37:46 +02:00
lukaszN
42300d4a1e
avm2: String tests
2021-09-18 18:37:46 +02:00
lukaszN
4abde1500b
avm2: String fixes for tests
2021-09-18 18:37:46 +02:00
lukaszN
e24390ff58
avm2: String slice, substr, substring
2021-09-18 18:37:46 +02:00
lukaszN
d953fea5df
avm2: String match
2021-09-18 18:37:46 +02:00
lukaszN
91d63e4dc1
avm2: class methods can also live in the AS3 namespace
2021-09-18 18:37:46 +02:00
lukaszN
5e5d8e4fff
avm2: String concat, lastIndexOf, indexOf, fromCharCode
2021-09-18 18:37:46 +02:00
Chris Midgley
909428943b
avm2: implement bkpt, bkptline, timestamp as no-ops
2021-09-17 23:06:59 +02:00
Moulins
73bce495c2
chore: move core::avm1::string::AvmString to core::string::AvmString
2021-09-13 03:30:17 -07:00
Moulins
87e8b44fe9
chore: move core::string_utils to core::string::utils
...
Also move case tables to a separate file.
2021-09-13 03:30:17 -07:00
Ray Redondo
167b5a45de
avm2: move flash.display.IBitmapDrawable init
2021-09-11 15:47:20 -07:00
Ray Redondo
40d53cda59
avm2: make BitmapData and DisplayObject impl IBitmapDrawable
2021-09-11 15:47:20 -07:00
Ray Redondo
7f895473cb
avm2: IBitmapDrawable stub
2021-09-11 15:47:20 -07:00
David Wendt
1e0d259075
avm2: Allow nulling `Bitmap.bitmapData`.
...
One of the two tests in this PR relies upon the backend storing bitmap data, but the test rendering backend does not yet do this.
2021-09-11 12:11:35 -07:00
David Wendt
bfb6f03d62
avm2: Impl `Bitmap.smoothing`
...
Also, `smoothing` should be set at construction time even if we're setting up a timeline bitmap.
2021-09-11 12:11:35 -07:00
David Wendt
2ba0e12b7e
avm2: Stub `Bitmap.pixelSmoothing`
2021-09-11 12:11:35 -07:00
David Wendt
8ae669b96c
avm2: `BitmapData` should be traceable
2021-09-11 12:11:35 -07:00
David Wendt
31e3741982
avm2: Allow access to the `BitmapData` of a `Bitmap`.
2021-09-11 12:11:35 -07:00
David Wendt
7c5dc568f1
avm2: Impl `BitmapData.getPixel`.
...
This also changes the `bitmapdata_constr` test slightly to use a different starting value. Our premultiplied alpha calculations generate slightly different values from Flash Player which trips the test.
2021-09-11 12:11:35 -07:00
David Wendt
4c9bd0a6fe
avm2: Impl `BitmapData.transparent`
2021-09-11 12:11:35 -07:00
David Wendt
dca473fc2a
avm2: Impl `BitmapData.width` and `BitmapData.height`
2021-09-11 12:11:35 -07:00
David Wendt
335aec5be0
avm2: Implement `BitmapData`'s constructor.
...
This includes support for both embedded bitmap data (resolved via the SymbolClass mechanism) as well as empty bitmaps configured via arguments.
2021-09-11 12:11:35 -07:00
David Wendt
54740d6093
core: Allow `BitmapData` to hold an AVM2 side.
2021-09-11 12:11:35 -07:00
David Wendt
a807cf7623
avm2: Stub `flash.display.BitmapData` & storage object
2021-09-11 12:11:35 -07:00
David Wendt
609b97cfb9
core: Allow `Bitmap`s to hold an AVM2 representation
2021-09-11 12:11:35 -07:00
Chris Midgley
3e04c2b0d2
dev: remove allow unused mut and corresponding mut
2021-09-09 19:06:49 -06:00
Adrian Wielgosik
9bd0b624fd
avm2: Add more Event class stubs and constants
2021-09-05 11:56:21 +02:00
David Wendt
bc4f790031
avm2: Stub `SoundMixer.areSoundsInaccessible` and `SoundMixer.computeSpectrum`
2021-09-03 16:47:02 -06:00
David Wendt
34fe35a998
avm2: Impl `SoundMixer.bufferTime`
2021-09-03 16:47:02 -06:00
David Wendt
364ee62c92
avm2: Impl `SoundChannel`'s `soundComplete` event.
...
This includes a test that is currently ignored because `NullAudioBackend` can't fire complete events.
2021-09-03 16:47:02 -06:00
David Wendt
d5718fe408
avm2: Initialize all sounds and channels at time of allocation
2021-09-03 16:47:02 -06:00
David Wendt
efcab92d97
avm2: Impl `SoundMixer.stopAll`
2021-09-03 16:47:02 -06:00
David Wendt
d73ba586d0
avm2: Impl `SoundChannel.stop()`
2021-09-03 16:47:02 -06:00
David Wendt
39305f6a38
avm2: Implement `SoundChannel.soundTransform`
2021-09-03 16:47:02 -06:00
David Wendt
6b7609ff4e
avm2: Stub `SoundChannel.position`.
...
This also comes with an ignored test for `position`, because I originally believed this to be implementable.
2021-09-03 16:47:02 -06:00
David Wendt
4e77f89e0f
avm2: Stub `SoundChannel.leftPeak` and `SoundChannel.rightPeak`
2021-09-03 16:47:02 -06:00
David Wendt
50092e6c04
avm2: Stub all remaining `Sound` methods.
2021-09-03 16:47:02 -06:00
David Wendt
b6167c2f86
avm2: Allow playing sounds with a given `SoundTransform`.
2021-09-03 16:47:02 -06:00
David Wendt
5771d4c826
avm2: Deduplicate the sound transform conversion code
2021-09-03 16:47:02 -06:00
David Wendt
116fb1f323
avm2: Impl `Sound.play`
...
This does not (yet) implement the third `SoundTransform` parameter on `play`.
2021-09-03 16:47:02 -06:00
David Wendt
8a58956f1f
avm2: Add `flash.media.SoundChannel` class & associated object storage
2021-09-03 16:47:02 -06:00
David Wendt
46de9ee46e
avm2: `soundTransform` isn't a movieclip property, so don't ask for one.
2021-09-03 16:47:02 -06:00
David Wendt
1bde07089d
avm2: Alias `SimpleButton.soundTransform` to the class property of `SoundMixer.soundTransform`
2021-09-03 16:47:02 -06:00
David Wendt
0f625e7864
avm2: Impl `SoundMixer.soundTransform` class property
2021-09-03 16:47:02 -06:00
David Wendt
8e1122104d
avm2: Correct `SoundTransform` class definition to match docs
2021-09-03 16:47:02 -06:00
David Wendt
2f6e695483
avm2: Impl `Sprite.soundTransform`
2021-09-03 16:47:02 -06:00
David Wendt
3b9f0f271d
avm2: `SoundTransform.pan` returns 0 if the transform sends sound to different channels
2021-09-03 16:47:02 -06:00
David Wendt
2b7a0bf898
avm2: `SoundTransform` stores it's values as square roots
2021-09-03 16:47:02 -06:00
David Wendt
bd3cec0d20
avm2: Impl `flash.media.SoundTransform`
2021-09-03 16:47:02 -06:00
David Wendt
e4c6e29b8a
core: `NullAudioBackend` should not report latency seek data as part of the size of a sound.
2021-09-03 16:47:02 -06:00
David Wendt
d7f2f782c4
avm2: Impl `Sound.length`
...
This also adds duration tracking for `NullAudioBackend`.
2021-09-03 16:47:02 -06:00
David Wendt
e25fb732ea
avm2: Stub `Sound.isBuffering`, `Sound.isURLInaccessible`, and `Sound.url`
2021-09-03 16:47:02 -06:00
David Wendt
89b411593f
avm2: Impl `Sound.bytesTotal`
2021-09-03 16:47:02 -06:00
David Wendt
d5fb807387
avm2: Allow calling `Function.apply` without a second argument
2021-09-03 16:47:02 -06:00
David Wendt
7b31cd9a4d
avm2: Allow instantiating a SWF sound by constructing it's symbol class
2021-09-03 16:47:02 -06:00
David Wendt
0c591f3370
avm2: Stub implementation of `Sound` and accompanying object type
2021-09-03 16:47:02 -06:00
David Wendt
70556e5830
avm2: Forbid `applytype` opcodes with more than one argument type.
2021-09-02 17:57:58 -06:00
David Wendt
e2bf0a9857
avm2: Prohibit naming types with more than one parameter, as they don't exist.
2021-09-02 17:57:58 -06:00
David Wendt
141b992a73
avm2: Storing past the end of a vector only works for the immediate one-off-the-end index
2021-09-02 17:57:58 -06:00
David Wendt
8cd2b4fd5e
avm2: Fill vector holes with the default value at creation time instead of storing them.
2021-09-02 17:57:58 -06:00
David Wendt
3b48216762
avm2: Don't store more than one object parameter, because there are no classes with multiple paramters.
2021-09-02 17:57:58 -06:00
David Wendt
5c740ef1e1
chore: Grammar
2021-09-02 17:57:58 -06:00
David Wendt
d1b9df61f3
avm2: Move `Vector`'s properties to the AS3 namespace and add prototype properties in the public one
2021-09-02 17:57:58 -06:00
David Wendt
cc15809f49
avm2: Add the ability to have a separate class initializer for each specialization of `Vector`
2021-09-02 17:57:58 -06:00
David Wendt
e087a27e56
avm2: `Vector.sort` actually *does* calculate an indexed sort array, but then discards it.
...
Normally we could skip sorting, but values in the vector may have side effects when coerced. So we need to make sure coercions run, at least.
2021-09-02 17:57:58 -06:00
David Wendt
280fbbde45
avm2: Pick nits in `Vector`'s `instance_init`
2021-09-02 17:57:58 -06:00
David Wendt
2095c1831a
avm2: Replace some if expressions with easier-to-read equivalents
2021-09-02 17:57:58 -06:00
David Wendt
464605d015
avm2: Pre-allocate all the things
2021-09-02 17:57:58 -06:00
David Wendt
bf4492c454
avm2: Add the legacy Vector types that old movies can use.
...
This one was rather tough to test, as I actually can't generate ABCs in Animate CC that reference these classes. I instead had to modify a compiled SWF to open the package-internal namespace that these pre-specialized classes exist in.
2021-09-02 17:57:58 -06:00
David Wendt
dcf6d87363
avm2: Accept `null` as a valid type in `applytype`.
...
In AVM2, the `*` (any) type is represented as `null`.
This requires also changing the parameters on classes and objects to be nullable, too.
We do *not* represent `null` as a particular value on the underyling vector storage object, however. We instead change it to `Object`, as that's the root of all other types.
This may require revision if non-`Object`-extending types appear in the future.
2021-09-02 17:57:58 -06:00
David Wendt
ee30f21e8e
avm2: Remove unnecessary `mut`
2021-09-02 17:57:58 -06:00
David Wendt
aaddcc598f
avm2: Impl `Vector.toLocaleString` and test `toString`
2021-09-02 17:57:58 -06:00
David Wendt
d1e49db3cc
avm2: Stub `Number.toLocaleString`
...
This exists but is undocumented, and I accidentally wrote a Vector test that needs it.
2021-09-02 17:57:58 -06:00
David Wendt
dbc6f38c34
avm2: Impl `Vector.splice`
2021-09-02 17:57:58 -06:00
David Wendt
81d0775776
avm2: Impl `Vector.sort`
2021-09-02 17:57:58 -06:00
David Wendt
9fcd846a4d
avm2: Fix ineffective Vector typechecks
2021-09-02 17:57:58 -06:00
David Wendt
44a9f13047
avm2: Impl `Vector.slice`
2021-09-02 17:57:58 -06:00
David Wendt
077fd87842
avm2: Impl `Vector.reverse`
2021-09-02 17:57:58 -06:00
David Wendt
aa2d729a44
avm2: Impl `Vector.removeAt`
2021-09-02 17:57:58 -06:00
David Wendt
a053015558
avm2: Impl `Vector.insertAt`
2021-09-02 17:57:58 -06:00
David Wendt
6b78e86ddc
avm2: Impl `Vector.shift` and `Vector.unshift`
2021-09-02 17:57:58 -06:00
David Wendt
1cfa9e0b28
avm2: Impl `Vector.push` and `.pop`
2021-09-02 17:57:58 -06:00
David Wendt
6350ce2dde
avm2: Impl `Vector.map`
2021-09-02 17:57:58 -06:00
David Wendt
7628b2b49a
avm2: Impl `Vector.lastIndexOf` (and the weird backward-index behavior of `indexOf`)
2021-09-02 17:57:58 -06:00
David Wendt
4624157ae0
avm2: Impl `Vector.indexOf`
2021-09-02 17:57:58 -06:00
David Wendt
622be142c3
avm2: Specialize generic classes when resolving types whose names have parameter names also in them.
...
Any is, as usual, special-cased. In this case, we treat it as specializing to `Object`, since all vectors should be coercible to `Object`.
2021-09-02 17:57:58 -06:00
David Wendt
c06a3c10d8
avm2: Impl `Vector.filter`
2021-09-02 17:57:58 -06:00
David Wendt
d079c647fa
avm2: Parameter types can be `*`.
2021-09-02 17:57:58 -06:00
David Wendt
f00234ce26
avm2: Consider specializations of generic classes to be of the same type as other specializations of the same class when their parameters are also of the same type.
...
For example, instances of `Vector.<Class>` are considered to be of type `Vector.<Interface>` in the same way that instances of `Class` are considered to be of type `Interface`. This assumes `Class` implements `Interface`.
This does *not* apply to the builtin coercions for numeric and string types, which do not extend to generic parameters. For example, `Vector.<uint>` is *not* coercible to `Vector.<int>`, even though it's contents *are*.
2021-09-02 17:57:58 -06:00
David Wendt
4d962f154e
avm2: Don't run initializers on vectors as they overwrite the existing vector storage.
2021-09-02 17:57:58 -06:00
David Wendt
fcc7c9e7ee
avm2: Propagate the specialized class parameter into the vector storage so that coercions happen correctly.
2021-09-02 17:57:58 -06:00
Adrian Wielgosik
2560bdc804
chore: Drop unnecessary mut
2021-09-02 17:57:58 -06:00
Adrian Wielgosik
846b53dc1b
avm2: Impl `Vector.forEach`
2021-09-02 17:57:58 -06:00
Adrian Wielgosik
8a77494b2f
avm2: Impl `Vector.some`
2021-09-02 17:57:58 -06:00
Adrian Wielgosik
519feb9af7
avm2: `Array.every/some` should early return
2021-09-02 17:57:58 -06:00
Adrian Wielgosik
07f979b582
avm2: `Vector.every` should early return
2021-09-02 17:57:58 -06:00
David Wendt
97e6f55110
avm2: Impl `Vector.every`
2021-09-02 17:57:58 -06:00
David Wendt
aa0946c64c
avm2: Impl `Vector.fixed`
2021-09-02 17:57:58 -06:00
David Wendt
841ed4b5e4
avm2: Setting to an out-of-bounds index on a growable `Vector` should grow it
2021-09-02 17:57:58 -06:00
David Wendt
238959d7f8
avm2: Impl `Vector.join` and `toString`
2021-09-02 17:57:58 -06:00
David Wendt
1ce7e4e642
avm2: `Vector` is a final class (no matter what the docs say)
2021-09-02 17:57:58 -06:00
David Wendt
dba9b18540
avm2: Impl `Vector.concat`
2021-09-02 17:57:58 -06:00
David Wendt
96afc5a6c2
avm2: Cache all `Vector` applications on the `Vector` class object.
...
This matches Flash Player behavior: notably, multiple applications of the same types see the same class and prototype, but different applications actually create new objects that don't share properties.
2021-09-02 17:57:58 -06:00
David Wendt
888fcc85ca
avm2: Impl `Vector.length`
2021-09-02 17:57:58 -06:00
David Wendt
9d08a7c299
avm2: Impl `Vector`'s instance initializer
2021-09-02 17:57:58 -06:00
David Wendt
49d79b8e73
avm2: Vector indices are stored in a package namespace
2021-09-02 17:57:58 -06:00
David Wendt
3d3b80f8af
avm2: ES3 class instances should be treated as instances of the ES4 class `Object`.
2021-09-02 17:57:58 -06:00
David Wendt
6b377bed64
avm2: Impl `apply` for ES4 classes to allow type parameterization
2021-09-02 17:57:58 -06:00
David Wendt
65a23d5833
avm2: Move applytype next to other operations that create classes
2021-09-02 17:57:58 -06:00
David Wendt
074c093504
avm2: Implement op `ApplyType`
2021-09-02 17:57:58 -06:00
David Wendt
4b021fe92c
avm2: `Vector` lives in a separate package from other globals
2021-09-02 17:57:58 -06:00
David Wendt
74cb32dd46
avm2: Allow constructing static `TypeName`s (for naming `Vector` classes)
2021-09-02 17:57:58 -06:00
David Wendt
7e71ecac16
avm2: Add stub impl of `Vector`
2021-09-02 17:57:58 -06:00
David Wendt
6f49e62b96
avm2: First pass on implementing vector storage
2021-09-02 17:57:58 -06:00
David Wendt
f4dfc4d778
avm2: First pass at type-aware vector storage
2021-09-02 17:57:58 -06:00
David Wendt
686872812d
avm2: Add a `TObject` method for applying arguments to a generic type.
2021-09-02 17:57:58 -06:00
David Wendt
fe8373739d
avm2: Add the ability to fork a `Class` to one that holds it's type arguments.
2021-09-02 17:57:58 -06:00
David Wendt
86616b748f
avm2: Allow parsing generic typenames into a multiname
2021-09-02 17:57:58 -06:00
David Wendt
47e3b2229a
swf: Add support for the `TypeName` multiname type.
2021-09-02 17:57:58 -06:00
David Wendt
80c5bbcd83
avm2: Stub `Font.enumerateFonts` and `Font.registerFont`
2021-08-30 17:53:39 -06:00
David Wendt
2d57bed82e
avm2: Impl `Font.hasGlyphs`
2021-08-30 17:53:39 -06:00
David Wendt
37af9be533
avm2: Implement `Font` for embedded fonts.
2021-08-30 17:53:39 -06:00
EmperorBale
358e0641eb
avm2: Use rsplit_once instead of split_once
2021-08-29 20:41:20 -06:00
EmperorBale
05b4ee6b61
avm2: Dont panic if as_class returns None
2021-08-29 20:41:20 -06:00
EmperorBale
547aac0e85
chore: Cleanup QName::to_qualified_name
2021-08-29 20:41:20 -06:00
EmperorBale
5dd21cdf8e
avm2: Add QName::from_qualified_name and QName::to_qualified_name
2021-08-29 20:41:20 -06:00
EmperorBale
2b748a4870
avm2: Implement getQualifiedClassName, getQualifiedSuperclassName, and getDefinitionByName
2021-08-29 20:41:20 -06:00
Adrian Wielgosik
b5ee94aff1
avm2: Stub flash.system.Security.
2021-08-26 23:50:42 +02:00
lukaszN
8e596c2a35
avm2: Rectangle fix clippy
2021-08-23 15:44:14 -06:00
lukaszN
b7b66ab9b8
avm2: impl Rectangle isEmpty, offset, offsetPoint, setEmpty, union
2021-08-23 15:44:14 -06:00
lukaszN
f5c491a14f
avm2: impl Rectangle intersection, intersects
2021-08-23 15:44:14 -06:00
lukaszN
e22cd6bdbd
avm2: impl Rectangle inflate, inflatePoint
2021-08-23 15:44:14 -06:00
lukaszN
129cd1af58
avm2: impl Rectangle contains, containsPoint, containsRect, copyFrom
2021-08-23 15:44:14 -06:00
lukaszN
3670676e2d
avm2: Impl Rectangle topLeft, size, clone, equals
2021-08-23 15:44:14 -06:00
lukaszN
85afeb1de7
avm2: Impl Rectangle setters and getters
2021-08-23 15:44:14 -06:00
lukaszN
ee9e70b71f
avm2: Initial rectangle impl
2021-08-23 15:44:14 -06:00
Tal Hayon
7b9049cedf
core: Add DefineBinaryData and SymbolClass connection (Part of #1368 )
2021-08-21 12:24:46 -06:00
Ray Redondo
27e06af003
avm2: Initial MouseEvent stubs ( #5065 )
...
* avm2: Start MouseEvent stubs
* avm2: More MouseEvent work
* chore: clippy
* chore: fmt
Co-authored-by: Adrian Wielgosik <adrian.wielgosik@gmail.com>
2021-08-21 01:26:34 +02:00
Chris Midgley
58c907e985
avm2: implement string.split for undefined ( #5064 )
...
* avm2: implement string.split for undefined
* chore: cargo fmt
* dev: avoid explicit ArrayStorage
2021-08-18 18:02:41 +02:00
Ray Redondo
cfb2bb99d6
chore: appease clippy
2021-08-14 00:52:38 +02:00
Ray Redondo
638eaf4a55
avm2: Rename function, add runtime warnings
2021-08-14 00:52:38 +02:00
Ray Redondo
171a41b908
avm2: Add define_public_builtin_class_traits and repair Capabilities to use it
2021-08-14 00:52:38 +02:00
Ray Redondo
c43f57e5f5
avm2: Implement `String.split`
2021-08-14 00:52:38 +02:00
Ray Redondo
22c6f7321e
avm2: start flash.system.Capabilities stubs
2021-08-14 00:52:38 +02:00
EmperorBale
1dee1e4166
avm2: Implement flash.crypto.generateRandomBytes
2021-07-21 18:09:21 +02:00
David Wendt
db86ca84b9
avm2: `get_property` does not mutate the underlying object (anymore) so it should not be flagged as mutably borrowing it.
2021-07-20 22:14:05 -04:00
David Wendt
c30014baed
avm2: Remove `ScriptObjectClass` and replace with separately implemented methods on `ClassObject`
2021-07-20 22:12:33 -04:00
David Wendt
4d89341e19
avm2: Cache the instance allocator on class objects
2021-07-20 22:12:33 -04:00
David Wendt
2c927f2b6b
avm2: Make `coerce_to_type` take a class object instead of a multiname.
2021-07-20 22:12:33 -04:00
David Wendt
bd2f758976
avm2: Don't call native initializers when coercing primitives into objects.
...
The former native initializer call was incorrect and would cause spurious coercion failures. Since existing code assumes the error fork of `coerce_to_object` means undefined or null, this was causing coercions and parameter typechecks against primitives to fail in the most general case.
Attempting to fix this by providing the primitive value as native initializer argument instead causes a stack overflow. This is because native initializer arguments still have to be typechecked, and in the most general case this means... coercing the primitive value we're already coercing into an object... into another object. This won't work.
Since primitive initializers aren't going to do anything that native coercions need to care about, I'm just removing the initializer call.
2021-07-20 22:12:32 -04:00
David Wendt
30b4c4386b
avm2: Replace the `call_strict` mechanism with checking to see if free functions are unchecked.
2021-07-20 22:12:32 -04:00
David Wendt
ddd73b3cd6
avm2: Supercalls should fall back to normal receiver access if there is no matching supertrait to use.
2021-07-20 22:12:31 -04:00
David Wendt
e9b9d64cb6
avm2: Rename `StageObject::graphics_of` to just `graphics`
2021-07-20 22:12:30 -04:00
David Wendt
7871912d92
avm2: Calling ES4 class objects is treated as a coercion to that type.
2021-07-20 22:12:28 -04:00
David Wendt
b469ef8a3f
avm2: Replace `deriver` language with `allocator` language
2021-07-20 22:12:28 -04:00
David Wendt
8af0481a23
avm2: Retire the use of "constructor" outside of literal reference to class initializer or instance initializer code.
...
Instead, the following terms are used:
* Static classes, to refer to `Class<'gc>`. Shortened to "class" in contexts where this is not ambiguous.
* Class objects, to refer to objects that represent a particular class. Also shortened to "class" in non-ambiguous contexts.
Downstream of this, the `base_constr` (referring to the class that a currently called trait has been pulled from) is now called `subclass_object` and several `TObject` methods have also been renamed.
2021-07-20 22:12:23 -04:00
David Wendt
6d907a0d10
avm2: Rename `ArrayObject::empty_array` to `ArrayObject::empty`.
2021-07-20 22:10:36 -04:00
David Wendt
05b7de7453
avm2: Avoid double iteration in `Names.contains_name`
2021-07-20 22:10:36 -04:00
David Wendt
6e2e686e0d
avm2: Rename `Method::Entry` to `Method::Bytecode`
2021-07-20 22:10:35 -04:00
David Wendt
b049f2e717
avm2: Rename `Method::from_builtin_only` to `Method::from_builtin`
2021-07-20 22:10:35 -04:00
David Wendt
d4fcca9787
avm2: Rename `call_initializer` and `call_native_initializer` to `call_init` and `call_native_init`
2021-07-20 22:10:34 -04:00
David Wendt
f5431a781e
docs: Fix stale comments in avm2
2021-07-20 22:10:34 -04:00
David Wendt
ccfa605260
avm2: Use `extend_from_slice`
2021-07-20 22:10:34 -04:00
David Wendt
a60a499f31
avm2: Rename `resolve_parameter_value` to `resolve_parameter`
2021-07-20 22:10:33 -04:00
David Wendt
9e997e6571
avm2: Split out `Method` and `Executable`'s native fork into `NativeMethod` and `NativeExecutable`, respectively.
...
This also implies renaming the existing type alias of the same name to `NativeMethodImpl`.
2021-07-20 22:10:33 -04:00
David Wendt
c7858f9447
avm2: Simplify/correct the value numerical checks
2021-07-20 22:10:32 -04:00
David Wendt
5018421eef
avm2: Rename `SystemConstructors` to `SystemClasses`
2021-07-20 22:08:27 -04:00
David Wendt
2c2f03ba23
chore: Clippy compliance on Rust nightly
2021-07-20 22:05:37 -04:00
David Wendt
d0478a1f40
avm2: Allow builtins to also hold parameter type metadata.
...
This is limited by the fact that we currently cannot store type metadata in static tables. I don't think it's necessary to do so as of yet as pretty much every actual parameter type I *could* shove in here turned out to be optional and broke tests if it wasn't. Still, it's probably useful enough for new classes to include.
2021-07-20 22:05:36 -04:00
David Wendt
e38b1bc281
avm2: Make numbers appear to be of any numeric type that can represent them.
...
This also prevents an exception from being fired when testing `undefined` or `null`, which are valid inputs to `istype`.
2021-07-20 22:05:35 -04:00
David Wendt
974fe152ff
avm2: Include the parameter coercions into `op_coerce`
2021-07-20 22:05:34 -04:00
David Wendt
8b48b79f5d
avm2: Make the `pool_` and `table_` functions no longer take a superfluous mutation context.
...
This also adds a new `pool_multiname_static_any` method that treats zero as `*` instead of an error.
2021-07-20 22:05:33 -04:00
David Wendt
abc9d0800a
avm2: `undefined` is normalized to `null` for string and object coercions
2021-07-20 22:05:32 -04:00
David Wendt
b779804075
avm2: Relax the maximum arguments check for functions called from native code.
2021-07-20 22:02:11 -04:00
David Wendt
ae086d6aa7
avm2: Implement implicit coercion for primitive types
2021-07-20 22:02:10 -04:00
David Wendt
63cf6a7b47
avm2: Implement parameter typechecking for script functions.
...
This commit breaks 15 tests, mostly due to implicit coercion that happens at function call time. This will be implemented shortly.
2021-07-20 22:02:10 -04:00
David Wendt
5c6c3191ef
avm2: Enforce `final` on traits.
2021-07-20 22:02:09 -04:00
David Wendt
7d86c93ddc
Check to make sure that overrides only apply to already-installed properties.
2021-07-20 22:02:08 -04:00
David Wendt
5662527c9e
avm2: Enforce `interface` checks: classes cannot extend interfaces and cannot implement other classes.
2021-07-20 22:02:08 -04:00
David Wendt
7eca7d5331
avm2: Enforce `final` on classes
2021-07-20 22:02:07 -04:00
David Wendt
3888d5bb27
avm2: `install_dynamic_property` now checks to see if the object is sealed, and if so, throws an error.
2021-07-20 22:02:07 -04:00
David Wendt
03980f4f3d
avm2: `Function.prototype`'s properties are not methods.
2021-07-20 22:02:06 -04:00
David Wendt
c10a25fb3f
avm2: Remove the special global constructor scope mode we added two commits ago.
2021-07-20 22:02:05 -04:00
David Wendt
0e40552c2a
avm2: Don't instantiate classes or functions at trait install time.
2021-07-20 22:02:05 -04:00
David Wendt
377730301f
avm2: Add a special object mode for `globals` so that it can get it's own scope during trait installation.
...
This is very wrong: Strictly speaking, we should not be instantiating anything that needs a scope when we install the trait. We just create a slot for it to go into. Script initializers are responsible for providing a scope stack to instantiate traits into.
2021-07-20 22:02:04 -04:00
David Wendt
a112192c96
avm2: Remove `_slot_local` methods as we no longer do anything special with slots.
2021-07-20 22:02:04 -04:00
David Wendt
5dcc3a58f2
avm2: Remove lazy trait initialization
2021-07-20 22:02:03 -04:00
David Wendt
1c72167287
avm2: Make `istype` use the constructor chain, not the prototype chain.
...
This pushes a few more ancillary changes:
* `has_proto_in_chain` no longer checks interfaces (since it exists to serve `instanceof`, which does not respect them)
* Interfaces no longer live on prototypes. They now live on class constructors.
2021-07-20 22:01:57 -04:00
David Wendt
713ab3e95c
avm2: Remove all remaining accesses to `SystemPrototypes`, save for one technicality with the global scope prototype.
2021-07-20 22:00:34 -04:00
David Wendt
f84f01b2a5
avm2: Adjust the `FunctionObject` associated constructors so that there's a path that doesn't require the user hit `SystemPrototypes`.
...
Because we have stuff running in early globals, we stlil need a more elaborate version of this function that *does* take `fn_proto`. We also can't pull `scope` from the activation since this gets called to install traits.
2021-07-20 22:00:34 -04:00
David Wendt
e4201625a1
avm2: Split `StageObject` associated constructors into two versions: allocation-only (`for_display_object`) and allocation-and-initialization (`for_display_object_childless`).
...
The latter is intended for display objects that *do not* have children and can be both allocated and initialized in one shot. Hence the name.
2021-07-20 22:00:33 -04:00
David Wendt
46a4da9dc5
avm2: Remove `XmlObject::empty_object` as it does not appear to be in use and will need further elaboration when XML is unstubbed.
2021-07-20 22:00:32 -04:00
David Wendt
602895e2de
avm2: Make `RegExpObject::from_regexp` pull it's own constructor and call it's own initializer.
...
This doesn't appear to actually be in use, but I'm doing it for completeness' sake.
2021-07-20 22:00:32 -04:00
David Wendt
c167912f52
avm2: `PrimitiveObject::from_primitive` should now select it's own class and construct it.
...
This also includes protections on `String` to prevent it from overwriting itself. All user-constructed primitive objects start out boxing `Value::Undefined` and future constructor implementations should check what's already been boxed before overwriting it with user arguments.
2021-07-20 22:00:31 -04:00
David Wendt
261cb40a22
avm2: Make `NamespaceObject`'s sole associated method build and construct a `Namespace` instance.
2021-07-20 22:00:29 -04:00
David Wendt
b30c7509ba
avm2: Make `LoaderInfo`'s associated methods call initializers and pull their constrs/protos as necessary
2021-07-20 21:59:21 -04:00
David Wendt
60eb1b4409
avm2: Don't ask for a `proto` in `EventObject::from_event`.
...
For various reasons, this is kind of incomplete:
1. We need to support native event subclasses, so we can't just pull one class from `activation` (yet).
2. We can't run native instance initializers without overwriting the native object.
I expect these to be fixed in a future PR where I start adding native event types.
2021-07-20 21:59:21 -04:00
David Wendt
22fedf4dca
avm2: Make all domain object construction (save for the global domain) pull the constructor and call it in `from_domain`.
...
This also adds `DomainObject::script_global`, which does the same thing but picks the `global` class instead of `ApplicationDomain`.
2021-07-20 21:59:20 -04:00
David Wendt
6fe44c3862
avm2: Clean up `ClassObject` initialization.
...
This also makes it more difficult to accidentally build a class without calling it's initializer. Native/builtin class initializers should also be running now, too.
The only minor bit of jank is that we need a class initialized bit to flag classes we've already run, because our current lazy-init design for traits causes classes to be constructed twice. This is temporary and I intend to remove it along with lazy-init traits.
2021-07-20 21:59:18 -04:00
David Wendt
31faf62baf
avm2: Remove all alternative `ByteArrayObject` constructors.
...
The only way to build a `ByteArrayObject` now is to invoke it's constructor.
2021-07-20 21:58:06 -04:00
David Wendt
9604b525d5
avm2: Tie `ArrayObject`'s constructors to the system `Array` class.
...
This effectively turns calling `ArrayObject`'s associated methods into an alternate constructor path. We even make sure to run instance initializers. You also no longer have to grab the `array` system constructor, so we get to remove that code.
2021-07-20 21:58:05 -04:00
David Wendt
46db756f67
avm2: Don't run `Point`'s constructor twice when natively constructing one.
2021-07-20 21:58:04 -04:00
David Wendt
c8cd6e0322
avm2: Split native and script instance initializers for non-constructable classes.
...
This also includes new errors for attempting to construct non-constructables like `System`.
2021-07-20 21:58:04 -04:00
David Wendt
dcbb5e4284
avm2: Add a notion of native instance initializers.
...
Native initializers are a separate, parallel initialization chain intended for all object construction that is not directly triggered by `Op::Construct` and friends. This allows us to implement classes that cannot be directly constructed by user code, but can be constructed by native code or supercalled into from non-native.
2021-07-20 21:58:03 -04:00
David Wendt
4bc1d37029
avm2: Remove unnecessary manual accesses of the `constructor` property on prototypes.
...
All native object allocation in the project now pulls prototypes or constructors as necessary from the following sources:
* System prototype or constructor lists
* Instance `constr`s
This also resulted in the removal of a few unnecessary prototype accesses.
2021-07-20 21:57:56 -04:00
David Wendt
afd5a65a1e
avm2: Create a new list of system constructors alongside the existing list of system prototypes.
2021-07-20 21:55:30 -04:00
David Wendt
6deaa6f441
avm2: Remove the prototype setter exception as prototypes no longer provide setters to instances.
2021-07-20 21:55:29 -04:00
David Wendt
a8fd0622b2
avm2: Filter traits in `call_instance_xyz` by the trait type before actually getting trait fields.
...
Fixes the `as3_virtual_properties` test, where the old approach would accidentally grab a `Getter` and then think there's no setter (there is, you just have to look further down the list).
2021-07-20 21:55:29 -04:00
David Wendt
a2cd7443e8
avm2: Do not attempt to `super_init` the `LoaderInfo` object.
...
This is a temporary fix for failing tests; it is invalid in the sense that attempting to grab loader events will now fail. We can't actually correctly init the loader without two planned changes:
1. Moving all object initialization into the object helper functions (e.g. `LoaderInfoObject::from_movie`)
2. A notion of "native-only" constructors separate from the existing constructor chain
Once those are in place, loaders should be proper event dispatchers again.
2021-07-20 21:55:29 -04:00
David Wendt
1ad512e3c9
avm2: Allow constructing activation objects (since we now force instance constructors to run)
2021-07-20 21:55:28 -04:00
David Wendt
323da9ded3
avm2: Move the class association from prototypes to instances.
...
This also incurred a large number of ancillary changes, as it turns out nearly every native object is currently pulling a prototype and sticking it into an object. Right now, I have it instead pulling the constructor out of the prototype, but a future PR will also remove `system_prototypes` as well.
Other ancillary changes include:
* `Domain` now supports partial initialization to avoid an order-of-events issue. Accessing domain memory on a partially-initialized `Domain` will panic.
* `Domain` construction requires a full `activation` now, except for `global_scope` which needs to be initialized later with valid domain memory before user code runs.
* Pretty much every native object constructor now takes a proto/constr pair
* Trait lookup was rewritten to handle this. It's still buggy - seven tests don't work
* `TObject.construct` now actually does the full object construction dance. This allows `ClassObject` to implement the ES4 object construction pathway directly while `FunctionObject` maintains ES3 compatibility.
This is a tentative commit; there are still seven failing tests that I need to fix.
2021-07-20 21:55:25 -04:00
David Wendt
f26f193508
avm2: Store instance derivers as a `Class` property instead of keeping them only as a globals concept
2021-07-20 21:47:00 -04:00
David Wendt
47de2364c1
avm2: Split `Class` and `Function` object types
2021-07-20 21:46:54 -04:00
relrelb
d2eb46d3be
chore: Reserve capacity for vectors
...
This avoids unnecessary re-allocations and thus should improve
performance in both memory and time terms.
2021-07-20 16:25:23 -07:00
Adrian Wielgosik
633c23c7f3
avm2: Do timeout check every 2000 actions, same as avm1
2021-07-09 22:09:13 +02:00
relrelb
1cbbdecccf
swf: Introduce and use `Color::to_rgba`
2021-07-09 19:56:52 +03:00
relrelb
8b35aad657
core: Take advantage of or patterns
...
Rust 1.53.0 ships with or patterns, which allow a little more
elegant code:
https://blog.rust-lang.org/2021/06/17/Rust-1.53.0.html#or-patterns
2021-06-24 01:15:22 -07:00
relrelb
38a2650c0e
chore: Use Value into() in more places
2021-06-24 01:11:16 -07:00
EmperorBale
1ee61cca57
avm2: ByteArray updates
2021-06-22 01:26:27 -07:00
Mike Welsh
9357fd7b4f
avm2: Wire up Stage.quality
2021-06-17 13:55:56 -07:00
Mike Welsh
1f96af6b64
core: Add Avm1::exec_list to manage global list of display objects
2021-06-14 14:04:28 -07:00
relrelb
ede9650899
chore: Avoid unused_variables annotations
...
Instead prefix the unused variables with an underscore.
2021-06-11 16:16:53 +03:00
relrelb
f82faf9603
chore: Appease clippy
2021-06-05 10:16:00 -07:00
Mike Welsh
2b98c878f0
swf: Use Fixed in more places
2021-05-30 21:24:03 -07:00
Mike Welsh
1304b2c55a
avm2: Move Object properties to Object.prototype
2021-05-24 17:52:15 -07:00
Mike Welsh
3ddb97d2f6
core: Add SwfMovie::frame_rate and num_frames
2021-05-23 23:02:38 -07:00
Mike Welsh
172ad82aa5
core: Add SwfMovie::uncompressed_len
2021-05-23 23:02:38 -07:00
Mike Welsh
077c7f045e
core: Add SwfMovie::stage_size
...
Change `SwfMovie::width` and `height` to return `Twips`.
2021-05-23 23:02:38 -07:00
Mike Welsh
e1439f4105
swf: Add HeaderExt struct providing additional info
...
When reading an SWF, search for FileAttributes and
SetBackgroundColor and return this along with the header data
because it's useful (in particular, the AS3 flag).
2021-05-23 23:02:38 -07:00
Mike Welsh
2176e30e22
avm2: Use define_public_builtin_instance_properties for SimpleButton
2021-05-16 17:53:07 -07:00
David Wendt
e555a6b488
avm2: Impl `SimpleButton.useHandCursor`
2021-05-16 17:53:07 -07:00
David Wendt
6f6e2c1b9f
avm2: Impl `SimpleButton.enabled`
2021-05-16 17:53:07 -07:00
David Wendt
514c51510c
avm2: Impl `SimpleButton.trackAsMenu`
2021-05-16 17:53:07 -07:00
David Wendt
71bb0c901a
avm2: Impl the constructor parameters for `SimpleButton`
2021-05-16 17:53:07 -07:00
David Wendt
6a9249e52f
core: Store the root of each loaded movie and use it as a last-ditch way to get the root
2021-05-16 17:53:07 -07:00
David Wendt
9ded256c23
core: Implement the AVM2 concept of `stage`.
2021-05-16 17:53:07 -07:00
David Wendt
39e9ef9dc5
core: Implement a separate `avm2_root` method that provides an AS3 notion of root
2021-05-16 17:53:07 -07:00
David Wendt
c936ccd4b4
avm2: When constructing new `SimpleButton`s, make sure the display object sees it's AVM2 side, else we replace all it's contents with AVM1 objects somehow(?!)
2021-05-16 17:53:07 -07:00
David Wendt
434563da2f
avm2: `SimpleButton` should build a button when constructed
2021-05-16 17:53:07 -07:00
David Wendt
67c7f156ac
avm2: `instanceof` accepts `null` and `undefined`
2021-05-16 17:53:07 -07:00
David Wendt
7f294f5209
avm2: Constructor-based symbol instantiation should also post-instantiate before constructing a frame
2021-05-16 17:53:07 -07:00
David Wendt
11d7fe5107
core: Correct the order of events that are fired when an `Avm2Button` is instantiated on the timeline.
2021-05-16 17:53:07 -07:00
David Wendt
cb44554135
avm2: Add setters and getters for the four states of `SimpleButton`
2021-05-16 17:53:07 -07:00
David Wendt
22eac776be
avm2: Stub `flash.display.SimpleButton`
2021-05-16 17:53:07 -07:00
David Wendt
cffa739a54
avm2: Store the sprite proto
2021-05-16 17:53:07 -07:00
Mike Welsh
69a0700ca1
core: Remove collect::CollectWrapper
...
No longer necessary, it is possible to mark individual fields
as `#[collect(require_static)]`.
2021-05-13 23:24:10 -07:00
Mike Welsh
b882284fc9
core: Use bitflags for HitTestOptions
2021-05-12 23:02:06 -07:00
Adrian Wielgosik
5319a5bb81
Remove lifetime from constants
2021-05-06 10:54:33 -07:00
Adrian Wielgosik
faa0e50e89
avm2: Unify NativeMethod and GenericNativeMethod
2021-05-06 10:54:33 -07:00
Adrian Wielgosik
46ddb9be82
avm2: Generate class traits from const arrays
2021-05-06 10:54:33 -07:00
Adrian Wielgosik
8312243f42
avm2: Don't repeatedly call class.write(mc)
2021-05-06 10:54:33 -07:00
Mike Welsh
e8ec02418b
avm2: Fix Array.splice
...
Fix `Array.splice` in cases where elements are added but not
deleted, and when the starting index is larger than the length
of the array.
2021-04-30 13:48:27 -07:00
David Wendt
041003f256
avm2: Slot lookups don't need the whole trait list, just the first one we find.
2021-04-28 00:01:47 -07:00
David Wendt
fd08a6ebf6
avm2: Instantiate slot traits on `get_slot`, `set_slot` etc.
...
Previously, we only instantiated slot traits when named as a property, which is only half the picture.
2021-04-28 00:01:47 -07:00
David Wendt
e35d1edbf0
avm2: Allow pulling traits by slot id
2021-04-28 00:01:47 -07:00
David Wendt
9318028b52
avm2: `newactivation` should return an object which implements the traits listed in the associated method `body`'s trait list
2021-04-28 00:01:47 -07:00
David Wendt
6c5098d3c7
avm2: Fix order in which `setslot` takes it's parameters
2021-04-28 00:01:47 -07:00
Adrian Wielgosik
c3a16cb992
avm2: Support Stage.showDefaultContextMenu
2021-04-27 16:42:02 -07:00
Mike Welsh
98befe678e
avm2: Add flash.display.StageScaleMode and Stage.scaleMode
2021-04-26 01:15:42 -07:00
David Wendt
52c3b0f1bc
avm2: `Stage.color` yields background color alpha (always 0xFF) in the high bits of the u32
2021-04-26 01:15:42 -07:00
David Wendt
41fe51e9db
avm2: Impl `flash.display.StageQuality` enum
2021-04-26 01:15:42 -07:00
David Wendt
93d7f0b450
avm2: Stub `Stage.quality`
2021-04-26 01:15:42 -07:00
David Wendt
327a425fde
avm2: Stub `Stage.allowsFullScreen` and `Stage.allowsFullScreenInteractive`
2021-04-26 01:15:42 -07:00
David Wendt
cb167e0814
avm2: Impl `Stage.stageWidth`/`Stage.stageHeight`, sorta
2021-04-26 01:15:42 -07:00
David Wendt
1ee5bbf7ba
avm2: Impl `Stage.frameRate`
2021-04-26 01:15:42 -07:00
David Wendt
5d8f70d695
avm2: Implement `Stage.focus`
2021-04-26 01:15:42 -07:00
David Wendt
524f5fe57f
avm2: Impl `Stage.color`'s setter
2021-04-26 01:15:42 -07:00
David Wendt
6c6bd74af9
avm2: Impl `Stage.displayState`'s getter
2021-04-26 01:15:42 -07:00
David Wendt
ae080fd65f
avm2: Impl `flash.display.StageDisplayState`
2021-04-26 01:15:42 -07:00
David Wendt
b858f74139
avm2: Impl `Stage.contentsScaleFactor`
2021-04-26 01:15:42 -07:00
David Wendt
247f7e3de4
avm2: Impl `Stage.color`
2021-04-26 01:15:42 -07:00
David Wendt
d7a0d15fd8
avm2: Expose `Stage.browserZoomFactor`
2021-04-26 01:15:42 -07:00
David Wendt
98788ef194
avm2: Impl `flash.display.StageAlign`
2021-04-26 01:15:42 -07:00
David Wendt
2a30887660
avm2: Support the half-broken `loaderInfo` on the `Stage`
2021-04-26 01:15:42 -07:00
David Wendt
ef4db9ba16
avm2: Add overrides for every property that cannot be set on the `Stage`.
...
Yes, this includes properties that aren't implemented yet. They'll return a different error, but they'll still error out regardless, so I'm fine with this.
2021-04-26 01:15:42 -07:00
David Wendt
716d492006
avm2: The stage's name should be `null`, not an empty string; and setting it should except.
2021-04-26 01:15:42 -07:00
David Wendt
01f74f6eb1
avm2: Add a convenience method for marking a builtin override trait.
2021-04-26 01:15:42 -07:00
David Wendt
8452e23382
avm2: Allow access to the `Stage`, both directly and indirectly
2021-04-26 01:15:42 -07:00
David Wendt
81de112774
avm2: Add `Stage` class stub
2021-04-26 01:15:42 -07:00
David Wendt
f33976f4c0
avm2: Store symbol / class relationships using the class constructor, not the prototype.
2021-04-23 00:26:10 -07:00
David Wendt
aa6dc600c0
avm2: Treat construction of symbol classes as symbol instantiation.
2021-04-23 00:26:10 -07:00
David Wendt
68c270e7c0
avm2: Impl `Eq`, `Hash` for `Object` using ptr values
2021-04-23 00:26:10 -07:00
Adrian Wielgosik
8176e0a633
avm2: minor changes to domain memory
...
* Do not use as_bytearray_mut when we don't need mutability
* Set default domain memory size to 1024b.
2021-04-21 15:08:13 -07:00
CUB3D
9812fab9f8
chore: Format and fix clippy lints
2021-04-21 00:33:11 -07:00
CUB3D
7c4eb0d7ff
avm2: Implement ApplicationDomain.domainMemory
2021-04-21 00:33:11 -07:00
CUB3D
b3b1e69fc2
avm2: Store ByteArrayObject in Domain rather than ByteArrayStorage
2021-04-21 00:33:11 -07:00
CUB3D
4dc1210b37
avm2: Use try_into for converting slice->array
2021-04-21 00:33:11 -07:00
CUB3D
397ceed33c
avm2: Dont panic when domain memory not available
2021-04-21 00:33:11 -07:00
CUB3D
136add866a
chore: Fix clippy lints
2021-04-21 00:33:11 -07:00
CUB3D
63120806bf
avm2: Correct Sxi8 and Sxi16
2021-04-21 00:33:11 -07:00
CUB3D
6d2339b151
avm2: Add tests for Op::Sxi1
2021-04-21 00:33:11 -07:00
CUB3D
f34579926c
chore: Format
2021-04-21 00:33:11 -07:00
CUB3D
99edb5ab2b
avm2: Implement Op::Sxi1
2021-04-21 00:33:11 -07:00
CUB3D
9ffa4f1f50
avm2: Implement Op::Lf64
2021-04-21 00:33:11 -07:00
CUB3D
b4736413fa
avm2: Implement Op::Sf64
2021-04-21 00:33:11 -07:00
CUB3D
2b4becf41f
avm2: Implement Op::Lf32
2021-04-21 00:33:11 -07:00
CUB3D
509392db8e
avm2: Implement Op::Sf32
2021-04-21 00:33:11 -07:00
CUB3D
dce2626482
avm2: Use from/to_le_bytes
2021-04-21 00:33:11 -07:00
CUB3D
35d7c5a7e3
chore: Format
2021-04-21 00:33:11 -07:00
CUB3D
ae9d5fd328
avm2: Implement Op::Li32
2021-04-21 00:33:11 -07:00
CUB3D
951d557a90
avm2: Implement Op::Si32
2021-04-21 00:33:11 -07:00
CUB3D
96ad0e3d00
avm2: Implement Op::Li16
2021-04-21 00:33:11 -07:00
CUB3D
aaaf6ace3e
avm2: Implement Op::Si16
2021-04-21 00:33:11 -07:00
CUB3D
f437539f73
avm2: Some domain memory is available by default and error when range invalid
2021-04-21 00:33:11 -07:00
CUB3D
5a0cdf60bc
avm2: Implement Op::Si8 and Op::Li8 badly
2021-04-21 00:33:11 -07:00
CUB3D
12a198f671
avm2: Implement Op::Coerce and add tests
2021-04-21 00:33:11 -07:00
TÖRÖK Attila
46ddc31254
avm2: Call the super initializer of LoaderInfo after construction
2021-04-19 18:16:47 -07:00
relrelb
a2e162be0d
avm1: Add Value::is_primitive
...
This provides a more convenient and readable way compared to
using matches!(Value::Object(_)).
2021-04-16 15:25:22 -07:00
EmperorBale
04d80e5e4e
chore: Fix more typos
2021-04-15 00:02:40 -07:00
EmperorBale
d227c6cbce
chore: Fix formatting
2021-04-15 00:02:40 -07:00
EmperorBale
cbf8d77006
avm2: Fix IsType
2021-04-15 00:02:40 -07:00
EmperorBale
ca2709f594
avm2: Implement AsType
2021-04-15 00:02:40 -07:00
EmperorBale
17acebb108
chore: Fix formatting
2021-04-15 00:02:40 -07:00
EmperorBale
c0a56b14c0
avm2: Implement AsTypeLate
2021-04-15 00:02:40 -07:00
Mike Welsh
b9d84c0a82
chore: Appease clippy
...
Honor the branches-sharing-code lint.
2021-04-15 00:02:27 -07:00
Mike Welsh
d87be39e3c
avm2: Don't parse "inf" as Infinity
2021-04-14 21:51:48 -07:00
relrelb
20d6fcc128
chore: Remove unnecessary type annotations
2021-04-10 18:39:16 -07:00
desuwa
4f90b9d161
avm1: Support masks when mouse-picking.
2021-04-09 22:11:07 -07:00
David Wendt
5d198952e8
chore: Fix merge conflict mis-resolution
2021-04-05 16:18:37 -06:00
David Wendt
5cba07111e
avm2: Impl `LoaderInfo.parameters`
2021-04-05 16:18:37 -06:00
David Wendt
de1b0d4d0c
core: Add support for an explicit loader URL (though nothing sets it yet) and expose it in `LoaderInfo`.
2021-04-05 16:18:37 -06:00
David Wendt
4eee8be911
avm2: Impl `SWFVersion` enumeration
2021-04-05 16:18:37 -06:00
David Wendt
4c314a47cc
avm2: Impl `LoaderInfo.bytes`
2021-04-05 16:18:37 -06:00
David Wendt
a9328b228f
avm2: Allow writing to `ByteArrayStorage`
2021-04-05 16:18:37 -06:00
David Wendt
f61ea0b290
chore: Clippy beta/nightly compliance
2021-04-05 16:18:37 -06:00
David Wendt
46bf1b33c4
avm2: Impl `LoaderInfo.width`
2021-04-05 16:18:37 -06:00
David Wendt
28a1cb4308
avm2: Impl `LoaderInfo.url`
2021-04-05 16:18:37 -06:00
David Wendt
5941d6cf66
avm2: Impl `LoaderInfo.swfVersion`
2021-04-05 16:18:37 -06:00
David Wendt
6814fb9c22
avm2: Stub `LoaderInfo.isURLInaccessible`
2021-04-05 16:18:37 -06:00
David Wendt
b6e31d8be5
avm2: Impl `LoaderInfo.height`
2021-04-05 16:18:37 -06:00
David Wendt
e795da0358
avm2: Impl `LoaderInfo.frameRate`
2021-04-05 16:18:37 -06:00
David Wendt
cbd167fd6c
avm2: Stub `LoaderInfo.contentType`
2021-04-05 16:18:37 -06:00
David Wendt
7b7d250ce9
avm2: This is a getter, not a method
2021-04-05 16:18:37 -06:00
David Wendt
2a01260f52
avm2: `bytesLoaded` etc reports the compressed file length, not the uncompressed length
2021-04-05 16:18:37 -06:00
David Wendt
d0ad894f70
avm2: Impl `LoaderInfo.content`
2021-04-05 16:18:37 -06:00
David Wendt
b4cb01d2c9
avm2: Impl `LoaderInfo.bytesTotal`, and `.bytesLoaded`
...
`bytesLoaded` is currently aliased to `bytesTotal` as we do not yet support streaming loads
2021-04-05 16:18:37 -06:00
David Wendt
55e448ebaa
avm2: Impl `LoaderInfo.applicationDomain`
2021-04-05 16:18:37 -06:00
David Wendt
12dcfe7c62
avm2: Impl `LoaderInfo.actionScriptVersion`
2021-04-05 16:18:37 -06:00
David Wendt
1a7b33a1af
avm2: Impl `ActionScriptVersion`
2021-04-05 16:18:37 -06:00
David Wendt
fc26c26d1d
avm2: Allow access to `loaderInfo` on root movies
2021-04-05 16:18:37 -06:00
David Wendt
60c92dde49
avm2: Add Loader Info class & object type
2021-04-05 16:18:37 -06:00
CUB3D
e2f124ee34
avm2: Rename current_position -> instruction_start
2021-04-03 16:37:47 -06:00
CUB3D
c22ebc1de3
chore: Format on stable
2021-04-03 16:37:47 -06:00
CUB3D
d5c2e5559b
avm2: Don't mutably borrow for pos()
2021-04-03 16:37:47 -06:00
CUB3D
96f89a1643
avm2: Implement Op::LookupSwitch
2021-04-03 16:37:47 -06:00
CUB3D
209b9cec36
chore: Format
2021-03-31 18:36:24 -06:00
CUB3D
0ea564f75c
avm2: Implement Op::EscXAttr and Op::EscXElem
2021-03-31 18:36:24 -06:00
CUB3D
68527c13da
avm2: Implement flash.utils.getTimer
2021-03-29 20:46:02 -06:00
Mike Welsh
f96a414036
avm2: Lazily initialize Graphics object
...
Initialize a Sprite/Shape's Graphics object on the first access,
so that `shape.graphics == shape.graphics` is `true`.
2021-03-24 13:18:06 -07:00
Mike Welsh
040da925e4
avm2: Fix incorrect color in drawing API
2021-03-24 13:18:06 -07:00
Mike Welsh
9a08b9ae4f
avm2: flash.display.Graphics is final
2021-03-24 13:18:06 -07:00
David Wendt
1d64f38bb7
avm2: Impl `drawRect`
2021-03-24 13:18:06 -07:00
David Wendt
e3f2d0f213
avm2: Allow constructing new `Shape`s.
2021-03-24 13:18:06 -07:00
David Wendt
62a779444d
avm2: `graphics` is a `Sprite` property, not a `MovieClip` property
2021-03-24 13:18:06 -07:00
David Wendt
5e7327d041
avm2: Allow drawing on `Shape`s.
2021-03-24 13:18:06 -07:00
David Wendt
e8b6d1a52a
core: Migrate clip drawing commands to exposing the internal `Drawing` to mutation
2021-03-24 13:18:06 -07:00
David Wendt
1a6f401f1f
avm2: Implement `Graphics.moveTo`
2021-03-24 13:18:06 -07:00
David Wendt
15d3a1e99d
avm2: Implement `Graphics.lineTo`
2021-03-24 13:18:06 -07:00
David Wendt
9464a8800a
avm2: Implement `CapsStyle`
2021-03-24 13:18:06 -07:00
David Wendt
f7f98cc69e
avm2: Implement `LineScaleMode`
2021-03-24 13:18:06 -07:00
David Wendt
582d2447cd
avm2: Implement `JointStyle`
2021-03-24 13:18:06 -07:00
David Wendt
6396b90890
avm2: Implement `Graphics.lineStyle`
2021-03-24 13:18:06 -07:00
David Wendt
41ad756792
avm2: Implement `Graphics.endFill`
2021-03-24 13:18:06 -07:00
David Wendt
3dfeeacfcc
avm2: Implement `Graphics.curveTo`
2021-03-24 13:18:06 -07:00
David Wendt
71b6bca100
avm2: Implement `Graphics.clear`
2021-03-24 13:18:06 -07:00
David Wendt
f1febe33b9
avm2: Implement `Graphics.beginFill`
2021-03-24 13:18:06 -07:00
David Wendt
124e144d02
avm2: Add a class for `graphics`
2021-03-24 13:18:06 -07:00
David Wendt
05dc538a25
avm2: Use the actual `FromIterator` trait
2021-03-19 12:39:57 -07:00
David Wendt
1baadb93c2
chore: cargo fmt is fickle
2021-03-19 12:39:57 -07:00
David Wendt
a40755154d
avm2: `TextField` and `TextFormat` are sealed (non-dynamic) classes
2021-03-19 12:39:57 -07:00
David Wendt
a05423d48c
avm2: Setting a given text property also sets or resets the `html` mode (since it's not a separate property like in AS2)
2021-03-19 12:39:57 -07:00
David Wendt
f188306f4f
avm2: `setTextFormat` is range-checked
2021-03-19 12:39:57 -07:00
David Wendt
78c519cce0
avm2: Don't except when creating a dynamic TextField.
2021-03-19 12:39:57 -07:00
David Wendt
4ef01000a8
avm2: Impl `TextField.setTextFormat`
2021-03-19 12:39:57 -07:00
David Wendt
a115db49ba
avm2: Impl `TextField.setSelection`
2021-03-19 12:39:57 -07:00
David Wendt
7902914aa4
avm2: Impl `TextField.replaceText`
2021-03-19 12:39:57 -07:00
David Wendt
c22f30fdf0
avm2: Impl `TextField.replaceSelectedText`
2021-03-19 12:39:57 -07:00
David Wendt
b4d97ca183
avm2: Impl `TextField.getTextFormat`
2021-03-19 12:39:57 -07:00
David Wendt
f45c9d1889
avm2: Impl `TextField.appendText`
2021-03-19 12:39:57 -07:00
David Wendt
42f717deb8
avm2: Impl `TextField.wordWrap`
2021-03-19 12:39:57 -07:00
David Wendt
4bfc3cfda4
avm2: Impl `TextField.type`
2021-03-19 12:39:57 -07:00
David Wendt
1c2ef3154a
avm2: Impl `TextFieldType`
2021-03-19 12:39:57 -07:00
David Wendt
da563266d5
avm2: Impl `TextField.textHeight` and `TextField.textWidth`
2021-03-19 12:39:57 -07:00
David Wendt
8165aa5c4a
avm2: Impl `TextField.textColor`
2021-03-19 12:39:57 -07:00
David Wendt
c0a2547be3
avm2: Impl `TextField.text`
2021-03-19 12:39:57 -07:00
David Wendt
dee937ac3a
avm2: Impl `TextField.selectable`
2021-03-19 12:39:57 -07:00
David Wendt
b6a1bf80c1
avm2: Impl `TextField.multiline`
2021-03-19 12:39:57 -07:00
David Wendt
053b6bd4cc
avm2: Impl `TextField.length`
2021-03-19 12:39:57 -07:00
David Wendt
1ce868c51e
avm2: Impl `TextField.htmlText`
2021-03-19 12:39:57 -07:00
David Wendt
89c131bf52
avm2: Impl `TextField.embedFonts`
...
This assumes `embedFonts` is the opposite of device fonts, which sounds reasonable.
2021-03-19 12:39:57 -07:00
David Wendt
62ec106afb
avm2: Impl `TextField.displayAsPassword`
2021-03-19 12:39:57 -07:00
David Wendt
fa5145b884
avm2: Impl `TextField.defaultTextFormat`
2021-03-19 12:39:57 -07:00
David Wendt
3d8bf90794
core: Also allow converting `TextFormat` back into an AVM2 object.
2021-03-19 12:39:57 -07:00
David Wendt
3d2d2072af
avm2: Impl `TextFormatAlign`
2021-03-19 12:39:57 -07:00
David Wendt
50f992b9e6
avm2: Implement `TextField.borderColor`
2021-03-19 12:39:57 -07:00
David Wendt
8913297514
avm2: Fix type of `TextField.backgroundColor`
2021-03-19 12:39:57 -07:00
David Wendt
8d1e0992b5
avm2: Impl `TextField.border`
2021-03-19 12:39:57 -07:00
David Wendt
436b3b2ed3
avm2: Impl `TextField.backgroundColor`
2021-03-19 12:39:57 -07:00
David Wendt
a84acd55c3
avm2: Impl `TextFieldAutoSize`
2021-03-19 12:39:57 -07:00
David Wendt
e35f66fafe
avm2: Impl `TextField.autoSize`
2021-03-19 12:39:57 -07:00
David Wendt
b6adc18c9c
avm2: Impl `flash.text.TextFormat`
2021-03-19 12:39:57 -07:00
David Wendt
f44e54246d
avm2: Text fields on AVM2 movies should have AVM2 objects.
2021-03-19 12:39:57 -07:00
David Wendt
9e739f8ceb
avm2: Ensure constructed text fields have a DisplayObject side
2021-03-19 12:39:57 -07:00
David Wendt
b71286f1c4
avm2: Stub `flash.text.TextField`
2021-03-19 12:39:57 -07:00
relrelb
cdb2c279c0
avm2: Implement Nop
2021-03-19 12:39:23 -07:00
Callum Thomson
a570d96433
avm2: Implement flash.geom.Point ( #3681 )
2021-03-18 12:03:04 -07:00
relrelb
8f21c17683
chore: Rename MutationContext parameters to gc_context
2021-03-06 23:30:06 -08:00
relrelb
fff6eb2ffd
chore: Use bitflags set method
2021-03-06 23:30:06 -08:00
EmperorBale
b68eeeae26
avm2: Implement ByteArray
2021-03-05 15:01:02 -08:00
paq
d866f73c5e
avm2: Implement RegExp
2021-03-03 03:37:34 -08:00
David Wendt
540a68fb68
avm2: Grant each event it's own, separate broadcast list.
2021-03-03 03:08:01 -08:00
David Wendt
a5b4e168d3
avm2: Stub `flash.display.Shape`.
2021-03-03 03:08:01 -08:00
David Wendt
69e8a33a8e
Debug event dispatches.
2021-03-03 03:08:01 -08:00
David Wendt
a2d56016cb
avm2: Don't except when dispatching events on unconstructed objects.
2021-03-03 03:08:01 -08:00
David Wendt
ac6a206257
Fire `exitFrame`, `enterFrame`, and `frameConstructed` events as broadcasts.
2021-03-03 03:08:01 -08:00
David Wendt
d1ffa3254b
Store a list of every constructed event dispatcher so we can broadcast events on them.
2021-03-03 03:08:01 -08:00
David Wendt
731c18ad80
avm2: Issue (or attempt to issue) events for entering, exiting, and constructing, a frame.
2021-03-03 03:08:01 -08:00
David Wendt
3df97d8da2
avm2: Stub `System.gc`.
...
Our current garbage collector design precludes the ability to actually collect garbage during player updates, so this is a no-op.
2021-03-03 03:08:01 -08:00
David Wendt
464f388324
avm2: Unstaged display objects are treated as unrooted.
2021-03-03 03:08:01 -08:00
David Wendt
76ef0d4740
avm2: Event phase should be counted from 1 in `valueOf`.
2021-03-03 03:08:01 -08:00
David Wendt
c4a5c6f4d3
avm2: Constructed events start in phase 2, not 3
2021-03-03 03:08:01 -08:00
David Wendt
4521c2b599
avm2: Manually-constructed movie clips (and their subclasses) should be accessible from the display object tree.
2021-03-03 03:08:01 -08:00
David Wendt
63af38be9a
avm2: Add convenience method for natively-dispatched events.
2021-03-03 03:08:01 -08:00
Mads Marquart
dad21d4398
swf: Make avm2 Reader operate directly with byte slices
2021-02-27 17:04:42 -08:00
Aaron Hill
6050dd8204
Replace most manual `Collect` impls with `#[derive(Collect)]`
...
* Replace most unsafe impls with Collect.
* Switch to local gc-arena fork.
2021-02-17 18:38:55 -08:00
Aaron Hill
f745c39a42
chore: Remove `Collect` impls from `Activation` and `UpdateContext`
...
Neither of these impls are actually used.
As a result of this change, several fields in `avm2::Activation` became
unused. I assumed that these fields will become used as more of avm2 is
implemented, so I suppressed the warnings for now
2021-02-16 20:35:26 -08:00
CUB3D
b93e556f89
avm2: Implement Op::Typeof and dummy XML/XMLList
2021-02-16 20:21:40 -08:00
David Wendt
4905e9a83d
avm2: `Video` is a sealed class.
2021-02-16 19:03:48 -08:00
David Wendt
02b94649c3
avm2: Stub the `Video` class.
2021-02-16 19:03:48 -08:00
relrelb
bb89391f3a
chore: Avoid deprecated constants
...
The Rust documentation considers numeric constants prefixed with std::
as deprecated.
For example: https://doc.rust-lang.org/std/u16/constant.MAX.html .
2021-02-12 06:36:17 -08:00
paq
5cca3884d6
avm2: Implement `Array.length`'s setter
2021-02-07 23:49:52 -08:00
paq
8aaead90de
avm2: Implement String.charCodeAt
2021-02-07 16:11:24 -08:00
paq
c7c025277f
avm2: Implement String.charAt
2021-02-07 16:11:24 -08:00
paq
2ec21bdd07
avm2: Implement String.length
2021-02-07 16:11:24 -08:00
paq
4a87d707f0
avm2: Implement String constructor
2021-02-07 16:11:24 -08:00
paq
48d59c0340
chore: Minor refactor names.rs
2021-02-02 10:16:41 -08:00
paq
e9ad1587a4
chore: Rename Namespace::public_namespace to Namespace::public
2021-01-24 11:53:43 -08:00
paq
b58fcf3b05
chore: Use Namespace::public_namespace() instead of Namespace::package("")
2021-01-24 11:53:43 -08:00
Aaron Hill
b2f5f807de
avm2: Print full multiname for "Property does not exist" errors ( #2740 )
...
This makes it easy to see when the error is a result of something in the
"flash" package being unimplemented.
2021-01-21 17:52:17 -08:00
relrelb
b05c6540e1
chore: Migrate from enumset to bitflags
2021-01-21 16:35:46 -08:00
Mike Welsh
da1e2801a2
chore: Appease clippy
2021-01-18 21:23:50 -08:00
Mike Welsh
fae1d6fd6a
chore: Appease clippy
2021-01-04 13:17:26 -08:00
paq
8baa36e801
avm2: Implement isFinite
2020-12-27 23:02:39 -08:00
paq
ce2d7efac3
avm2: Implement isNaN
2020-12-27 23:02:39 -08:00
David Wendt
b848e4c5ff
avm2: Get rid of `RufflePrivate` and just use regular private namespaces scoped to our own domain.
2020-12-21 21:47:29 -08:00
David Wendt
30d8dc21be
avm2: Remove weird `into` constructor on `EventHandler`
2020-12-21 21:47:29 -08:00
David Wendt
7baa3cc06d
avm2: Seal the `EventDispatcher` class
2020-12-21 21:47:29 -08:00
David Wendt
3ff9b87261
avm2: `RufflePrivate` namespaces should be treated as private namespaces.
2020-12-21 21:47:29 -08:00
David Wendt
19219ad0c1
avm2: Implement `dispatchEvent`.
...
Event dispatch is a surprisingly complicated procedure, so this makes sure to test:
1. Event dispatch on bare dispatchers
2. Event dispatch on hierarchial dispatchers (movieclips)
3. Event cancellation (which is reported by `dispatchEvent`)
4. The implicit `this` on unbound event handlers. I'm not yet sure if this is a special property of event dispatch or if all unbound functions inherit their global scope as `this`.
5. The execution order of handlers on both bare and hierarchial dispatchers
6. Delegation to hierarchial dispatchers
7. Modification of the dispatch list during dispatch of an event. Surprisingly enough, you can add handlers to the event you're handling and expect them to execute, *if* you added them to a further object in the order *or* you added a bubble handler in the capture phase.
2020-12-21 21:47:29 -08:00
David Wendt
f33e5f893a
avm2: Allow builtins to get at the global scope.
2020-12-21 21:47:29 -08:00
David Wendt
8efaed40a0
avm2: `event.eventPhase` is enumerated from 1
2020-12-21 21:47:29 -08:00
David Wendt
87ff679898
avm2: Implement `EventDispatcher.willTrigger`
2020-12-21 21:47:29 -08:00