Skip to content

Commit 5beeb82

Browse files
Fix infinite loop in check-examples.js
1 parent 5a7311f commit 5beeb82

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/check-examples.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ function checkContent(x, example, file, line, firstCommand) {
5656
context_parser.variables['height'] = 1;
5757
context_parser.variables['A_VARIABLE'] = 'a';
5858
context_parser.variables['DOC_PATH'] = './a';
59+
// Needed for `within-iframe` commands.
60+
const pages = [0, 0, 0, 0, 0];
5961

6062
for (let nb_commands = 0;; ++nb_commands) {
61-
const command = context_parser.get_next_command();
63+
const command = context_parser.get_next_command(pages);
6264
if (command === null) {
6365
if (nb_commands === 0) {
6466
x.addError(`${fileAndLine}: FAILED (No command to execute)`);
@@ -78,6 +80,8 @@ ${command['error']}`);
7880
}).join('\n');
7981
x.addError(`${fileAndLine}: ${error}`);
8082
return;
83+
} else if (command['callback']) {
84+
command['callback']();
8185
}
8286
}
8387
} catch (err) {

0 commit comments

Comments
 (0)