chore: Format

This commit is contained in:
CUB3D 2021-03-30 01:56:08 +01:00 committed by kmeisthax
parent ecbf6118bb
commit 209b9cec36
1 changed files with 9 additions and 9 deletions

View File

@ -2325,7 +2325,6 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
/// Implements `Op::EscXAttr`
fn op_esc_xattr(&mut self) -> Result<FrameControl<'gc>, 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 += "&#xA;",
'\u{000D}' => r += "&#xD;",
'\u{0009}' => r += "&#x9;",
_ => 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<FrameControl<'gc>, 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,10 +2359,12 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
'<' => r += "&lt;",
'>' => r += "&gt;",
'&' => r += "&amp;",
_ => 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)
}