Пример #1
0
        static ArrayPrototype()
        {
            Value = new MondValue(MondValueType.Object);
            Value["prototype"] = ObjectPrototype.Value;

            Value["length"] = new MondInstanceFunction(Length);
        }
Пример #2
0
        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);
        }
Пример #3
0
        public Closure(MondInstanceFunction function)
        {
            Type = ClosureType.InstanceNative;

            InstanceNativeFunction = function;
        }