(This issue tracker is only for bug reports or feature requests, if this is neither, please choose appropriate channel from http://bluebirdjs.com/docs/support.html)
Please answer the questions the best you can:
-
What version of bluebird is the issue happening on? latest
-
What platform and version? (For example Node.js 0.12 or Google Chrome 32) Chrome 50
-
Did this issue happen with earlier version of bluebird? yes
(Write description of your issue here, stack traces from errors and code that reproduces the issue are helpful)
There is an edge case with hasOwnProperty throwing a DOMException.
This function https://github.com/petkaantonov/bluebird/blob/master/src/thenables.js#L51 needs to be inside a try / catch like this:
var hasProp = {}.hasOwnProperty;
function isAnyBluebirdPromise(obj) {
try {
return hasProp.call(obj, "_promise0");
} catch (err) {
return false;
}
}
We have situations where objects like Storage are getting passed here and will throw.
Uncaught DOMException: Failed to read the '_promise0' property from 'Storage': access is denied for this document.
A simple try / catch with the catch handler returning false would do the trick!
(This issue tracker is only for bug reports or feature requests, if this is neither, please choose appropriate channel from http://bluebirdjs.com/docs/support.html)
Please answer the questions the best you can:
What version of bluebird is the issue happening on? latest
What platform and version? (For example Node.js 0.12 or Google Chrome 32) Chrome 50
Did this issue happen with earlier version of bluebird? yes
(Write description of your issue here, stack traces from errors and code that reproduces the issue are helpful)
There is an edge case with
hasOwnPropertythrowing a DOMException.This function https://github.com/petkaantonov/bluebird/blob/master/src/thenables.js#L51 needs to be inside a
try / catchlike this:We have situations where objects like
Storageare getting passed here and will throw.A simple
try / catchwith the catch handler returningfalsewould do the trick!