API changes necessary to port reddit plugin, closes #58

This commit is contained in:
azivner
2018-02-24 21:23:04 -05:00
parent a555b6319c
commit f0bea9cf71
6 changed files with 27 additions and 10 deletions

View File

@@ -12,7 +12,7 @@ async function executeScript(dataKey, script, params) {
let ret;
await sql.doInTransaction(async () => {
ret = await (function() { return eval(`(${script})(${paramsStr})`); }.call(ctx));
ret = await (function() { return eval(`const api = this; (${script})(${paramsStr})`); }.call(ctx));
});
return ret;