X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Fmkws-core.js;h=6b1e0f6fcc4b2a30956d916d2afab510264efd73;hb=7ef365454c1ca797f41f77d80187f6014b64b4ac;hp=01f82c80e6b2c3a5a0b49535886086447e81f188;hpb=6c5cf92fb76921616c588e05049b1e40864ad12a;p=mkws-moved-to-github.git diff --git a/src/mkws-core.js b/src/mkws-core.js index 01f82c8..6b1e0f6 100644 --- a/src/mkws-core.js +++ b/src/mkws-core.js @@ -144,13 +144,25 @@ mkws.setMkwsConfig = function(overrides) { dummy: "dummy" }; - mkws.config = Object.create(config_default); + mkws.config = mkws.objectInheritingFrom(config_default); for (var k in overrides) { mkws.config[k] = overrides[k]; } }; +// This code is from Douglas Crockford's article "Prototypal Inheritance in JavaScript" +// http://javascript.crockford.com/prototypal.html +// mkws.objectInheritingFrom behaves the same as Object.create, +// but since the latter is not available in IE8 we can't use it. +// +mkws.objectInheritingFrom = function(o) { + function F() {} + F.prototype = o; + return new F(); +} + + // The following functions are dispatchers for team methods that // are called from the UI using a team-name rather than implicit // context.