var new_code = code.slice(0, index) + insert + code.slice(index);
var result = sandbox.run_code(new_code, toplevel);
if (typeof result != "object" || typeof result.name != "string" || typeof result.message != "string") {
- if (match[1]) stack.push({
+ if (!stack.filled && match[1]) stack.push({
code: code,
index: index,
offset: offset,
return orig.slice(0, index) + 'throw new Error("skipping infinite recursion");' + orig.slice(index);
}
}
+ stack.filled = true;
}
}