Constructing a new object sets `constructor` on that object for SWFv6 and lower.
This commit is contained in:
parent
b8fd1eac9c
commit
17d96a0fa6
|
@ -2077,6 +2077,10 @@ impl<'gc> Avm1<'gc> {
|
|||
|
||||
let this = prototype.new(self, context, prototype, &args)?;
|
||||
|
||||
if self.current_swf_version() < 7 {
|
||||
this.set("constructor", constructor.into(), self, context)?;
|
||||
}
|
||||
|
||||
//TODO: What happens if you `ActionNewMethod` without a method name?
|
||||
constructor
|
||||
.call(self, context, this, None, &args)?
|
||||
|
@ -2114,6 +2118,11 @@ impl<'gc> Avm1<'gc> {
|
|||
.as_object()
|
||||
{
|
||||
let this = prototype.new(self, context, prototype, &args)?;
|
||||
|
||||
if self.current_swf_version() < 7 {
|
||||
this.set("constructor", constructor.into(), self, context)?;
|
||||
}
|
||||
|
||||
constructor
|
||||
.call(self, context, this, None, &args)?
|
||||
.resolve(self, context)?;
|
||||
|
|
Loading…
Reference in New Issue