OpenCoverage

qv4runtimecodegen.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4runtimecodegen.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2using namespace QV4;-
3-
4void RuntimeCodegen::generateFromFunctionExpression(const QString &fileName,-
5 const QString &sourceCode,-
6 AST::FunctionExpression *ast,-
7 Compiler::Module *module)-
8{-
9 _module = module;-
10 _module->fileName = fileName;-
11 _module->finalUrl = fileName;-
12 _context = nullptr;-
13-
14 Compiler::ScanFunctions scan(this, sourceCode, Compiler::ContextType::Global);-
15-
16 scan.enterEnvironment(nullptr, Compiler::ContextType::Function, QString());-
17 scan(ast);-
18 scan.leaveEnvironment();-
19-
20 if (hasError
hasErrorDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 936 times by 2 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
)
12-936
21 return;
executed 12 times by 1 test: return;
Executed by:
  • tst_ecmascripttests
12
22-
23 int index = defineFunction(ast->name.toString(), ast, ast->formals, ast->body);-
24 _module->rootContext = _module->functions.at(index);-
25}
executed 926 times by 2 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qqmlecmascript
926
26-
27void RuntimeCodegen::throwSyntaxError(const AST::SourceLocation &loc, const QString &detail)-
28{-
29 if (hasError
hasErrorDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_ecmascripttests
FALSEevaluated 1167 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
)
42-1167
30 return;
executed 42 times by 1 test: return;
Executed by:
  • tst_ecmascripttests
42
31 hasError = true;-
32 engine->throwSyntaxError(detail, _module->fileName, loc.startLine, loc.startColumn);-
33}
executed 1170 times by 3 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
1170
34-
35void RuntimeCodegen::throwReferenceError(const AST::SourceLocation &loc, const QString &detail)-
36{-
37 if (hasError
hasErrorDescription
TRUEnever evaluated
FALSEevaluated 53 times by 3 tests
Evaluated by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
)
0-53
38 return;
never executed: return;
0
39 hasError = true;-
40 engine->throwReferenceError(detail, _module->fileName, loc.startLine, loc.startColumn);-
41}
executed 54 times by 3 tests: end of block
Executed by:
  • tst_ecmascripttests
  • tst_qjsengine
  • tst_qqmlecmascript
54
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0