Added support for a special "resolvedValue" to avoid a promise being called on the next tick.
jshint fix