Fix passing Promise with remote

Somehow using value.then.bind(value) would result in infinite loop,
could be bug of Chromium.
This commit is contained in:
Cheng Zhao 2016-03-09 20:03:42 +09:00
parent dd4d3db47b
commit 6de9c4332f
4 changed files with 4 additions and 3 deletions

View file

@ -48,7 +48,7 @@ var wrapArgs = function(args, visited) {
} else if ((value != null ? value.constructor.name : void 0) === 'Promise') {
return {
type: 'promise',
then: valueToMeta(value.then.bind(value))
then: valueToMeta(function(v) { value.then(v); })
};
} else if ((value != null) && typeof value === 'object' && v8Util.getHiddenValue(value, 'atomId')) {
return {