JSFunctionAttributeEnum 枚举


指定由 JScript 编译器生成的函数的调用约定。Specifies the calling conventions of functions that are generated by the JScript compiler. JSFunctionAttribute 自定义特性一起使用。Used with the JSFunctionAttribute custom attribute.

此枚举有一个 FlagsAttribute 属性,允许按位组合成员值。

此 API 支持产品基础结构,不能在代码中直接使用。

public enum class JSFunctionAttributeEnum
public enum JSFunctionAttributeEnum
type JSFunctionAttributeEnum = 
Public Enum JSFunctionAttributeEnum


ClassicFunction 35

指定 HasArgumentsHasEngineHasThisObject 的聚合。Specifies the aggregate of HasArguments, HasEngine, and HasThisObject.

ClassicNestedFunction 47

指定 ClassicFunctionNestedFunction 的聚合。Specifies the aggregate of ClassicFunction and NestedFunction.

HasArguments 1

指定函数的第三个参数的类型为 ObjectSpecifies that the third parameter of the function is of type Object. 调用方应传入实现 JScript 参数对象的对象,通常是 ArgumentsObject 的实例。The caller should pass in an object that implements the JScript arguments object, typically an instance of ArgumentsObject. JScript 运行时假定,如果设置了 HasArguments,则也会设置 HasStackFrameHasThisObjectThe JScript runtime assumes that if HasArguments is set, then HasStackFrame and HasThisObject are also set.

HasEngine 32

指定函数的第二个参数的类型为 VsaEngineSpecifies that the second parameter of the function is of type VsaEngine. 调用方应传入一个 VsaEngine 实例,该函数可以从此实例检索运行时基础结构。The caller should pass in an instance of VsaEngine from which the function can retrieve the runtime infrastructure. JScript 运行时假定,如果设置了 HasEngine,则也会设置 HasThisObjectThe JScript runtime assumes that if HasEngine is set then HasThisObject is also set.

HasStackFrame 8

指定函数在执行对外调用之前将其局部变量复制到 JScript 运行时维护的堆栈帧对象中。控件返回到该函数时,它会将这些变量从堆栈帧对象复制回它的局部变量。Specifies that the function copies its local variables into a stack frame object maintained by the JScript runtime before making a call out. It copies the variables back from the stack frame object to its locals when control is returned to the function. 如果某一函数包含访问该父函数局部变量的嵌套函数,则设置此标志。This flag is set on functions that contain nested functions that access the parent function's locals.

HasThisObject 2

指定函数的第一个参数的类型为 Object,并且它通常名为 thisobSpecifies that the first parameter of the function is of type Object and that it is usually named thisob. 调用方应传入该函数所作用于的对象的实例。The caller should pass in an instance of the object that the function acts on.

HasVarArgs 16

指定该函数采用的参数数目可变。Specifies that the function takes a variable number of arguments. 最后一个参数的类型是 Object 数组,它保存显式指定的所有参数。The last parameter is of type array of Object, which holds any arguments that are explicitly specified.

IsExpandoMethod 64

指定函数是基于原型的对象的构造函数。Specifies that the function is a constructor function for a prototype-based object. 有关详细信息,请参阅基于原型的对象expando 修饰符For more information, see Prototype-based Objects and expando Modifier.

IsInstanceNestedClassConstructor 128

指定函数是嵌套实例类的构造函数。Specifies that the function is a constructor for a nested instance class. 该函数的第一个参数是父类的实例。The first parameter of the function an instance of the parent class.

IsNested 4

指定函数嵌套在另一个 JScript 函数中。Specifies that the function is nested in another JScript function.

NestedFunction 44

指定 HasStackFrameIsNestedHasEngine 的聚合。Specifies the aggregate of HasStackFrame, IsNested, and HasEngine.

None 0

指定一个常规 .NET Framework 方法,该方法没有特别的调用约定。Specifies a regular .NET Framework method with no special calling conventions. 通常不会使用,原因是未发出 JSFunctionAttribute。Typically not used as in this case the JSFunctionAttribute is not emitted.


与 HasArguments、HasEngine 和 HasThisObject 关联的参数是隐式的, 并且在从 JScript 代码调用函数时, JScript 运行时会自动提供这些参数。The parameters associated with HasArguments, HasEngine, and HasThisObject are implicit and are automatically provided by the JScript runtime when the function is called from JScript code.