From a44546ab1c8893ba1882fcd6ab9913e167c2ce65 Mon Sep 17 00:00:00 2001 From: sleepycatcoding <131554884+sleepycatcoding@users.noreply.github.com> Date: Fri, 18 Aug 2023 19:00:47 +0300 Subject: [PATCH] avm2: Do not ignore nulls in String.fromCharCode --- core/src/avm2/globals/string.rs | 4 ---- .../from_avmplus/ecma3/GlobalObject/e15_1_2_5_3/test.toml | 1 - .../swfs/from_avmplus/ecma3/String/e15_5_3_2_3/test.toml | 1 - .../swfs/from_avmplus/ecma3/String/e15_5_4_11_1/test.toml | 1 - .../swfs/from_avmplus/ecma3/String/e15_5_4_12_1/test.toml | 1 - .../swfs/from_avmplus/ecma3/String/e15_5_4_5_4/test.toml | 1 - .../from_avmplus/ecma3/String/toLocaleLowerCase/test.toml | 1 - .../from_avmplus/ecma3/String/toLocaleUpperCase5/test.toml | 1 - .../swfs/from_avmplus/ecma3/TypeConversion/e9_7/test.toml | 1 - 9 files changed, 12 deletions(-) diff --git a/core/src/avm2/globals/string.rs b/core/src/avm2/globals/string.rs index 4ef7f9873f37..84073409e653 100644 --- a/core/src/avm2/globals/string.rs +++ b/core/src/avm2/globals/string.rs @@ -189,10 +189,6 @@ fn from_char_code<'gc>( let mut out = WString::with_capacity(args.len(), false); for arg in args { let i = arg.coerce_to_u32(activation)? as u16; - if i == 0 { - // Ignore nulls. - continue; - } out.push(i); } Ok(AvmString::new(activation.context.gc_context, out).into()) diff --git a/tests/tests/swfs/from_avmplus/ecma3/GlobalObject/e15_1_2_5_3/test.toml b/tests/tests/swfs/from_avmplus/ecma3/GlobalObject/e15_1_2_5_3/test.toml index 29f3cef79022..cf6123969a1d 100644 --- a/tests/tests/swfs/from_avmplus/ecma3/GlobalObject/e15_1_2_5_3/test.toml +++ b/tests/tests/swfs/from_avmplus/ecma3/GlobalObject/e15_1_2_5_3/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true diff --git a/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_3_2_3/test.toml b/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_3_2_3/test.toml index 29f3cef79022..cf6123969a1d 100644 --- a/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_3_2_3/test.toml +++ b/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_3_2_3/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true diff --git a/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_11_1/test.toml b/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_11_1/test.toml index 29f3cef79022..cf6123969a1d 100644 --- a/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_11_1/test.toml +++ b/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_11_1/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true diff --git a/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_12_1/test.toml b/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_12_1/test.toml index 29f3cef79022..cf6123969a1d 100644 --- a/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_12_1/test.toml +++ b/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_12_1/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true diff --git a/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_5_4/test.toml b/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_5_4/test.toml index 29f3cef79022..cf6123969a1d 100644 --- a/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_5_4/test.toml +++ b/tests/tests/swfs/from_avmplus/ecma3/String/e15_5_4_5_4/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true diff --git a/tests/tests/swfs/from_avmplus/ecma3/String/toLocaleLowerCase/test.toml b/tests/tests/swfs/from_avmplus/ecma3/String/toLocaleLowerCase/test.toml index 29f3cef79022..cf6123969a1d 100644 --- a/tests/tests/swfs/from_avmplus/ecma3/String/toLocaleLowerCase/test.toml +++ b/tests/tests/swfs/from_avmplus/ecma3/String/toLocaleLowerCase/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true diff --git a/tests/tests/swfs/from_avmplus/ecma3/String/toLocaleUpperCase5/test.toml b/tests/tests/swfs/from_avmplus/ecma3/String/toLocaleUpperCase5/test.toml index 29f3cef79022..cf6123969a1d 100644 --- a/tests/tests/swfs/from_avmplus/ecma3/String/toLocaleUpperCase5/test.toml +++ b/tests/tests/swfs/from_avmplus/ecma3/String/toLocaleUpperCase5/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true diff --git a/tests/tests/swfs/from_avmplus/ecma3/TypeConversion/e9_7/test.toml b/tests/tests/swfs/from_avmplus/ecma3/TypeConversion/e9_7/test.toml index 29f3cef79022..cf6123969a1d 100644 --- a/tests/tests/swfs/from_avmplus/ecma3/TypeConversion/e9_7/test.toml +++ b/tests/tests/swfs/from_avmplus/ecma3/TypeConversion/e9_7/test.toml @@ -1,2 +1 @@ num_ticks = 1 -known_failure = true