Browse Source

Limit PrepareScript string caching to length 10 or less (#1683)

Marko Lahma 1 year ago
parent
commit
6c36bf2554
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Jint/Native/JsString.cs

+ 1 - 1
Jint/Native/JsString.cs

@@ -171,7 +171,7 @@ public class JsString : JsValue, IEquatable<JsString>, IEquatable<string>
 
     internal static JsString CachedCreate(string value)
     {
-        if (value.Length < 2)
+        if (value.Length is < 2 or > 10)
         {
             return Create(value);
         }