使用value确定resolver的状态

@param {Resolver} resolver resolver对象
@param {Object} value 值
424298
function resolve(resolver, value) {
        // 保证resolvePromise与rejectPromise
        // 只能被调用一次
        // （不确定value是否是Promise对象）
        // see #2.3.3.3.3
        var called;

        function onFulfilled(data) {
            if (!called) {
                resolve(resolver, data);
                called = true;
            }
        }

        function onRejected(reason) {
            if (!called) {
                resolver.reject(reason);
                called = true;
            }
        }

        function work() {
            var then;
            // 不再额外判断value是否是Promise对象
            if (isObject(value) || isFunction(value)) {
                // 必须先保存对then对引用
                // 官方的test spec中有检查对then的引用次数只能为1
                then = value.then;
                if (isFunction(then)) {
                    then.call(value, onFulfilled, onRejected);
                }
                else {
                    then = null;
                }
            }

            if (!then) {
                resolver.fulfill(value);
            }
        }

        if (captureException) {
            try {
                work();
            }
            catch (e) {
                if (!called) {
                    emitExceptionEvent(e);
                    resolver.reject(e);
                }
            }
        }
        else {
            work();
        }

    }
706570
public static String resolveProperty( Properties props, String value )
    {
        return PropertyResolver.resolve( props, value );
    }
566296
function(value) {
        var defer = vow.defer(),
            promise = defer.promise();

        defer.resolve(value);

        return promise.isFulfilled()?
            promise :
            promise.then(null, function(reason) {
                return reason;
            });
    }
1148945
function doResolve(promise, resolve, reject, value, context) {
  var _reject = reject;
  var then;
  var _resolve;
  try {
    if (value === promise) {
      throw new TypeError('Cannot fulfill promise with itself');
    }
    var isObj = isObject(value);
    if (isObj && value instanceof promise.constructor) {
      adopt(promise, value._state, value._value, value);
    } else if (isObj && (then = value.then) && isFunction(then)) {
      _resolve = function(value) {
        _resolve = _reject = noop;
        doResolve(promise, resolve, reject, value, value);
      };
      _reject = function(reason) {
        _resolve = _reject = noop;
        reject(reason);
      };
      then.call(
        context,
        function(value) { _resolve(value); },
        function(reason) { _reject(reason); }
      );
    } else {
      resolve(value);
    }
  } catch (e) {
    _reject(e);
  }
}
795841
public <T> void bind(Class<T> type, SerializerResolver<? extends T> resolver)
	{
		typeToResolverCache.put(type, Optional.<SerializerResolver<?>>of(resolver));
		boundTypeToResolver.put(type, resolver);
	}
1088131
function resolverMiddleware (resolver) {
  return function (req, res, next) {
    try {
      const { source, args, context, info } = req
      const nonCircularReq = _.omit(req, [ 'context' ])
      const ctx = _.assign({}, context, { req: nonCircularReq, res, next })
      const value = resolver(source, args, ctx, info)

      // return a resolved promise
      return Promise.resolve(value)
        .then(result => {
          req.result = result
          return next()
        })
        .catch(next)
    } catch (err) {
      return next(err)
    }
  }
}
894594
function resolverMiddleware (resolver) {
  return function (req, res, next) {
    try {
      const { source, args, context, info } = req
      const ctx = { req, res, next }
      const value = resolver.call(ctx, source, args, context, info)

      return Promise.resolve(value)
        .then(result => {
          req.result = result
          return next()
        })
        .catch(next)
    } catch (err) {
      return next(err)
    }
  }
}
542843
function setValue(value) {
            value = this.beforeSetValue(value);
            this.trueValue = this.formater ? this.formater.format(value) : value;
            this.showValue = this.masker ? this.masker.format(this.trueValue).value : this.trueValue;
            this.setShowValue(this.showValue);
            this.slice = true;
            if (parseInt(this.options.rowIndex) > -1) {
                if ((this.options.rowIndex + '').indexOf('.') > 0) {
                    var childObj = this.getChildVariable();
                    var lastRow = childObj.lastRow;
                    var lastField = childObj.lastField;
                    if (lastRow) lastRow.setValue(lastField, this.trueValue);
                } else {
                    var rowObj = this.dataModel.getRow(this.options.rowIndex);
                    if (rowObj) rowObj.setValue(this.field, this.trueValue, undefined, undefined, this.validType); //增加validType参数--胡玥修改
                }
            } else {
                this.dataModel.setValue(this.field, this.trueValue, undefined, undefined, this.validType); //增加validType参数--胡玥修改
            }
            this.slice = false;
        }
6351
public final void resolve(Number value) {
		future.complete(new Tree((Tree) null, null, value));
	}
1085806
function Q(resolver) {
          if (!angular.isFunction(resolver)) {
            throw new Error('missing resolver function');
          }

          var deferred = $q.defer();

          function resolveFn(value) {
            deferred.resolve(value);
          }

          function rejectFn(reason) {
            deferred.reject(reason);
          }

          resolver(resolveFn, rejectFn);

          return deferred.promise;
        }
608076
StubParser adhocSolutions(String value) {
		if (Boolean.toString(true).equals(value)) {
			return new StubParser(this) {

				@Override
				public JsonToken nextToken() {
					return JsonToken.VALUE_TRUE;
				}

				@Override
				public JsonToken getCurrentToken() {
					return JsonToken.VALUE_TRUE;
				}
			};
		} else if (Boolean.toString(false).equals(value)) {
			return new StubParser(this) {

				@Override
				public JsonToken nextToken() {
					return JsonToken.VALUE_FALSE;
				}

				@Override
				public JsonToken getCurrentToken() {
					return JsonToken.VALUE_FALSE;
				}
			};
		} else if ("null".equals(value)) {
			return new StubParser(this) {

				@Override
				public JsonToken nextToken() {
					return JsonToken.VALUE_NULL;
				}

				@Override
				public JsonToken getCurrentToken() {
					return JsonToken.VALUE_NULL;
				}
			};
		} else if (value.startsWith("\"") && value.endsWith("\"")) {
			final StringBuilder builder = new StringBuilder(value);
			builder.deleteCharAt(0);
			builder.setLength(builder.length() - 1);
			return new StubParser(this) {

				@Override
				public JsonToken nextToken() {
					return JsonToken.VALUE_STRING;
				}

				@Override
				public JsonToken getCurrentToken() {
					return JsonToken.VALUE_STRING;
				}

				@Override
				public String getText() {
					return builder.toString();
				}
			};
		} else {
			try {
				final BigDecimal decimal = new BigDecimal(value);
				return new StubParser(this) {

					@Override
					public JsonToken nextToken() {
						try {
							decimal.longValueExact();
							return JsonToken.VALUE_NUMBER_INT;
						} catch (ArithmeticException e) {
							return JsonToken.VALUE_NUMBER_FLOAT;
						}
					}

					@Override
					public JsonToken getCurrentToken() {
						try {
							decimal.longValueExact();
							return JsonToken.VALUE_NUMBER_INT;
						} catch (ArithmeticException e) {
							return JsonToken.VALUE_NUMBER_FLOAT;
						}
					}

					@Override
					public short getShortValue() {
						return decimal.shortValue();
					}

					@Override
					public int getIntValue() {
						return decimal.intValue();
					}

					@Override
					public float getFloatValue() {
						return decimal.floatValue();
					}

					@Override
					public long getLongValue() {
						return decimal.longValue();
					}

					@Override
					public double getDoubleValue() {
						return decimal.doubleValue();
					}

					@Override
					public BigInteger getBigIntegerValue() {
						return decimal.toBigInteger();
					}

					@Override
					public BigDecimal getDecimalValue() {
						return decimal;
					}
				};
			} catch (NumberFormatException e) {
			}
		}
		return null;
	}
1170732
protected function resolveValue($value)
    {
        if (is_array($value)) {
            $this->value = isset($value['@action']) && $value['@action'] !== 'index' ? $value['@action'] : '';
            if ($this->value !== '' && isset($value['@format'])) {
                $this->value .= '.' . $value['@format'];
            }
            $exceedingArguments = [];
            foreach ($value as $argumentKey => $argumentValue) {
                if (substr($argumentKey, 0, 1) !== '@' && substr($argumentKey, 0, 2) !== '__') {
                    $exceedingArguments[$argumentKey] = $argumentValue;
                }
            }
            if ($exceedingArguments !== []) {
                $exceedingArguments = Arrays::removeEmptyElementsRecursively($exceedingArguments);
                $exceedingArguments = $this->persistenceManager->convertObjectsToIdentityArrays($exceedingArguments);
                $queryString = http_build_query([$this->name => $exceedingArguments], null, '&');
                if ($queryString !== '') {
                    $this->value .= '?' . $queryString;
                }
            }
        }

        return true;
    }
767147
function resolveRef(subobj, parent, parentKey) {
                    if (!subobj.resolved) {
                        Object.keys(subobj).forEach(function (key) {
                            var Ref, value = subobj[key];
                            if (key === "$ref") {
                                logger.debug("Resolving $ref: " + value);
                                Ref = refResolver(value);
                                value = typeof Ref === 'function' ? new Ref() : Ref;
                                if (!util.isUndefined(value) && !value.resolved) {
                                    subobj.resolved = true;
                                    resolveRef(value, subobj, key);
                                }
                                parent[parentKey] = value;
                            } else if (typeof value === "object") {
                                resolveRef(value, subobj, key);
                            }
                        });
                    }
                }
161848
private String resolve(String value) {
		if (this.beanFactory != null
				&& this.beanFactory instanceof ConfigurableBeanFactory) {
			return ((ConfigurableBeanFactory) this.beanFactory)
					.resolveEmbeddedValue(value);
		}
		return value;
	}
202235
public static _ValueReferenceWrapper resolve(ValueExpression valueExpression, final ELContext elCtx)
    {
        _ValueReferenceResolver resolver = new _ValueReferenceResolver(elCtx.getELResolver());
        ELContext elCtxDecorator = new _ELContextDecorator(elCtx, resolver);
        
        valueExpression.getValue(elCtxDecorator);
        
        while (resolver.lastObject.getBase() instanceof CompositeComponentExpressionHolder)
        {
            valueExpression = ((CompositeComponentExpressionHolder) resolver.lastObject.getBase())
                                  .getExpression((String) resolver.lastObject.getProperty());
            valueExpression.getValue(elCtxDecorator);
        }

        return resolver.lastObject;
    }
880751
public <T> void setBeanProperty(final T bean, final Object property, final Object value) {
        if (bean != null) {
            @SuppressWarnings("unchecked")
            SetResolver<T> resolver = this.setters.unsafeGet(bean.getClass());
            if (resolver != null) {
                resolver.set(bean, property, value);
                return;
            }
        }
        this.resolverManager.set(bean, property, value);
    }
1275869
public void setXPathFunctionResolver(XPathFunctionResolver resolver) {
        if ( resolver == null ) {
            String fmsg = XSLMessages.createXPATHMessage( 
                    XPATHErrorResources.ER_ARG_CANNOT_BE_NULL,
                    new Object[] {"XPathFunctionResolver"} );
            throw new NullPointerException( fmsg );
        }
        this.functionResolver = resolver;
    }