What steps will reproduce the problem?
Here is a simple testcase.
{{{
function testCombinePreresolvedResults() {
var r1 = new goog.result.SimpleResult();
var r2 = new goog.result.SimpleResult();
r1.setValue(null);
r2.setValue(null);
goog.result.combine(r1, r2);
}
}}}
What is the expected output? What do you see instead?
The test should pass but it was failed with "Multiple attempts to set the state
of this Result".
What version of the product are you using? On what operating system?
r2153
Please provide any additional information below.
Here is a patch to fix it.
{{{
Index: closure/goog/result/resultutil.js
===================================================================
--- closure/goog/result/resultutil.js (revision 2153)
+++ closure/goog/result/resultutil.js (working copy)
@@ -303,8 +303,10 @@
};
var checkResults = function() {
- if (goog.array.every(results, isResolved)) {
- combinedResult.setValue(results);
+ if (!isResolved(combinedResult)) {
+ if (goog.array.every(results, isResolved)) {
+ combinedResult.setValue(results);
+ }
}
};
}}}
Note: we cannot accept patches without the contributor license agreement
being signed. See http://code.google.com/p/closure-
library/wiki/Contributors for more info.
Original issue reported on code.google.com by sourcewa...@gmail.com on 11 Sep 2012 at 4:15
Original issue reported on code.google.com by
sourcewa...@gmail.com
on 11 Sep 2012 at 4:15