Skip to content

Instantly share code, notes, and snippets.

@ryedin
Forked from mnickel/gist:3866194
Created October 10, 2012 15:31
Show Gist options
  • Select an option

  • Save ryedin/3866362 to your computer and use it in GitHub Desktop.

Select an option

Save ryedin/3866362 to your computer and use it in GitHub Desktop.
reference hell
$.Foo = function() {
this.bar = new $.Bar();
this.biz = new $.Biz();
this.bar.setBiz(this.biz);
this.biz.setBar(this.bar);
};
$.Bar = function() {};
$.Bar.prototype.bar1 = function() {
console.log("hello bar1, i can see biz: " this.biz.biz1());
};
$.Bar.prototype.setBiz = function(biz) {
this.biz = biz;
};
$.Biz= function() {};
$.Biz.prototype.biz1 = function() {
console.log("hello biz1, i can see bar: " this.bar.bar1());
};
$.Biz.prototype.setBar = function(bar) {
this.bar = bar;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment