本文整理汇总了C#中Microsoft.JScript.Vsa.VsaEngine.PushScriptObjectChecked方法的典型用法代码示例。如果您正苦于以下问题:C# VsaEngine.PushScriptObjectChecked方法的具体用法?C# VsaEngine.PushScriptObjectChecked怎么用?C# VsaEngine.PushScriptObjectChecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.JScript.Vsa.VsaEngine
的用法示例。
在下文中一共展示了VsaEngine.PushScriptObjectChecked方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: JScriptWith
// Push into a "with" scope and return the converted object.
public static Object JScriptWith(Object withOb, VsaEngine engine)
{
withOb = Convert.ToObject(withOb, engine);
if(withOb != null)
{
engine.PushScriptObjectChecked
(new WithScope(engine.ScriptObjectStackTop(), withOb));
return withOb;
}
else
{
throw new JScriptException(JSError.ObjectExpected);
}
}
示例2:
// Perform a call on this object.
internal override Object Call
(VsaEngine engine, Object thisob, Object[] args)
{
// Create a new scope object and initialize the parameters.
ScriptObject scope;
if(thisob is JSObject)
{
scope = new FunctionScope
((JSObject)thisob, defn.fparams, thisob, args);
}
else
{
scope = new FunctionScope
(declaringScope, defn.fparams, thisob, args);
}
// Push the scope onto the stack.
engine.PushScriptObjectChecked(scope);
// Call the function and pop the scope afterwards.
Object result = Empty.Value;
try
{
if(defn.body != null)
{
defn.body.Eval(engine);
}
}
catch(ReturnJumpOut r)
{
return r.value;
}
finally
{
engine.PopScriptObject();
}
// Return the function result to the caller.
return result;
}