using Acornima.Ast;
using Jint;
namespace XFESystem.Browser;
///
/// Bounded LRU for immutable packaged script syntax. Jint's Prepared instance is
/// documented as reusable across engines; no Engine, realm, JS object, global or
/// evaluated result is retained here. Ordinary network/user scripts never enter.
/// Exact source equality guards changed resources, independent of key collisions.
///
internal sealed class PreparedScriptCache(int maximumEntries = 24, int maximumCharacters = 8_388_608, int maximumNodes = 2_000_000)
{
internal const int MinimumSourceCharacters = 1_024;
internal static PreparedScriptCache Shared { get; } = new();
private sealed record Entry(string Key, string Source, Prepared