augment2.html revision 3c803ac3b53ba983a143b03bf688bc67b1a9db2b
<html>
<head>
<title>YUI 3.0</title>
</head>
<body>
<script type="text/javascript">
var Y = YUI({
base: '/build3x/'
}).use('node', function(Y) {
Y.on('yui:log', function(msg) {
var d=document, b=d.body, n=d.createElement("div");
if (b) {
n.appendChild(d.createTextNode(msg));
b.appendChild(n);
}
});
function ClassOne() {
}
methodA: function() {
this.methodB();
},
methodB: function() {
}
};
function ClassTwo() {
}
methodB: function() {
},
methodC: function() {
this.methodB();
}
};
Y.augment(ClassOne, ClassTwo);
var c = new ClassOne();
c.methodA();
c.methodB();
c.methodC();
function BaseClass() {
}
methodOne: function() {
}
};
function Provider() {
}
Y.extend(Provider, BaseClass, {
methodTwo: function() {
}
});
function Host() {
}
Host.prototype = {
methodThree: function() {
}
}
Y.augment(Host, Provider/*, true */);
var x = new Host();
x.methodTwo();
x.methodOne(); // Fails
Y.log('asdf');
});
</script>
</body>
</html>