Skip to content

Instantly share code, notes, and snippets.

@phiggins42
Created March 14, 2011 17:07
Show Gist options
  • Save phiggins42/869467 to your computer and use it in GitHub Desktop.
Save phiggins42/869467 to your computer and use it in GitHub Desktop.
dojo.declare("Foo", null, {
constructor: function(a){ dojo.mixin(this, a); },
bar: function(a, b){
console.log(a, b);
}
});
dojo.declare("Baz", Foo, {
bar: function(b, a){
// "bar" is name, "arguments" is required, "[a,b] is new arguments to pass"
this.inherited("bar", arguments, [a, b]);
}
});
var x = new Baz();
x.bar(2, 1); // outputs "1, 2" from inherited bar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment