MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / cmdEval

Method cmdEval

tools/xsbug-log/xsbug-debugmachine.js:1839–1862  ·  view source on GitHub ↗
(source)

Source from the content-addressed store, hash-verified

1837 }
1838
1839 cmdEval(source) {
1840 source = source.trim();
1841 if (!source) {
1842 this.commandError('Syntax: eval <expression>');
1843 return;
1844 }
1845 if (!this.requireBroken()) {
1846 this.showPrompt();
1847 return;
1848 }
1849 if (!this.currentFrameValue) {
1850 this.commandError('No frame selected.');
1851 return;
1852 }
1853 let compiled;
1854 try {
1855 compiled = Machine.compileExpression(source);
1856 }
1857 catch (e) {
1858 this.commandError(e.message);
1859 return;
1860 }
1861 this.doEval(this.currentFrameValue, compiled);
1862 }
1863
1864 cmdDelete(args) {
1865 if (args.length < 1) {

Callers 1

handleCommandMethod · 0.95

Calls 4

commandErrorMethod · 0.95
requireBrokenMethod · 0.95
showPromptMethod · 0.95
doEvalMethod · 0.80

Tested by

no test coverage detected