Skip to content

Commit 6f1f625

Browse files
trxcllntNo9
authored andcommitted
Check for LLDB up to version 20 in Linux
1 parent 39b38a9 commit 6f1f625

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

scripts/linux.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ function getLldbExecutable() {
2121
return process.env.npm_config_lldb_exe;
2222
}
2323

24-
const lldbExeNames = [
25-
'lldb', 'lldb-5.0', 'lldb-4.0',
26-
'lldb-3.9', 'lldb-3.8', 'lldb-3.7', 'lldb-3.6'
27-
];
24+
// Use `Array.prototype.concat.apply` to support
25+
// runtimes without `Array.prototype.flatMap`.
26+
// Look for LLDB up to version 20.
27+
const versions = Array.prototype.concat.apply([],
28+
Array.from({length: 20}, (_, i) => i + 1).map((major) =>
29+
Array.from({ length: major < 4 ? 10 : 1 }, (_, minor) => major + '.' + minor)
30+
));
31+
32+
const lldbExeNames = ['lldb'].concat(versions.reverse().map((v) => 'lldb-' + v));
2833

2934
return lldb.tryExecutables(lldbExeNames);
3035
}

0 commit comments

Comments
 (0)