Skip to content

Instantly share code, notes, and snippets.

@dameleon
Created December 3, 2013 12:40
Show Gist options
  • Save dameleon/7768543 to your computer and use it in GitHub Desktop.
Save dameleon/7768543 to your computer and use it in GitHub Desktop.
function SomeClassOne() {
this.someClassTwoInstance = new SomeClassTwo(this);
}
SomeClassOne.prototype = {
foo: foo,
bar: bar,
};
function foo() {
}
function bar() {
return baz(this.someClassTwoInstance);
}
function hoge() {
}
function baz(someClassTwoInstance) {
return someClassTwoInstance.hoge();
}
function fuga() {
}
function SomeClassTwo(context) {
this.context = context;
}
SomeClassTwo.prototype = {
hoge: hoge,
fuga: fuga
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment