Commit Graph

5833 Commits

Author SHA1 Message Date
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
David Wendt 66ac5d0693 tests: Add tests for various operations on `Dictionary`. 2021-09-25 16:54:36 -06:00
relrelb eb51e9b59a ci: Bump KSXGitHub/github-actions-deploy-aur 2021-09-25 13:40:59 +03:00
relrelb d27e29bd26 web: Mark TypeScript enums as const
Unlike regular enums, const enums are completely removed during
compilation, and as such are zero-cost in bundle size terms.
Since it is not possible to query the possible values of a const
enum at runtime, adapt the `autoplay` and `unmuteOverlay` validation
logic.
2021-09-24 20:38:44 +03:00
relrelb 0b4d6e6a1c extension: Add an option to ignore unsupported content warnings 2021-09-24 18:52:13 +03:00
relrelb bb029468ef extension: Listen for `onchange` events
For checkboxes, `click`, `onchange`, and `oninput` seem all the same,
but for other input types (e.g. dropdowns, text boxes) this matters.
2021-09-24 17:30:12 +03:00
relrelb cf3c36f306 extension: Localize label only when a translation exists
In order to not have to translate to all languages for each new option.
2021-09-24 17:30:12 +03:00
relrelb 8c19e06e5e extension: Type `utils.getOptions()` better
This disallows passing non-existent options:

```ts
utils.getOptions(["doesNotExist"]); // error
```

And also disallows using options that were not requested:

```ts
const options = utils.getOptions(["ruffleEnable"]);
options.ignoreOptout; // error
```
2021-09-24 17:30:12 +03:00
relrelb 34facdc5c2 extension: Use `Map` instead of `Record` to store option elements
This has few advantages:

* `Map` is more performant, and its keys cannot clash with builtin
JavaScript properties (e.g. `toString`).
* TypeScript has better type information about `map.keys()`, whereas
`Object.keys()` always return `string[]`.

Also, move `camelize` inside `getBooleanElements`, as it's only used
there, and unify the 2 `for` loops in `bindBooleanOptions` (iterating
`options` is wrong because it might contain options that doesn't exist
in the page).
2021-09-24 17:30:12 +03:00
relrelb bb926461a1 extension: Return a `Promise` from `injectScriptURL`
This serves 2 goals:

1. Wait for the script to be injected (when the promise is resolved),
so future `sendMessageToPage` won't happen before the script can
respond.
2. Detect errors in the script injection (when the promise is
rejected).
2021-09-24 17:30:12 +03:00
relrelb 4dfbff5f2f extension: Invert `shouldLoad` condition
This is a pure mechanical change, in order to lower the indentation
level.
2021-09-24 17:30:12 +03:00
relrelb 340837649e extension: Rename message properties
Make them short and clear:

* `uniqueMessageSuffix` -> `ID`
* `type` -> `to`
2021-09-24 17:30:12 +03: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
relrelb 54d417c539 avm1: Don't warn in case a method doesn't exist 2021-09-23 18:55:49 -06:00
David Wendt 841337e7e4 docs: Document how to create and build ABC-only tests 2021-09-23 18:43:16 -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 b4fe77394d tests: Write tests 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