aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-09-09 13:51:31 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-12 23:00:34 +0200
commit1e17eb6cbd3c38e95c994ff00e529aecb6d530eb (patch)
treeab0ba8c75db5992f803e738e538e71106fb761fa /src/qml/compiler/qv4codegen.cpp
parent346662cb011b7962a8cabf6d55742cd050a6ba6c (diff)
[new compiler] Improve error reporting
Re-enable COMPILE_EXCEPTION calls that were commented out due to missing location information (that this patch also adds). Change-Id: I0d584f474cc7e879350c8aae2869a9603ba415aa Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index f4822fe26e..52875ce41a 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -1770,6 +1770,10 @@ V4IR::Function *Codegen::defineFunction(const QString &name, AST::Node *ast,
function->isStrict = _env->isStrict;
function->isNamedExpression = _env->isNamedFunctionExpression;
+ AST::SourceLocation loc = ast->firstSourceLocation();
+ function->line = loc.startLine;
+ function->column = loc.startColumn;
+
if (function->usesArgumentsObject)
_env->enter("arguments", Environment::VariableDeclaration);