Skip to content

Commit

Permalink
avm2: Stub isXMLName
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Jun 29, 2023
1 parent a5915a9 commit 1c151a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/avm2/globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ pub fn load_player_globals<'gc>(
)?;
function(activation, "", "isFinite", toplevel::is_finite, script)?;
function(activation, "", "isNaN", toplevel::is_nan, script)?;
function(activation, "", "isXMLName", toplevel::is_xml_name, script)?;
function(activation, "", "parseInt", toplevel::parse_int, script)?;
function(activation, "", "parseFloat", toplevel::parse_float, script)?;
function(activation, "", "escape", toplevel::escape, script)?;
Expand Down
10 changes: 10 additions & 0 deletions core/src/avm2/globals/toplevel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::avm2::activation::Activation;
use crate::avm2::error::{uri_error, Error};
use crate::avm2::object::Object;
use crate::avm2::value::Value;
use crate::avm2_stub_method;
use crate::string::{AvmString, WStr, WString};
use crate::stub::Stub;
use ruffle_wstr::Integer;
Expand Down Expand Up @@ -235,6 +236,15 @@ pub fn parse_float<'gc>(
Ok(f64::NAN.into())
}

pub fn is_xml_name<'gc>(
activation: &mut Activation<'_, 'gc>,
_this: Option<Object<'gc>>,
_args: &[Value<'gc>],
) -> Result<Value<'gc>, Error<'gc>> {
avm2_stub_method!(activation, "", "isXMLName");
Ok(true.into())
}

pub fn escape<'gc>(
activation: &mut Activation<'_, 'gc>,
_this: Option<Object<'gc>>,
Expand Down

0 comments on commit 1c151a8

Please sign in to comment.