public object Execute(Machine machine, IObject self, IObject receiver, object[] args) { // TODO review, used in Machine to define ifNil: if (this.function == null) return this.nativeFunction(machine, self, args); return this.function(machine, self, receiver, args); }
public void CreateAndExecuteFunctionalMethod() { int count = 0; FunctionalMethod method = new FunctionalMethod((Machine machine, IObject x, IObject y, object[] args) => ++count); Assert.IsNull(method.Name); Assert.IsNull(method.Behavior); object result = method.Execute(null, null, null); Assert.AreEqual(1, count); Assert.AreEqual(1, result); }