diff options
Diffstat (limited to 'lib/utils.js')
| -rw-r--r-- | lib/utils.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/utils.js b/lib/utils.js index 9b5cfcb9..7ed7c9ad 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -39,6 +39,14 @@ var utils = { return document.evaluate(xpath, document.documentElement, namespaceResolver, resultType, null); }, + /** Sets up prototype inheritance */ + extend: function(base, sub) { + function surrogateCtor() { } + surrogateCtor.prototype = base.prototype; + sub.prototype = new surrogateCtor(); + sub.prototype.constructor = sub; + }, + /** Creates a single DOM element from :html */ createElementFromHtml: function(html) { var tmp = document.createElement("div"); |
