using System; using System.Collections.Generic; namespace Jint { public class Options { private bool _discardGlobal; private bool _strict; private readonly Dictionary _delegates = new Dictionary(); /// /// When called, doesn't initialize the global scope. /// Can be useful in lightweight scripts for performance reason. /// public Options DiscardGlobal(bool discard = true) { _discardGlobal = discard; return this; } public Options Strict(bool strict = true) { _strict = strict; return this; } public Options WithDelegate(string name, Delegate del) { _delegates[name] = del; return this; } internal bool GetDiscardGlobal() { return _discardGlobal; } internal IDictionary GetDelegates() { return _delegates; } internal bool IsStrict() { return _strict; } } }