From 209b9cec36a947c3eb81e0ea59bfeee2eeee9340 Mon Sep 17 00:00:00 2001 From: CUB3D Date: Tue, 30 Mar 2021 01:56:08 +0100 Subject: [PATCH] chore: Format --- core/src/avm2/activation.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/core/src/avm2/activation.rs b/core/src/avm2/activation.rs index cf925a056..972884392 100644 --- a/core/src/avm2/activation.rs +++ b/core/src/avm2/activation.rs @@ -2325,7 +2325,6 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> { /// Implements `Op::EscXAttr` fn op_esc_xattr(&mut self) -> Result, Error> { - //TODO: does this coerce or type error if not string let s = self.context.avm2.pop().coerce_to_string(self)?; // Implementation of `EscapeAttributeValue` from ECMA-357(10.2.1.2) @@ -2338,21 +2337,20 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> { '\u{000A}' => r += " ", '\u{000D}' => r += " ", '\u{0009}' => r += " ", - _ => r.push(c) + _ => r.push(c), } } - self.context.avm2.push(AvmString::new(self.context.gc_context, r)); + self.context + .avm2 + .push(AvmString::new(self.context.gc_context, r)); Ok(FrameControl::Continue) } /// Implements `Op::EscXElem` fn op_esc_elem(&mut self) -> Result, Error> { - //TODO: does this coerce or type error if not string let s = self.context.avm2.pop().coerce_to_string(self)?; - //TODO: does this use escapeelement or escape value as the spec says, guessing the spec is wrong, but needs testing to be sure - // contrary to the avmplus documentation, this escapes the value on the top of the stack using EscapeElementValue from ECMA-357 *NOT* EscapeAttributeValue. // Implementation of `EscapeElementValue` from ECMA-357(10.2.1.1) let mut r = String::new(); @@ -2361,15 +2359,17 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> { '<' => r += "<", '>' => r += ">", '&' => r += "&", - _ => r.push(c) + _ => r.push(c), } } - self.context.avm2.push(AvmString::new(self.context.gc_context, r)); + self.context + .avm2 + .push(AvmString::new(self.context.gc_context, r)); Ok(FrameControl::Continue) } - #[allow(unused_variables)] + #[allow(unused_variables)] #[cfg(avm_debug)] fn op_debug( &mut self,