Skip to content

Instantly share code, notes, and snippets.

@gvidon
Created November 30, 2014 15:22
Show Gist options
  • Save gvidon/966b2c7f19b59531c1e8 to your computer and use it in GitHub Desktop.
Save gvidon/966b2c7f19b59531c1e8 to your computer and use it in GitHub Desktop.
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
</head>
<body>
<script type="text/javascript" src="bower_components/underscore/underscore-min.js"></script>
<script type="text/javascript" src="bower_components/ring/ring.js"></script>
<script type="text/javascript">
var
A = ring.create({
testMe: function() { console.log('A'); _.result(this, '$super') }
}),
B = ring.create({
testMe: function() { console.log('B'); _.result(this, '$super') }
}),
// Swapping to [B, A] will change the order of output
C = ring.create([A, B], {
testMe: function() { console.log('C'); this.$super() }
}),
D = ring.create(C, {
testMe: function() { console.log('D'); this.$super() }
});
(new D).testMe();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment