avm1: Fix add2 coerce
This commit is contained in:
parent
1fdd8f1a82
commit
a67976f601
|
@ -576,7 +576,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let b = if let Value::MovieClip(_, _) = b {
|
let b = if let Value::MovieClip(_, _) = b {
|
||||||
a.coerce_to_string(self)?.into()
|
b.coerce_to_string(self)?.into()
|
||||||
} else {
|
} else {
|
||||||
b
|
b
|
||||||
};
|
};
|
||||||
|
|
|
@ -417,7 +417,7 @@ impl<'gc> Value<'gc> {
|
||||||
Value::MovieClip(path, mc) => {
|
Value::MovieClip(path, mc) => {
|
||||||
if let Some(mc) = mc.upgrade(activation.context.gc_context) {
|
if let Some(mc) = mc.upgrade(activation.context.gc_context) {
|
||||||
if !mc.read().display_object.removed()
|
if !mc.read().display_object.removed()
|
||||||
| mc.read().display_object.pending_removal()
|
|| mc.read().display_object.pending_removal()
|
||||||
{
|
{
|
||||||
// Note that we can't re-use the `path` from the value above sadly, it would be quicker if we could
|
// Note that we can't re-use the `path` from the value above sadly, it would be quicker if we could
|
||||||
// But if the clip has been re-named, since being created then `mc.path() != path`
|
// But if the clip has been re-named, since being created then `mc.path() != path`
|
||||||
|
@ -509,7 +509,7 @@ impl<'gc> Value<'gc> {
|
||||||
if let Value::MovieClip(path, mc) = self {
|
if let Value::MovieClip(path, mc) = self {
|
||||||
// Check if we can re-use the cached `DisplayObject`, if we can then take this fast path
|
// Check if we can re-use the cached `DisplayObject`, if we can then take this fast path
|
||||||
if let Some(mc) = mc.upgrade(activation.context.gc_context) {
|
if let Some(mc) = mc.upgrade(activation.context.gc_context) {
|
||||||
if !mc.read().display_object.removed() || mc.read().display_object.pending_removal()
|
if !mc.read().display_object.removed() || mc.read().display_object.pending_removal()
|
||||||
{
|
{
|
||||||
return mc
|
return mc
|
||||||
.read()
|
.read()
|
||||||
|
|
Loading…
Reference in New Issue