mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
whitelist calls to functions that always throw an exception
This commit is contained in:
@@ -56,4 +56,16 @@
|
||||
var oneOfEach = Math.random() > 0.5 ? onlySideEffects : returnsValue;
|
||||
var g = oneOfEach(); // OK
|
||||
console.log(g);
|
||||
|
||||
function alwaysThrows() {
|
||||
if (Math.random() > 0.5) {
|
||||
console.log("Whatever!")
|
||||
} else {
|
||||
console.log("Boo!")
|
||||
}
|
||||
throw new Error("Important error!")
|
||||
}
|
||||
|
||||
var h = returnsValue() || alwaysThrows(); // OK!
|
||||
console.log(h);
|
||||
})();
|
||||
Reference in New Issue
Block a user