Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/jsruntime/qv4runtimecodegen.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | using namespace QV4; | - | ||||||
3 | - | |||||||
4 | void 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
| 12-936 | ||||||
21 | return; executed 12 times by 1 test: return; Executed by:
| 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:
| 926 | ||||||
26 | - | |||||||
27 | void RuntimeCodegen::throwSyntaxError(const AST::SourceLocation &loc, const QString &detail) | - | ||||||
28 | { | - | ||||||
29 | if (hasError
| 42-1167 | ||||||
30 | return; executed 42 times by 1 test: return; Executed by:
| 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:
| 1170 | ||||||
34 | - | |||||||
35 | void RuntimeCodegen::throwReferenceError(const AST::SourceLocation &loc, const QString &detail) | - | ||||||
36 | { | - | ||||||
37 | if (hasError
| 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:
| 54 | ||||||
Switch to Source code | Preprocessed file |