Skip to content

Instantly share code, notes, and snippets.

@166MMX
Created May 19, 2013 23:21
Show Gist options
  • Save 166MMX/5609506 to your computer and use it in GitHub Desktop.
Save 166MMX/5609506 to your computer and use it in GitHub Desktop.
(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