control-freak-ide/Code/client/build/davinci/dojo/_base/lang.js
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

9 lines
3.4 KiB
JavaScript

//>>built
define("dojo/_base/lang",["./kernel","../has","../sniff"],function(f,h){h.add("bug-for-in-skips-shadowed",function(){for(var a in{toString:1})return 0;return 1});var k=h("bug-for-in-skips-shadowed")?"hasOwnProperty valueOf isPrototypeOf propertyIsEnumerable toLocaleString toString constructor".split(" "):[],n=k.length,l=function(a,c,b){var d,e=0,g=f.global;if(!b)if(a.length){d=a[e++];try{b=f.scopeMap[d]&&f.scopeMap[d][1]}catch(r){}b=b||(d in g?g[d]:c?g[d]={}:void 0)}else return g;for(;b&&(d=a[e++]);)b=
d in b?b[d]:c?b[d]={}:void 0;return b},p=Object.prototype.toString,m=function(a,c,b){return(b||[]).concat(Array.prototype.slice.call(a,c||0))},q=/\{([^\}]+)\}/g,e={_extraNames:k,_mixin:function(a,c,b){var d,e,g,f={};for(d in c)e=c[d],d in a&&(a[d]===e||d in f&&f[d]===e)||(a[d]=b?b(e):e);if(h("bug-for-in-skips-shadowed")&&c)for(g=0;g<n;++g)d=k[g],e=c[d],d in a&&(a[d]===e||d in f&&f[d]===e)||(a[d]=b?b(e):e);return a},mixin:function(a,c){a||(a={});for(var b=1,d=arguments.length;b<d;b++)e._mixin(a,arguments[b]);
return a},setObject:function(a,c,b){var d=a.split(".");a=d.pop();return(b=l(d,!0,b))&&a?b[a]=c:void 0},getObject:function(a,c,b){return l(a.split("."),c,b)},exists:function(a,c){return void 0!==e.getObject(a,!1,c)},isString:function(a){return"string"==typeof a||a instanceof String},isArray:function(a){return a&&(a instanceof Array||"array"==typeof a)},isFunction:function(a){return"[object Function]"===p.call(a)},isObject:function(a){return void 0!==a&&(null===a||"object"==typeof a||e.isArray(a)||
e.isFunction(a))},isArrayLike:function(a){return a&&void 0!==a&&!e.isString(a)&&!e.isFunction(a)&&!(a.tagName&&"form"==a.tagName.toLowerCase())&&(e.isArray(a)||isFinite(a.length))},isAlien:function(a){return a&&!e.isFunction(a)&&/\{\s*\[native code\]\s*\}/.test(String(a))},extend:function(a,c){for(var b=1,d=arguments.length;b<d;b++)e._mixin(a.prototype,arguments[b]);return a},_hitchArgs:function(a,c){var b=e._toArray(arguments,2),d=e.isString(c);return function(){var h=e._toArray(arguments),g=d?(a||
f.global)[c]:c;return g&&g.apply(a||this,b.concat(h))}},hitch:function(a,c){if(2<arguments.length)return e._hitchArgs.apply(f,arguments);c||(c=a,a=null);if(e.isString(c)){a=a||f.global;if(!a[c])throw['lang.hitch: scope["',c,'"] is null (scope\x3d"',a,'")'].join("");return function(){return a[c].apply(a,arguments||[])}}return a?function(){return c.apply(a,arguments||[])}:c},delegate:function(){function a(){}return function(c,b){a.prototype=c;c=new a;a.prototype=null;b&&e._mixin(c,b);return c}}(),_toArray:h("ie")?
function(){function a(a,b,d){d=d||[];for(b=b||0;b<a.length;b++)d.push(a[b]);return d}return function(c){return(c.item?a:m).apply(this,arguments)}}():m,partial:function(a){return e.hitch.apply(f,[null].concat(e._toArray(arguments)))},clone:function(a){if(!a||"object"!=typeof a||e.isFunction(a))return a;if(a.nodeType&&"cloneNode"in a)return a.cloneNode(!0);if(a instanceof Date)return new Date(a.getTime());if(a instanceof RegExp)return new RegExp(a);var c,b,d;if(e.isArray(a))for(c=[],b=0,d=a.length;b<
d;++b)b in a&&c.push(e.clone(a[b]));else c=a.constructor?new a.constructor:{};return e._mixin(c,a,e.clone)},trim:String.prototype.trim?function(a){return a.trim()}:function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},replace:function(a,c,b){return a.replace(b||q,e.isFunction(c)?c:function(a,b){return e.getObject(b,!1,c)})}};e.mixin(f,e);return e});
//# sourceMappingURL=lang.js.map