summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3djs/base.js
diff options
context:
space:
mode:
Diffstat (limited to 'o3d/samples/o3djs/base.js')
-rw-r--r--o3d/samples/o3djs/base.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/o3d/samples/o3djs/base.js b/o3d/samples/o3djs/base.js
index a1cd85f..a68214c 100644
--- a/o3d/samples/o3djs/base.js
+++ b/o3d/samples/o3djs/base.js
@@ -641,6 +641,17 @@ o3djs.base.maybeDeobfuscateFunctionName_ = function(name) {
};
/**
+ * Makes one class inherit from another.
+ * @param {!Object} subClass Class that wants to inherit.
+ * @param {!Object} superClass Class to inherit from.
+ */
+o3djs.base.inherit = function(subClass, superClass) {
+ var tmpClass = function() { };
+ tmpClass.prototype = superClass.prototype;
+ subClass.prototype = new tmpClass();
+};
+
+/**
* Parses an error stack from an exception
* @param {!Exception} excp The exception to get a stack trace from.
* @return {!Array.<string>} An array of strings of the stack trace.