ruffle/core/build_playerglobal
Aaron Hill fa05c66e2a avm2: Implement namespace versioning
This allows us to hide things like `MovieClip.isPlaying` from older
SWFs, which may define an `isPlaying` method without marking it
as an override.

This has the largest impact on public namespaces. There is no longer
just one public namespace - we now have a public namespace per API
version. Most callsites should use `Avm2.find_public_namespace()`,
which determines the public namespace based on the root SWF API version.
This ensures that explicit property access in Ruffle (e.g. calling
"toString") are able to see things defined in the user SWF.

This requires several changes other:

* A new `ApiVersion` enum is introduced, storing all of the api versions
  defined in avmplus
* NamespaceData::Namespace now holds an `ApiVersion`. When we read a
  namespace from a user-defined ABC file, we use the `ApiVersion` from
  the root movie clip. This matches Flash Player's behavior - when a
  child SWF is loaded through `Loader`, its API version gets overwritten
  with the parent's API version, which affects definition visibility and
  'override' requirements in the child SWF. Note that 'behavior changes'
  in methods like `gotoAndPlay` are unaffected.
* The `PartialEq` impl for `Namespace` has been removed - each call site must now choose
  to compare namespaces either by an exact version match, or by
  'compatible' versions (a `<=` check) with `Namespace::matches_ns`
* `PropertyMap` now uses `Namespace::matches_ns` to check for a
  compatible version when looking up a definition.
* When compiling our playerglobal, we pass in the `-apiversioning` flag,
  which causes asc.jar to convert `[API]` metadata into a special
  Unicode 'version mark' suffix in namespace URLs. We parse this
  when loading namespaces to determine the API version to use for
  playerglobal definitions (unmarked definitions use the lowest possible
  version).

Unfortunately, this makes ffdec unable to decompile our
playerglobal.swc
I've going to file an upstream issue
2023-11-09 15:27:33 +01:00
..
src avm2: Implement namespace versioning 2023-11-09 15:27:33 +01:00
Cargo.toml fix(deps): update rust dependencies 2023-11-01 00:45:43 +01:00
asc.jar avm2: Add support for playerglobal instance allocators 2022-07-20 23:11:46 -07:00