Version 1
[yaffs-website] / vendor / jcalderonzumba / gastonjs / src / Client / Tools / inherit.js
diff --git a/vendor/jcalderonzumba/gastonjs/src/Client/Tools/inherit.js b/vendor/jcalderonzumba/gastonjs/src/Client/Tools/inherit.js
new file mode 100644 (file)
index 0000000..a67a75c
--- /dev/null
@@ -0,0 +1,28 @@
+var __extends;
+/**
+ * Helper function so objects can inherit from another
+ * @param child
+ * @param parent
+ * @return {Object}
+ * @private
+ */
+__extends = function (child, parent) {
+  var __hasProp;
+  __hasProp = {}.hasOwnProperty;
+  for (var key in parent) {
+    if (parent.hasOwnProperty(key)) {
+      if (__hasProp.call(parent, key)) {
+        child[key] = parent[key];
+      }
+    }
+  }
+
+  function ClassConstructor() {
+    this.constructor = child;
+  }
+
+  ClassConstructor.prototype = parent.prototype;
+  child.prototype = new ClassConstructor();
+  child.__super__ = parent.prototype;
+  return child;
+};