mirror of
https://github.com/github/codeql.git
synced 2025-12-17 17:23:36 +01:00
20 lines
527 B
JavaScript
20 lines
527 B
JavaScript
(function () {
|
|
function getSource() {
|
|
var source = "source"; // step 1
|
|
return source; // step 2
|
|
}
|
|
loadScript(getSource()) // step 3
|
|
.then(function () { })
|
|
.then(function () { })
|
|
.catch(handleError);
|
|
function loadScript(src) { // step 4 (is summarized)
|
|
return new Promise(function (resolve, reject) {
|
|
setTimeout(function (error) {
|
|
reject(new Error('Blah: ' + src)); // step 5
|
|
}, 1000);
|
|
});
|
|
}
|
|
function handleError(error) { // step 6
|
|
sink(error); // step 7
|
|
}
|
|
})(); |