Mercurial > pub > ImplabJs
changeset 1:93fb6c09f2e1
minor fixes
author | cin |
---|---|
date | Fri, 02 Jun 2017 18:15:22 +0300 |
parents | fc2517695ee1 |
children | 7d7059d2a810 |
files | src/implab/Deferred.js src/implab/Uuid.js src/implab/components/ConsoleLogChannel.js src/implab/data/StatefullStoreAdapter.js src/implab/data/StoreAdapter.js src/implab/di/Container.js src/implab/di/ReferenceDescriptor.js src/implab/di/ServiceDescriptor.js src/implab/di/ValueDescriptor.js src/implab/text/format.js |
diffstat | 10 files changed, 27 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/implab/Deferred.js Fri Jun 02 18:15:22 2017 +0300 @@ -0,0 +1,3 @@ +define(["dojo/Deferred"], function(Deferred) { + return Deferred; +}); \ No newline at end of file
--- a/src/implab/Uuid.js Thu Jun 01 13:20:03 2017 +0300 +++ b/src/implab/Uuid.js Fri Jun 02 18:15:22 2017 +0300 @@ -31,7 +31,7 @@ return _rnds8; }; _rng(); - } catch (e) {} + } catch (e) { /**/ } } if (!_rng) { @@ -70,7 +70,7 @@ return _rb(16); }; _rng(); - } catch (e) {} + } catch (e) { /**/ } } } @@ -261,7 +261,7 @@ } // Export public API - var uuid = function() { + var uuid = function () { return new String(v4()); }; uuid.v1 = v1;
--- a/src/implab/components/ConsoleLogChannel.js Thu Jun 01 13:20:03 2017 +0300 +++ b/src/implab/components/ConsoleLogChannel.js Fri Jun 02 18:15:22 2017 +0300 @@ -1,5 +1,5 @@ define( - [ "dojo/_base/declare", "./format" ], + [ "dojo/_base/declare", "../text/format" ], function(declare, format) { return declare( null,
--- a/src/implab/data/StatefullStoreAdapter.js Thu Jun 01 13:20:03 2017 +0300 +++ b/src/implab/data/StatefullStoreAdapter.js Fri Jun 02 18:15:22 2017 +0300 @@ -1,4 +1,4 @@ -define(["dojo/_base/declare", "dojo/_base/array", "core/safe", "./StoreAdapter"], function(declare, array, safe ,AdapterStore){ +define(["dojo/_base/declare", "dojo/_base/array", "../safe", "./StoreAdapter"], function(declare, array, safe ,AdapterStore){ return declare([AdapterStore], { _attrs : null,
--- a/src/implab/data/StoreAdapter.js Thu Jun 01 13:20:03 2017 +0300 +++ b/src/implab/data/StoreAdapter.js Fri Jun 02 18:15:22 2017 +0300 @@ -1,6 +1,6 @@ define([ "dojo/_base/declare", - "core/safe", + "../safe", "dojo/when", "dojo/store/util/QueryResults" ],
--- a/src/implab/di/Container.js Thu Jun 01 13:20:03 2017 +0300 +++ b/src/implab/di/Container.js Fri Jun 02 18:15:22 2017 +0300 @@ -1,8 +1,8 @@ define([ "../declare", "../safe", - "../UUID", - "dojo/Deferred", + "../Uuid", + "../Deferred", "./ActivationContext", "./Descriptor", "./ValueDescriptor", @@ -11,9 +11,8 @@ "./ActivationError" ], function ( declare, - array, safe, - UUID, + Uuid, Deferred, ActivationContext, Descriptor, @@ -45,6 +44,9 @@ return this._parent; }, + /** + * + */ getService: function (name, def) { var d = this._services[name]; if (!d) @@ -108,7 +110,7 @@ if (typeof (config) === "string") { p = new Deferred(); if (!contextRequire) { - var shim = config + "-" + UUID(); + var shim = config + "-" + Uuid(); define(shim, ["require", config], function (ctx, data) { p.resolve([data, { contextRequire: ctx @@ -228,11 +230,9 @@ if (data.services) opts.services = me._parseObject(data.services, typemap); if (data.inject) - opts.inject = data.inject instanceof Array ? array.map( - data.inject, - function (x) { - return me._parseObject(x, typemap); - }) : me._parseObject(data.inject, typemap); + opts.inject = data.inject instanceof Array ? data.inject.map(function (x) { + return me._parseObject(x, typemap); + }) : me._parseObject(data.inject, typemap); if (data.params) opts.params = me._parse(data.params, typemap); @@ -288,7 +288,7 @@ return new Value(data, true); var me = this; - return array.map(data, function (x) { + return data.map(function (x) { return me._parse(x, typemap); }); }
--- a/src/implab/di/ReferenceDescriptor.js Thu Jun 01 13:20:03 2017 +0300 +++ b/src/implab/di/ReferenceDescriptor.js Fri Jun 02 18:15:22 2017 +0300 @@ -1,5 +1,5 @@ define([ - "dojo/_base/declare", "../safe", "./Descriptor", "./ActivationError", "./ValueDescriptor" + "../declare", "../safe", "./Descriptor", "./ActivationError", "./ValueDescriptor" ], function(declare, safe, Descriptor, ActivationError, Value) {
--- a/src/implab/di/ServiceDescriptor.js Thu Jun 01 13:20:03 2017 +0300 +++ b/src/implab/di/ServiceDescriptor.js Fri Jun 02 18:15:22 2017 +0300 @@ -1,14 +1,12 @@ define( [ - "dojo/_base/declare", + "../declare", "../safe", - "dojo/_base/lang", - "dojo/_base/array", "./Descriptor", "./ValueDescriptor" ], - function (declare, safe, lang, array, Descriptor, Value) { + function (declare, safe, Descriptor, Value) { var SINGLETON_ACTIVATION = 1, CONTAINER_ACTIVATION = 2, CONTEXT_ACTIVATION = 3, @@ -220,7 +218,7 @@ }; } else if (this._params instanceof Array) { this._factory = function () { - var inst = lang.delegate(ctor.prototype); + var inst = safe.create(ctor.prototype); var ret = ctor.apply(inst, arguments); return typeof (ret) === "object" ? ret : inst; }; @@ -244,7 +242,7 @@ } if (this._inject) { - array.forEach(this._inject, function (spec) { + this._inject.forEach(function (spec) { for (var m in spec) injectMethod(instance, m, context, spec[m]); });
--- a/src/implab/di/ValueDescriptor.js Thu Jun 01 13:20:03 2017 +0300 +++ b/src/implab/di/ValueDescriptor.js Fri Jun 02 18:15:22 2017 +0300 @@ -1,4 +1,4 @@ -define([ "dojo/_base/declare", "./Descriptor", "../safe" ], +define([ "../declare", "./Descriptor", "../safe" ], function(declare, Descriptor, safe) { return declare(Descriptor, {