Created
May 3, 2011 20:38
-
-
Save AlexJWayne/954177 to your computer and use it in GitHub Desktop.
Package Classes
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
var Package; | |
var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { | |
for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } | |
function ctor() { this.constructor = child; } | |
ctor.prototype = parent.prototype; | |
child.prototype = new ctor; | |
child.__super__ = parent.prototype; | |
return child; | |
}; | |
Package = {}; | |
Package.Master = (function() { | |
function Master(p) { | |
this.p = p; | |
} | |
Master.prototype.m = function() { | |
return alert('mmmmm'); | |
}; | |
return Master; | |
})(); | |
Package.Slave = (function() { | |
function Slave() { | |
Slave.__super__.constructor.apply(this, arguments); | |
} | |
__extends(Slave, Package.Master); | |
Slave.prototype.someSlaveMethod = function() { | |
return foo('bar'); | |
}; | |
return Slave; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scary!