aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-09-07 17:48:23 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-09-07 17:48:23 -0700
commit5ec60ca0ee4529eb5ca38025d8e47e068ce8c914 (patch)
tree9c7042316ce55873f8b9ed5903b85a7f7b408156 /tools
parentc31aaf5c1b19fdccc42d29f34b9fd21ded0206c4 (diff)
call onFinish in reproduceriter
Diffstat (limited to 'tools')
-rwxr-xr-xtools/reproduceriter.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/reproduceriter.py b/tools/reproduceriter.py
index 3638b882..3402192c 100755
--- a/tools/reproduceriter.py
+++ b/tools/reproduceriter.py
@@ -265,6 +265,7 @@ var Recorder = (function() {
if (recorder.randoms.length > 0) {
return recorder.randoms.pop();
} else {
+ recorder.finish();
throw 'consuming too many values!';
}
};
@@ -273,6 +274,7 @@ var Recorder = (function() {
if (recorder.dnows.length > 0) {
return recorder.dnows.pop();
} else {
+ recorder.finish();
throw 'consuming too many values!';
}
};
@@ -280,6 +282,7 @@ var Recorder = (function() {
if (recorder.pnows.length > 0) {
return recorder.pnows.pop();
} else {
+ recorder.finish();
throw 'consuming too many values!';
}
};
@@ -291,6 +294,13 @@ var Recorder = (function() {
recorder.addListener = function(target, which, callback, arg) {
recorder['event' + which] = callback;
};
+ // Finish
+ recorder.finish = function() {
+ if (recorder.onFinish) {
+ recorder.onFinish();
+ recorder.onFinish = null;
+ }
+ };
}
return recorder;
})();