Created
October 20, 2011 02:29
-
-
Save sdesai/1300266 to your computer and use it in GitHub Desktop.
Multi-Inheritance?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
YUI({filter:"raw", combine:false}).use('base', function(Y) { | |
function Bar() {} | |
Bar.prototype.bar = function() { | |
console.log("bar"); | |
}; | |
function Foo() {} | |
Y.extend(Foo, Bar, { | |
foo: function() { | |
console.log("foo"); | |
} | |
}); | |
function FooBarBase() {} | |
function FooBar() {} | |
Y.extend(FooBar, FooBarBase); | |
var f = new FooBar(); | |
Y.augment(f, Foo); | |
f.foo(); | |
f.bar(); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment