augment2.html revision 1b298c6f0ef597aa4ab0b8bcb25430b6c9a87749
<html>
<head>
<title>YUI 3.0</title>
</head>
<body>
<script type="text/javascript">
(function() {
if (window.opera) {
console = {
log: opera.postError,
debug: opera.postError,
warn: opera.postError,
warning: opera.postError,
error: opera.postError
}
};
var Y = YUI();
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>