Make sure that we actually call the super constructor, not our own constructor.

This commit is contained in:
David Wendt 2020-02-25 19:53:36 -05:00
parent 1b67bb94c8
commit 73966f1b31
1 changed files with 5 additions and 2 deletions

View File

@ -1113,12 +1113,15 @@ impl<'gc> Avm2<'gc> {
let args = self.pop_args(arg_count);
let receiver = self.pop().as_object()?;
let name = QName::new(Namespace::public_namespace(), "constructor");
let function = self
let base_proto: Result<Object<'gc>, Error> = self
.current_stack_frame()
.unwrap()
.read()
.base_proto()
.unwrap_or(receiver)
.and_then(|p| p.proto())
.ok_or_else(|| "No base prototype!".to_string().into());
let function = base_proto?
.get_property(&name, self, context)?
.resolve(self, context)?
.as_object()?;