From ced17c514f6072139750ce807edb802c5d8e3db9 Mon Sep 17 00:00:00 2001 From: Luis Date: Tue, 15 Aug 2023 09:44:51 +0200 Subject: [PATCH] breaking for if culture found --- Jint/Native/Number/NumberPrototype.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Jint/Native/Number/NumberPrototype.cs b/Jint/Native/Number/NumberPrototype.cs index bbccd350b0..1f1efce98e 100644 --- a/Jint/Native/Number/NumberPrototype.cs +++ b/Jint/Native/Number/NumberPrototype.cs @@ -88,7 +88,11 @@ private JsValue ToLocaleString(JsValue thisObject, JsValue[] arguments) var cultureArg = arguments[0].ToString(); for (int i = 0; i < systemCultures.Length - 1; i++) { - cultureInfo = systemCultures[i] == cultureArg ? new CultureInfo(systemCultures[i]) : cultureInfo; + if (systemCultures[i] == cultureArg) + { + cultureInfo = new CultureInfo(systemCultures[i]); + break; + } } }