MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / eval_console

Function eval_console

static/js/learnpython.js:58–77  ·  view source on GitHub ↗
(code)

Source from the content-addressed store, hash-verified

56}
57
58function eval_console(code) {
59 let text = "";
60
61 const original_log = console.log;
62 console.log = function(...args) {
63 text += args.join(" ") + "\n";
64 };
65
66 // run the code evaluation
67 eval(code);
68
69 // give the code 1 second to complete
70 return new Promise((resolve, reject) => {
71 setTimeout(() => {
72 // fix console.log
73 console.log = original_log;
74 resolve(text);
75 }, 1000);
76 });
77}
78
79function compareHTML(a, b) {
80 // TODO - check CSS

Callers 1

executeJSFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected