Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
run() {
// TODO: Do something more robust?
if (this.running) throw new Error('BlinkLinkedRunner already running');
this.running = true;
// Clear runner-output-data.
this.filesProcessed = [];
this.urlsToFiles = {};
this.urlsToParses = {};
// Compose fresh set of memos for main pipeline computation(s).
this.pipeline = this.createPipeline();
// Find files for pipeline inputs
this.globStream = gs.createStream(`${this.blinkPath}/**/*.idl`, [], {});
this.globStream.on(
'data',
file => this.processFile(file.path.substr(`${this.blinkPath}/`.length))
);
// Return Promise handled by streaming input event listeners.
return new Promise((resolve, reject) => {
this.globStream.on('error', error => {
return Promise.resolve(this.onError(resolve, reject, error));
});
this.globStream.on('end', data => {
return Promise.all(this.eachFilePromises).then(
this.onDataReady.bind(this, resolve, reject, data),
this.onError.bind(this, resolve, reject)
);
});
function (result, next) {
var callback = self.makeNext(next)
gs.createStream(result.files, {allowEmpty: true})
.on("error", callback)
.on("data", function (data) {
// This will never be equal if `this.data.config` is
// `null`.
/* eslint-disable global-require */
if (data !== self.data.config) require(data)
/* eslint-enable global-require */
})
.on("end", callback)
},