aboutsummaryrefslogtreecommitdiff
path: root/src/enzymatic.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-17 21:24:03 -0700
committeralon@honor <none@none>2010-10-17 21:24:03 -0700
commit04dff51782dd5e8bb1a209e93d39499c59b190fa (patch)
tree20e38183923abe6d4007c2d7b27126a6d2a81a90 /src/enzymatic.js
parentd16c1a6c068b8a293cf63723324e792dea187992 (diff)
more permissive stack analysis of initial allocations
Diffstat (limited to 'src/enzymatic.js')
-rw-r--r--src/enzymatic.js25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/enzymatic.js b/src/enzymatic.js
index 5983f305..bb4458fe 100644
--- a/src/enzymatic.js
+++ b/src/enzymatic.js
@@ -76,10 +76,16 @@ Substrate.prototype = {
var inputs = zyme.items.slice(0);
var outputs;
var currResultCount = that.results.length;
- dprint('Processing using ' + zyme.name_ + ': ' + inputs.length);
- zyme.items = []; // More may be added in process(); we'll get to them next time
- outputs = zyme.process(inputs);
- dprint('New results: ' + (outputs.length + that.results.length - currResultCount) + ' out of ' + (that.results.length + outputs.length));
+ try {
+ dprint('Processing using ' + zyme.name_ + ': ' + inputs.length);
+ zyme.items = []; // More may be added in process(); we'll get to them next time
+ outputs = zyme.process(inputs);
+ dprint('New results: ' + (outputs.length + that.results.length - currResultCount) + ' out of ' + (that.results.length + outputs.length));
+ } catch (e) {
+ print("Exception, current selected are: " + inputs.map(dump).join('\n\n'));
+ print("Stack: " + dump(new Error().stack));
+ throw e;
+ }
hadProcessing = true;
if (outputs) {
@@ -118,9 +124,14 @@ Zyme.prototype = {
var ret = [];
for (var i = 0; i < items.length; i++) {
var item = items[i];
- var outputs = this.processItem(item);
- if (outputs) {
- ret = ret.concat(outputs);
+ try {
+ var outputs = this.processItem(item);
+ if (outputs) {
+ ret = ret.concat(outputs);
+ }
+ } catch (e) {
+ print("Exception in process(), current item is: " + dump(item));
+ throw e;
}
}
return ret;