I'm trying to use Q
Promise implementation, but am facing strange inconsistency.
When I run in Chrome m33, the following code:
new Promise(function(resolve, reject) {
resolve(1);
}).then(function(value) {
console.log(value);
});
It works just as I expect - it returns another Promise
and logs 1
.
But if I call the same code wrapped into (function (Promise) { ... }(window.Q));
, I see body of resolve
callback in console, instead of a value.
Fiddle to look at - works in Chrome and Aurora.
Am I missing something or is it a bug in the library?
PS: Q
version 1.0.0