From cde49de1fb0abe2fe41704c50f3994594b0fd032 Mon Sep 17 00:00:00 2001 From: sleepycatcoding <131554884+sleepycatcoding@users.noreply.github.com> Date: Fri, 18 Aug 2023 19:34:10 +0300 Subject: [PATCH] avm2: Remove undefined specific behavior in String.split --- core/src/avm2/globals/string.rs | 9 --------- .../swfs/from_avmplus/ecma3/String/e15_5_4_8_2/test.toml | 1 - 2 files changed, 10 deletions(-) diff --git a/core/src/avm2/globals/string.rs b/core/src/avm2/globals/string.rs index 84073409e653..8b68592025f7 100644 --- a/core/src/avm2/globals/string.rs +++ b/core/src/avm2/globals/string.rs @@ -12,7 +12,6 @@ use crate::avm2::QName; use crate::avm2::{ArrayObject, ArrayStorage}; use crate::string::{AvmString, WString}; use gc_arena::GcCell; -use std::iter; // All of these methods will be defined as both // AS3 instance methods and methods on the `String` class prototype. @@ -460,14 +459,6 @@ fn split<'gc>( args: &[Value<'gc>], ) -> Result, Error<'gc>> { let delimiter = args.get(0).unwrap_or(&Value::Undefined); - if matches!(delimiter, Value::Undefined) { - let this = Value::from(this); - return Ok( - ArrayObject::from_storage(activation, iter::once(this).collect()) - .unwrap() - .into(), - ); - } let this = Value::from(this).coerce_to_string(activation)?; let limit = match args.get(1).unwrap_or(&Value::Undefined) { diff --git a/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_8_2/test.toml b/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_8_2/test.toml index 29f3cef79022..cf6123969a1d 100644 --- a/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_8_2/test.toml +++ b/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_8_2/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true