Rhino.NativeFunction.GetParamOrVarConst C# (CSharp) Method

GetParamOrVarConst() protected method

Get parameter or variable const-ness.
Get parameter or variable const-ness. If index < GetParamCount() , then return the const-ness of the corresponding parameter. Otherwise return whether the variable is const.
protected GetParamOrVarConst ( int index ) : bool
index int
return bool
		protected internal virtual bool GetParamOrVarConst(int index)
		{
			// By default return false to preserve compatibility with existing
			// classes subclassing this class, which are mostly generated by jsc
			// from earlier Rhino versions. See Bugzilla #396117.
			return false;
		}
	}

Usage Example

示例#1
0
		internal NativeCall(NativeFunction function, Scriptable scope, object[] args)
		{
			this.function = function;
			SetParentScope(scope);
			// leave prototype null
			this.originalArgs = (args == null) ? ScriptRuntime.emptyArgs : args;
			// initialize values of arguments
			int paramAndVarCount = function.GetParamAndVarCount();
			int paramCount = function.GetParamCount();
			if (paramAndVarCount != 0)
			{
				for (int i = 0; i < paramCount; ++i)
				{
					string name = function.GetParamOrVarName(i);
					object val = i < args.Length ? args[i] : Undefined.instance;
					DefineProperty(name, val, PERMANENT);
				}
			}
			// initialize "arguments" property but only if it was not overridden by
			// the parameter with the same name
			if (!base.Has("arguments", this))
			{
				DefineProperty("arguments", new Arguments(this), PERMANENT);
			}
			if (paramAndVarCount != 0)
			{
				for (int i = paramCount; i < paramAndVarCount; ++i)
				{
					string name = function.GetParamOrVarName(i);
					if (!base.Has(name, this))
					{
						if (function.GetParamOrVarConst(i))
						{
							DefineProperty(name, Undefined.instance, CONST);
						}
						else
						{
							DefineProperty(name, Undefined.instance, PERMANENT);
						}
					}
				}
			}
		}
All Usage Examples Of Rhino.NativeFunction::GetParamOrVarConst