Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return function (request) {
var params = v8capnp.toJsParams(request, Capability);
v8capnp.releaseParams(request);
Promise.cast(method.apply(self, params)).then(function (results) {
if (typeof results !== "object") {
if (results === undefined) {
results = [];
} else {
// Wrap single primitive return value in an array.
results = [results];
}
}
v8capnp.fromJs(v8capnp.getResults(request), results, LocalCapWrapper);
v8capnp.return_(request);
}).catch(function (error) {
v8capnp.throw_(request, error);
}).catch(function (error) {
console.error("Cap'n Proto v8 bug when returning from incoming method call:", error);
});
}
var next = () => {
if (arr.length === 0) {
resolve(memo);
return;
}
Promise.cast(iter(arr.shift())).then((res: W) => {
memo.push(res);
next();
}, reject);
};
next();
return executeNode([tsc, '@' + tempfilename]).then(function (result) {
if (task.fast !== 'never' && result.code === 0) {
resetChangedFiles(newFiles, targetName);
}
result.fileCount = files.length;
fs.unlinkSync(tempfilename);
exports.grunt.log.writeln(result.output);
return Promise.cast(result);
}, function (err) {
fs.unlinkSync(tempfilename);
var next = function () {
if (arr.length === 0) {
resolve(memo);
return;
}
Promise.cast(iter(arr.shift())).then(function (res) {
memo.push(res);
next();
}, reject);
};
next();
return executeNode([tsc, '@' + tempfilename]).then((result: ICompileResult) => {
if (task.fast !== 'never' && result.code === 0) {
resetChangedFiles(newFiles, targetName);
}
result.fileCount = files.length;
fs.unlinkSync(tempfilename);
grunt.log.writeln(result.output);
return Promise.cast(result);
}, (err) => {
fs.unlinkSync(tempfilename);
return executeNode([tsc, '@' + tempfilename]).then((result: ICompileResult) => {
if (task.fast !== 'never' && result.code === 0) {
resetChangedFiles(newFiles, targetName);
}
result.fileCount = files.length;
fs.unlinkSync(tempfilename);
grunt.log.writeln(result.output);
return Promise.cast(result);
}, (err) => {
fs.unlinkSync(tempfilename);