OLOO

by Anonymous

JavaScript

if(!Object.create){
	Object.create = function(o){
    	function F(){};
        F.prototype = o;
        return new F();
    }
}

var Foo = {
	test: function(){ return "test"; }
}

var Bar = Object.create(Foo);
alert(Bar.__proto__.test);
alert(Bar.test());
alert(Foo);