diff src/implab/di/ValueDescriptor.js @ 34:27e8e9e38e07 default tip

Слияние
author nickolay
date Wed, 05 Jun 2019 20:44:15 +0300
parents 8af8e840dd49 1dc2fd263b90
children
line wrap: on
line diff
--- a/src/implab/di/ValueDescriptor.js	Wed Jun 05 17:44:17 2019 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-define([ "../declare", "./Descriptor", "../safe" ],
-
-function(declare, Descriptor, safe) {
-    return declare(Descriptor, {
-        _value : undefined,
-        _raw : false,
-        constructor : function(value, raw) {
-            this._value = value;
-            this._raw = Boolean(raw);
-        },
-
-        activate : function(context, name) {
-            context.enter(name, this);
-            var v = this._raw ? this._value : context.parse(
-                this._value,
-                ".params");
-            context.leave(this);
-            return v;
-        },
-
-        isInstanceCreated : function() {
-            return this._raw;
-        },
-
-        getInstance : function() {
-            if (!this._raw)
-                throw new Error("The instance isn't constructed");
-            return this._value;
-        },
-
-        toString : function() {
-            if (this._raw)
-                return "@value {raw}";
-            else
-                return safe.isNull(this._value) ? "@value <null>" : "@value";
-        }
-    });
-});
\ No newline at end of file