public object Execute(Machine machine, IObject self, object[] args) { return (new Interpreter(new ExecutionContext(machine, self, this, args))).Execute(); }
public void CompileAndRun() { Machine machine = new Machine(); IClass cls = machine.CreateClass("TestClass"); cls.DefineInstanceVariable("x"); Method mth; mth = new Method(cls, "x:"); mth.CompileArgument("newX"); mth.CompileGet("newX"); mth.CompileSet("x"); cls.DefineInstanceMethod(mth); IObject obj = (IObject)cls.NewObject(); mth.Execute(machine, obj, new object[] { 10 }); Assert.AreEqual(10, obj[0]); }