-
-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avm2: Support reading metadata through flash.utils.describeType #11275
avm2: Support reading metadata through flash.utils.describeType #11275
Conversation
b4f1a77
to
de6925d
Compare
de6925d
to
ef43e3a
Compare
ef43e3a
to
9fc1a29
Compare
core/src/avm2/traits.rs
Outdated
@@ -222,6 +335,7 @@ impl<'gc> Trait<'gc> { | |||
disp_id: *disp_id, | |||
method: unit.load_method(*method, false, activation)?, | |||
}, | |||
metadata: metadata_from_abc_trait(activation, unit, abc_trait.metadata.clone())?, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we wanted these to be loaded lazily (at describeType()
time) from the TU, rather than eagerly? Most metadata is not used so we'd prefer to just store the index and forget about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be resolved to None very quickly if there's no metadata
c7f1500
to
b71f3c5
Compare
d846f47
to
187e3d0
Compare
187e3d0
to
693a433
Compare
@@ -287,6 +305,10 @@ impl<'gc> Trait<'gc> { | |||
&self.kind | |||
} | |||
|
|||
pub fn metadata(&self) -> Option<Box<[Metadata<'gc>]>> { | |||
self.metadata.clone() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(still wish we didn't do copying here, but I guess it's not that big of a deal...
Hopefully maybe some future class refactor might allow us to squash the duplication.)
693a433
to
66b41f7
Compare
8a5ee98
to
dcfecc1
Compare
…in describeType; parse ABC metadata key-value pairs correctly; add test
dcfecc1
to
f8b3309
Compare
This caught a bug in
swf
:swf
would parse key-value pairs for metadata incorrectly.Progresses New Club Penguin (#8330), and also anything else that uses the Robotlegs or SwiftSuspenders frameworks.
Unfortunately this doesn't progress #10403, even though I've confirmed that the class that was being checked has the same
describeType
output in FP and in Ruffle (so I would assume something's breaking with Robotlegs).