aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4script.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
-rw-r--r--src/qml/jsruntime/qv4script.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index e3c9505ab7..1834e28be6 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -153,6 +153,7 @@ void Script::parse()
parsed = true;
ExecutionEngine *v4 = scope->engine;
+ Scope valueScope(v4);
MemoryManager::GCBlocker gcBlocker(v4->memoryManager);
@@ -199,9 +200,11 @@ void Script::parse()
compilationUnitHolder = Value::fromObject(new (v4->memoryManager) CompilationUnitHolder(v4, compilationUnit));
}
- if (!vmFunction)
+ if (!vmFunction) {
// ### FIX file/line number
- v4->current->throwError(QV4::Value::fromObject(v4->newSyntaxErrorObject("Syntax error")));
+ Scoped<Object> error(valueScope, v4->newSyntaxErrorObject("Syntax error"));
+ v4->current->throwError(error);
+ }
}
ReturnedValue Script::run()