renamed workEntity to originEntity

This commit is contained in:
azivner
2018-08-10 13:30:20 +02:00
parent 7ac109e7f7
commit 965dbcbc9a
8 changed files with 24 additions and 24 deletions

View File

@@ -1,14 +1,14 @@
import ScriptContext from "./script_context.js";
import server from "./server.js";
async function getAndExecuteBundle(noteId, workEntity = null) {
async function getAndExecuteBundle(noteId, originEntity = null) {
const bundle = await server.get('script/bundle/' + noteId);
await executeBundle(bundle, workEntity);
await executeBundle(bundle, originEntity);
}
async function executeBundle(bundle, workEntity) {
const apiContext = ScriptContext(bundle.note, bundle.allNotes, workEntity);
async function executeBundle(bundle, originEntity) {
const apiContext = ScriptContext(bundle.note, bundle.allNotes, originEntity);
return await (function () {
return eval(`const apiContext = this; (async function() { ${bundle.script}\r\n})()`);