internal static void fall_true (EmitContext ec, AST ast, Label lbl)
{
- ILGenerator ig = ec.ig;
Type type = ast.GetType ();
if (type == typeof (Expression)) {
internal static void fall_false (EmitContext ec, AST ast, Label lbl)
{
- ILGenerator ig = ec.ig;
Type type = ast.GetType ();
if (type == typeof (Expression)) {
} else
return false;
}
+
+ //
+ // Loads a current VsaEngine
+ //
+ internal static void load_engine (AST parent, ILGenerator ig)
+ {
+ //
+ // If we are in a function declaration at global level,
+ // we must load the engine associated to the current 'JScript N' instance,
+ // otherwise pick up the engine at second place in method's signature.
+ //
+ if (parent == null || parent.GetType () == typeof (ScriptBlock)) {
+ ig.Emit (OpCodes.Ldarg_0);
+ ig.Emit (OpCodes.Ldfld, typeof (ScriptObject).GetField ("engine"));
+ } else if (parent != null && parent.GetType () == typeof (FunctionDeclaration ))
+ ig.Emit (OpCodes.Ldarg_1);
+ }
}
}