Rhino.TopLevel.CacheBuiltins C# (CSharp) Method

CacheBuiltins() public method

Cache the built-in ECMAScript objects to protect them against modifications by the script.
Cache the built-in ECMAScript objects to protect them against modifications by the script. This method is called automatically by ScriptRuntime.initStandardObjects if the scope argument is an instance of this class. It only has to be called by the embedding if a top-level scope is not initialized through initStandardObjects().
public CacheBuiltins ( ) : void
return void
		public virtual void CacheBuiltins()
		{
			ctors = new EnumMap<TopLevel.Builtins, BaseFunction>(typeof(TopLevel.Builtins));
			foreach (TopLevel.Builtins builtin in TopLevel.Builtins.Values())
			{
				object value = ScriptableObject.GetProperty(this, builtin.ToString());
				if (value is BaseFunction)
				{
					ctors.Put(builtin, (BaseFunction)value);
				}
			}
		}