MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / evaluateFile

Method evaluateFile

src/plugins/javascript/debugger/jsdebugger.cpp:168–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168QScriptValue JSDebugger::evaluateFile(QScriptEngine &engine, const QString &filePath)
169{
170 QFile file(filePath);
171 file.open(QIODevice::ReadOnly);
172 QString byteArray = file.readAll();
173 file.close();
174
175 // check syntax.
176 QScriptSyntaxCheckResult syntaxCheck = engine.checkSyntax(byteArray);
177 if (syntaxCheck.state() != QScriptSyntaxCheckResult::Valid) {
178 qInfo() << syntaxCheck.errorMessage() + " at line " + QString::number(syntaxCheck.errorLineNumber());
179 return {};
180 }
181 return engine.evaluate(byteArray, filePath);
182}
183
184void JSDebugger::addPagesToContext(const QScriptEngineDebugger &debugger)
185{

Callers

nothing calls this directly

Calls 7

numberClass · 0.85
readAllMethod · 0.80
errorMessageMethod · 0.80
openMethod · 0.45
closeMethod · 0.45
stateMethod · 0.45
evaluateMethod · 0.45

Tested by

no test coverage detected