Skip to content

Commit

Permalink
Fix call stack size exceeded error in Simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
ricktu288 committed Oct 19, 2024
1 parent 4deac77 commit 5589a9b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/simulator/js/Simulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ class Simulator {
const ret = obj.onSimulationStart();
if (ret) {
if (ret.newRays) {
this.pendingRays.push(...ret.newRays);
for (let newRay of ret.newRays) {
this.pendingRays.push(newRay);
}
}
if (ret.truncation) {
this.totalTruncation += ret.truncation;
Expand Down Expand Up @@ -656,7 +658,9 @@ class Simulator {
this.pendingRays[j] = null;
}
if (ret.newRays) {
this.pendingRays.push(...ret.newRays);
for (let newRay of ret.newRays) {
this.pendingRays.push(newRay);
}
}
if (ret.truncation) {
this.totalTruncation += ret.truncation;
Expand Down

0 comments on commit 5589a9b

Please sign in to comment.