avm1: Pass undefined this for CallMethod with non-string method_name
This isn't the most accurate behavior, since it should be an unboxed Value, but currently it's not possible due to #843.
This commit is contained in:
parent
6a34070e76
commit
95cffdc2f9
|
@ -860,8 +860,9 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
|
|||
// Call `this[method_name]`
|
||||
object.call_method(&method_name.as_str(), &args, self)?
|
||||
} else {
|
||||
// Undefined/empty method name; call `this` as a function
|
||||
let this = self.target_clip_or_root()?.object().coerce_to_object(self);
|
||||
// Undefined/empty method name; call `this` as a function.
|
||||
// TODO: Pass primitive value instead of boxing (#843).
|
||||
let this = Value::Undefined.coerce_to_object(self);
|
||||
object.call("[Anonymous]", self, this, None, &args)?
|
||||
};
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ impl<'gc> Timers<'gc> {
|
|||
);
|
||||
|
||||
// TODO: `this` is undefined for non-method timer callbacks, but our VM
|
||||
// currently doesn't allow `this` to be a Value.
|
||||
// currently doesn't allow `this` to be a Value (#843).
|
||||
let undefined = Value::Undefined.coerce_to_object(&mut activation);
|
||||
|
||||
let mut tick_count = 0;
|
||||
|
|
Loading…
Reference in New Issue