Skip to content

Commit

Permalink
Limit PrepareScript string caching to length 10 or less (#1683)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma authored Nov 15, 2023
1 parent c565793 commit 6c36bf2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Jint/Native/JsString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ internal static JsString Create(string value)

internal static JsString CachedCreate(string value)
{
if (value.Length < 2)
if (value.Length is < 2 or > 10)
{
return Create(value);
}
Expand Down

0 comments on commit 6c36bf2

Please sign in to comment.