control-freak-ide/Code/client/build/xace/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,d,b){var c,e=0,g=f.global;if(!b)if(a.length){c=a[e++];try{b=f.scopeMap[c]&&f.scopeMap[c][1]}catch(r){}b=b||(c in g?g[c]:d?g[c]={}:void 0)}else return g;for(;b&&(c=a[e++]);)b=
c in b?b[c]:d?b[c]={}:void 0;return b},p=Object.prototype.toString,m=function(a,d,b){return(b||[]).concat(Array.prototype.slice.call(a,d||0))},q=/\{([^\}]+)\}/g,e={_extraNames:k,_mixin:function(a,d,b){var c,e,g,f={};for(c in d)e=d[c],c in a&&(a[c]===e||c in f&&f[c]===e)||(a[c]=b?b(e):e);if(h("bug-for-in-skips-shadowed")&&d)for(g=0;g<n;++g)c=k[g],e=d[c],c in a&&(a[c]===e||c in f&&f[c]===e)||(a[c]=b?b(e):e);return a},mixin:function(a,d){a||(a={});for(var b=1,c=arguments.length;b<c;b++)e._mixin(a,arguments[b]);
return a},setObject:function(a,d,b){var c=a.split(".");a=c.pop();return(b=l(c,!0,b))&&a?b[a]=d:void 0},getObject:function(a,d,b){return l(a.split("."),d,b)},exists:function(a,d){return void 0!==e.getObject(a,!1,d)},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,d){for(var b=1,c=arguments.length;b<c;b++)e._mixin(a.prototype,arguments[b]);return a},_hitchArgs:function(a,d){var b=e._toArray(arguments,2),c=e.isString(d);return function(){var h=e._toArray(arguments),g=c?(a||
f.global)[d]:d;return g&&g.apply(a||this,b.concat(h))}},hitch:function(a,d){if(2<arguments.length)return e._hitchArgs.apply(f,arguments);d||(d=a,a=null);if(e.isString(d)){a=a||f.global;if(!a[d])throw['lang.hitch: scope["',d,'"] is null (scope\x3d"',a,'")'].join("");return function(){return a[d].apply(a,arguments||[])}}return a?function(){return d.apply(a,arguments||[])}:d},delegate:function(){function a(){}return function(d,b){a.prototype=d;var c=new a;a.prototype=null;b&&e._mixin(c,b);return c}}(),
_toArray:h("ie")?function(){function a(a,b,c){c=c||[];for(b=b||0;b<a.length;b++)c.push(a[b]);return c}return function(d){return(d.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 d,b,c;if(e.isArray(a))for(d=[],
b=0,c=a.length;b<c;++b)b in a&&d.push(e.clone(a[b]));else d=a.constructor?new a.constructor:{};return e._mixin(d,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,d,b){return a.replace(b||q,e.isFunction(d)?d:function(a,b){return e.getObject(b,!1,d)})}};e.mixin(f,e);return e});
//# sourceMappingURL=lang.js.map