MCPcopy Create free account
hub / github.com/OpenIntroStat/ims / evalAndRun

Function evalAndRun

libs/htmlwidgets-1.5.3/htmlwidgets.js:228–243  ·  view source on GitHub ↗
(tasks, target, args)

Source from the content-addressed store, hash-verified

226 // @param args Array of arguments to be passed to the functions. (The
227 // same arguments will be passed to all functions.)
228 function evalAndRun(tasks, target, args) {
229 if (tasks) {
230 forEach(tasks, function(task) {
231 var theseArgs = args;
232 if (typeof(task) === "object") {
233 theseArgs = theseArgs.concat([task.data]);
234 task = task.code;
235 }
236 var taskFunc = tryEval(task);
237 if (typeof(taskFunc) !== "function") {
238 throw new Error("Task must be a function! Source:\n" + task);
239 }
240 taskFunc.apply(target, theseArgs);
241 });
242 }
243 }
244
245 // Attempt eval() both with and without enclosing in parentheses.
246 // Note that enclosing coerces a function declaration into

Callers 1

htmlwidgets.jsFile · 0.85

Calls 2

forEachFunction · 0.85
tryEvalFunction · 0.85

Tested by

no test coverage detected