Bike.Test.TypeTest.DirectPrototype C# (CSharp) Method

DirectPrototype() private method

private DirectPrototype ( ) : void
return void
        public void DirectPrototype()
        {
            Interpret(@"var ns = {};
                        ns.Person = {
                            init: func(name, age) {
                                this.name = name;
                                this.age = age;
                            }
                        };
                        var john = {};
                        john.prototype = ns.Person.clone(); # 1 level of indirection
                        john.init('John', 10);

                        var anotherJohn = {};
                        anotherJohn.prototype = john;")
                .Equal("john.name", "John")
                .Equal("john.age", 10)
                .Equal("anotherJohn.name", "John")
                .Equal("anotherJohn.age", 10);
        }