static ArrayPrototype() { Value = new MondValue(MondValueType.Object); Value["prototype"] = ObjectPrototype.Value; Value["length"] = new MondInstanceFunction(Length); }
public void NativeInstanceFunction() { var state = new MondState(); state["value"] = 123; state["function"] = new MondInstanceFunction((_, instance, arguments) => instance[arguments[0]]); var result = state.Run(@" return global.function('value'); "); Assert.True(result == 123); }
public Closure(MondInstanceFunction function) { Type = ClosureType.InstanceNative; InstanceNativeFunction = function; }