Skip to content

Instantly share code, notes, and snippets.

@sdesai
Created October 20, 2011 02:29
Show Gist options
  • Save sdesai/1300266 to your computer and use it in GitHub Desktop.
Save sdesai/1300266 to your computer and use it in GitHub Desktop.
Multi-Inheritance?
<!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