Commit Graph

5328 Commits

Author SHA1 Message Date
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 01904acad3 tests: Add `Vector.<T>.join` tests 2021-09-02 17:57:58 -06:00
David Wendt f255c7d577 tests: Add tests for multi-dimensional vector coercion typechecks & concatenation 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 ecf514969b tests: Add a test for concatenating to lists of ES4 interfaces. 2021-09-02 17:57:58 -06:00
David Wendt 8740098e5d tests: Recompile the `vector_es4class_concat` test 2021-09-02 17:57:58 -06:00
David Wendt 70b60d6bb4 tests: Recompile the concat test 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 9a1b864988 tests: Add tests for `Vector.concat` 2021-09-02 17:57:58 -06:00
David Wendt 176f05a16b tests: Recompile a handful of miscompiled tests 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 1711400f07 tests: Actually enable all the vector tests I've been running 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 f6ea1b2bff tests: Add a test for the `delete` operator 2021-09-02 17:57:58 -06:00
David Wendt f3cf82ad5a tests: Add test for sticking ES3 classes in a `Vector.<Object>` 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 e65958cc22 tests: Add another test for subclass and superclass 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 2af5192893 tests: Add tests for vector holes and set coercion 2021-09-02 17:57:58 -06:00
David Wendt 9a3c4e6adb tests: Here's a very basic test for int access 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 9dafddc1ae swf: Decode and encode the `applytype` op. 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
dependabot[bot] 8b665b590d chore: Bump typescript from 4.3.4 to 4.4.2 in /web
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.4 to 4.4.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.3.4...v4.4.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-02 17:03:19 +03:00
dependabot[bot] 35e32582df chore: Bump @wdio/cli from 7.9.0 to 7.11.1 in /web
Bumps [@wdio/cli](https://github.com/webdriverio/webdriverio) from 7.9.0 to 7.11.1.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v7.9.0...v7.11.1)

---
updated-dependencies:
- dependency-name: "@wdio/cli"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-02 13:37:06 +03:00
relrelb 44d1677ed6 web: Allow migration to TypeScript 4.4
More info at: https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/#use-unknown-catch-variables
2021-09-02 10:09:21 +03:00
dependabot[bot] 0ce601c185 chore: Bump @wdio/static-server-service from 7.7.3 to 7.10.1 in /web
Bumps [@wdio/static-server-service](https://github.com/webdriverio/webdriverio) from 7.7.3 to 7.10.1.
- [Release notes](https://github.com/webdriverio/webdriverio/releases)
- [Changelog](https://github.com/webdriverio/webdriverio/blob/main/CHANGELOG.md)
- [Commits](https://github.com/webdriverio/webdriverio/compare/v7.7.3...v7.10.1)

---
updated-dependencies:
- dependency-name: "@wdio/static-server-service"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-02 10:08:27 +03:00
dependabot[bot] 1cc827880d chore: Bump copy-webpack-plugin from 9.0.0 to 9.0.1 in /web
Bumps [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) from 9.0.0 to 9.0.1.
- [Release notes](https://github.com/webpack-contrib/copy-webpack-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/copy-webpack-plugin/compare/v9.0.0...v9.0.1)

---
updated-dependencies:
- dependency-name: copy-webpack-plugin
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-02 10:08:05 +03:00