Skip to content

Instantly share code, notes, and snippets.

@wookimiii
Created September 19, 2014 21:58
Show Gist options
  • Save wookimiii/558f0aa24be5d3dcd0d2 to your computer and use it in GitHub Desktop.
Save wookimiii/558f0aa24be5d3dcd0d2 to your computer and use it in GitHub Desktop.
testing to see how the package assimilate js works
'use strict';
var assimilate = require('assimilate').withStrategy('proper');
function a(name) {
this.name = name;
}
a.prototype.greet = function () {
return "Hi, I'm " + this.name;
}
function b() {}
b.prototype = {
get foo() {
return "FOO! " + this.name;
}
};
function C(name) {
this.name = name;
}
C.prototype = assimilate(a.prototype, b.prototype);
console.log(C.prototype);
var c = new C("Andrew");
console.log(c.greet());
console.log(c.foo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment