Ejemplo n.º 1
0
        /// <summary>
        /// Assigns a value to a variable in the scope, overwriting any previous value.
        ///
        /// If there is no engine associated with the scope (see ScriptRuntime.CreateScope),
        /// then the name lookup is a literal lookup of the name in the scope's dictionary.  Therefore,
        /// it is case-sensitive for example.
        ///
        /// If there is a default engine, then the name lookup uses that language's semantics.
        /// </summary>
        public void SetVariable(ScriptScope scope, string name, object value)
        {
            ContractUtils.RequiresNotNull(scope, "scope");
            ContractUtils.RequiresNotNull(name, "name");

            _language.SetName(GetCodeContext(scope), SymbolTable.StringToId(name), value);
        }