diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-13 21:54:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:14:10 +0200 |
commit | e4e90923c93adfafb23c81be7359e8df2a500b4f (patch) | |
tree | 36be927b72606c4f37326089ff3c6261f484c92b /src/qml/jsruntime/qv4script.cpp | |
parent | 9dcc12d52343960400192c817f54a16f7e1f8247 (diff) |
Convert some methods to use Returned<>
Change-Id: I631606cb5ab3b35b72104e70092a5200dd235fbc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4script.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4script.cpp | 7 |
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() |