Created
May 19, 2013 23:21
-
-
Save 166MMX/5609506 to your computer and use it in GitHub Desktop.
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
(function (jQuery, window) { | |
var packageRoot = window; | |
packageRoot.example = packageRoot.example || {}; | |
packageRoot.example.namespace = packageRoot.example.namespace || {}; | |
var packageBase = packageRoot.example.namespace; | |
var ObjectPrototypeToString = Object.prototype.toString; | |
var isFunction = isFunction (object) | |
{ | |
return '[object function]' === ObjectPrototypeToString.call(object); | |
}; | |
if (isFunction(packageBase.JavaScriptUtils)) | |
{ | |
return; | |
} | |
var JavaScriptUtils = function JavaScriptUtils () | |
{ | |
}; | |
JavaScriptUtils.isFunction = isFunction; | |
JavaScriptUtils.extendObject = function extendObject (subObject, supObject) | |
{ | |
var tmpObject = function tmpObject () {}; | |
subObject.superPrototype = supObject.prototype; | |
tmpObject.prototype = supObject.prototype; | |
subObject.prototype = new tmpObject(); | |
subObject.prototype.constructor = subObject; | |
subObject.superConstructor = supObject; | |
}; | |
packageBase.JavaScriptUtils = JavaScriptUtils; | |
}(jQuery, window)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment