File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -192,9 +192,6 @@ export const callIteratively = (f: any, ...args: any[]) => {
192
192
const pastCalls : [ string , any [ ] ] [ ] = [ ]
193
193
while ( true ) {
194
194
const dummy = locationDummyNode ( line , column )
195
- if ( Date . now ( ) - startTime > MAX_TIME ) {
196
- throw new PotentialInfiniteRecursionError ( dummy , pastCalls )
197
- }
198
195
f = forceIt ( f )
199
196
if ( typeof f === 'function' ) {
200
197
if ( f . transformedFunction !== undefined ) {
@@ -223,6 +220,9 @@ export const callIteratively = (f: any, ...args: any[]) => {
223
220
let res
224
221
try {
225
222
res = f ( ...args )
223
+ if ( Date . now ( ) - startTime > MAX_TIME ) {
224
+ throw new PotentialInfiniteRecursionError ( dummy , pastCalls )
225
+ }
226
226
} catch ( error ) {
227
227
// if we already handled the error, simply pass it on
228
228
if ( ! ( error instanceof RuntimeSourceError || error instanceof ExceptionError ) ) {
You can’t perform that action at this time.
0 commit comments