本文整理汇总了C#中Microsoft.JScript.ScriptObject类的典型用法代码示例。如果您正苦于以下问题:C# ScriptObject类的具体用法?C# ScriptObject怎么用?C# ScriptObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ScriptObject类属于Microsoft.JScript命名空间,在下文中一共展示了ScriptObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NumberObject
protected NumberObject(ScriptObject parent, Object value)
: base(parent) {
this.baseType = value.GetType();
this.value = value;
this.noExpando = false;
this.implicitWrapper = false;
}
示例2: FunctionScope
internal FunctionScope(ScriptObject parent, bool isMethod) : base(parent)
{
base.isKnownAtCompileTime = true;
this.isMethod = isMethod;
this.mustSaveStackLocals = false;
if ((parent != null) && (parent is ActivationObject))
{
base.fast = ((ActivationObject) parent).fast;
}
else
{
base.fast = false;
}
this.returnVar = null;
this.owner = null;
this.isStatic = false;
this.nested_functions = null;
this.fields_for_nested_functions = null;
if (parent is FunctionScope)
{
this.ProvidesOuterScopeLocals = new SimpleHashtable(0x10);
}
else
{
this.ProvidesOuterScopeLocals = null;
}
this.closuresMightEscape = false;
}
示例3: BuiltinFunction
// Constructor.
public BuiltinFunction(ScriptObject prototype, String name,
MethodInfo method)
: base(prototype, name)
{
this.method = method;
Object[] attrs = method.GetCustomAttributes
(typeof(JSFunctionAttribute), false);
if(attrs == null || attrs.Length == 0)
{
this.flags = (JSFunctionAttributeEnum)0;
}
else
{
this.flags = ((JSFunctionAttribute)(attrs[0]))
.GetAttributeValue();
}
requiredParameters = method.GetParameters().Length;
lengthValue = requiredParameters;
if((flags & JSFunctionAttributeEnum.HasThisObject) != 0)
{
--lengthValue;
}
if((flags & JSFunctionAttributeEnum.HasEngine) != 0)
{
--lengthValue;
}
if((flags & JSFunctionAttributeEnum.HasVarArgs) != 0)
{
--lengthValue;
}
}
示例4: AddNameTo
private void AddNameTo(ScriptObject enclosingScope)
{
while (enclosingScope is WithObject)
{
enclosingScope = enclosingScope.GetParent();
}
if (((IActivationObject) enclosingScope).GetLocalField(this.name) == null)
{
FieldInfo info;
if (enclosingScope is ActivationObject)
{
if (enclosingScope is FunctionScope)
{
info = ((ActivationObject) enclosingScope).AddNewField(this.name, null, FieldAttributes.Public);
}
else
{
info = ((ActivationObject) enclosingScope).AddNewField(this.name, null, FieldAttributes.Static | FieldAttributes.Public);
}
}
else
{
info = ((StackFrame) enclosingScope).AddNewField(this.name, null, FieldAttributes.Public);
}
JSLocalField field = info as JSLocalField;
if (field != null)
{
field.debugOn = base.context.document.debugOn;
field.isDefined = true;
}
this.field = (JSVariableField) info;
}
}
示例5: FunctionObject
// Constructor.
internal FunctionObject(FunctionPrototype parent, JFunction defn,
ScriptObject declaringScope)
: base(parent, defn.name, Support.ExprListLength(defn.fparams))
{
this.defn = defn;
this.declaringScope = declaringScope;
}
示例6: LenientErrorPrototype
internal LenientErrorPrototype(LenientFunctionPrototype funcprot, ScriptObject parent, string name) : base(parent, name)
{
base.noExpando = false;
this.name = name;
Type type = typeof(ErrorPrototype);
this.toString = new BuiltinFunction("toString", this, type.GetMethod("toString"), funcprot);
}
示例7: PackageScope
public PackageScope(ScriptObject parent)
: base(parent) {
this.fast = true;
this.name = null;
this.owner = null;
this.isKnownAtCompileTime = true;
}
示例8: BlockScope
public BlockScope(ScriptObject parent, String name, int scopeId)
: base(parent){
this.scopeId = scopeId;
JSField field = (JSField)this.parent.GetField(name+":"+this.scopeId, BindingFlags.Public);
this.name_table[name] = field;
this.field_table.Add(field);
}
示例9: ArrayObject
internal ArrayObject(ScriptObject prototype, Type subType)
: base(prototype, subType) {
this.len = 0;
this.denseArray = null;
this.denseArrayLength = 0;
this.noExpando = false;
}
示例10: NumberObject
internal NumberObject(ScriptObject parent, object value, bool implicitWrapper) : base(parent, typeof(NumberObject))
{
this.baseType = Globals.TypeRefs.ToReferenceContext(value.GetType());
this.value = value;
base.noExpando = implicitWrapper;
this.implicitWrapper = implicitWrapper;
}
示例11: DateObject
internal DateObject(ScriptObject parent, double value)
: base(parent) {
this.value = value != value || value > Int64.MaxValue || value < Int64.MinValue
? Double.NaN
: System.Math.Round(value);
this.noExpando = false;
}
示例12: WithObject
internal WithObject(ScriptObject parent, Object contained_object, bool isSuperType)
: base(parent) {
this.contained_object = contained_object;
this.isKnownAtCompileTime = contained_object is Type ||
(contained_object is ClassScope && ((ClassScope)contained_object).noExpando) ||
(contained_object is JSObject && ((JSObject)contained_object).noExpando);
this.isSuperType = isSuperType;
}
示例13: LenientErrorPrototype
internal LenientErrorPrototype(LenientFunctionPrototype funcprot, ScriptObject parent, String name)
: base(parent, name) {
this.noExpando = false;
//this.constructor is given a value by the constructor class
this.name = name;
Type super = typeof(ErrorPrototype);
this.toString = new BuiltinFunction("toString", this, super.GetMethod("toString"), funcprot);
}
示例14: VsaNamedItemScope
internal VsaNamedItemScope(Object hostObject, ScriptObject parent, VsaEngine engine)
: base(parent){
this.namedItem = hostObject;
if ((this.reflectObj = hostObject as IReflect) == null)
this.reflectObj = hostObject.GetType();
this.recursive = false;
this.engine = engine;
}
示例15: LenientFunctionPrototype
internal LenientFunctionPrototype(ScriptObject parent) : base(parent)
{
base.noExpando = false;
Type type = typeof(FunctionPrototype);
this.apply = new BuiltinFunction("apply", this, type.GetMethod("apply"), this);
this.call = new BuiltinFunction("call", this, type.GetMethod("call"), this);
this.toString = new BuiltinFunction("toString", this, type.GetMethod("toString"), this);
}