From: Mike Taylor Date: Fri, 28 Mar 2014 10:48:22 +0000 (+0000) Subject: Add mkws.objectWithParent function -- not yet used. X-Git-Tag: 1.0.0~1142 X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=86f25a52eba4a79b06c614fee9279ea583b1d549 Add mkws.objectWithParent function -- not yet used. --- diff --git a/src/mkws-core.js b/src/mkws-core.js index ba20871..893951c 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -102,6 +102,16 @@ mkws.log = function(string) { }; +mkws.objectWithParent = function(parent) { + function thing() {} // Must be function so `prototype' works + + thing.prototype = parent; + var res = new thing(); + thing.prototype = null; + return res; +}; + + mkws.registerWidgetType = function(name, fn) { mkws.widgetType2function[name] = fn; mkws.log("registered widget-type '" + name + "'");