Created
September 19, 2014 21:58
-
-
Save wookimiii/558f0aa24be5d3dcd0d2 to your computer and use it in GitHub Desktop.
testing to see how the package assimilate js works
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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