using Jint.Native; using Jint.Native.Object; namespace Jint.Runtime.Environments { /// /// Base implementation of an Environment Record /// http://www.ecma-international.org/ecma-262/5.1/#sec-10.2.1 /// public abstract class EnvironmentRecord : ObjectInstance { protected EnvironmentRecord(Engine engine) : base(engine) { } /// /// Determines if an environment record has a binding for an identifier. /// /// The identifier of the binding /// true if it does and false if it does not. public abstract bool HasBinding(string name); /// /// Creates a new mutable binding in an environment record. /// /// The identifier of the binding. /// true if the binding may be subsequently deleted. public abstract void CreateMutableBinding(string name, bool canBeDeleted = false); /// /// Sets the value of an already existing mutable binding in an environment record. /// /// The identifier of the binding /// The value of the binding. /// The identify strict mode references. public abstract void SetMutableBinding(string name, JsValue value, bool strict); /// /// Returns the value of an already existing binding from an environment record. /// /// The identifier of the binding /// The identify strict mode references. /// The value of an already existing binding from an environment record. public abstract JsValue GetBindingValue(string name, bool strict); /// /// Delete a binding from an environment record. The String value N is the text of the bound name If a binding for N exists, remove the binding and return true. If the binding exists but cannot be removed return false. If the binding does not exist return true. /// /// The identifier of the binding /// true if the deletion is successfull. public abstract bool DeleteBinding(string name); /// /// Returns the value to use as the this value on calls to function objects that are obtained as binding values from this environment record. /// /// The value to use as this. public abstract JsValue ImplicitThisValue(); /// /// Returns an array of all the defined binding names /// /// The array of all defined bindings public abstract string[] GetAllBindingNames(); } }