aboutsummaryrefslogtreecommitdiffstats
path: root/src/v4/qmljs_environment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/v4/qmljs_environment.cpp')
-rw-r--r--src/v4/qmljs_environment.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/v4/qmljs_environment.cpp b/src/v4/qmljs_environment.cpp
index f4b2f51fbe..1f55717dc6 100644
--- a/src/v4/qmljs_environment.cpp
+++ b/src/v4/qmljs_environment.cpp
@@ -178,10 +178,10 @@ ExecutionContext *ExecutionContext::createWithScope(Object *with)
return withCtx;
}
-ExecutionContext *ExecutionContext::createCatchScope(String *exceptionVarName)
+ExecutionContext *ExecutionContext::createCatchScope(String *exceptionVarName, const Value &exceptionValue)
{
ExecutionContext *catchCtx = engine->newContext();
- catchCtx->initForCatch(this, exceptionVarName);
+ catchCtx->initForCatch(this, exceptionVarName, exceptionValue);
engine->current = catchCtx;
return catchCtx;
}
@@ -235,8 +235,6 @@ void ExecutionContext::init(ExecutionEngine *eng)
strictMode = false;
activation = 0;
withObject = 0;
-
- eng->exception = Value::undefinedValue();
}
void ExecutionContext::init(ExecutionContext *p, Object *with)
@@ -259,7 +257,7 @@ void ExecutionContext::init(ExecutionContext *p, Object *with)
withObject = with;
}
-void ExecutionContext::initForCatch(ExecutionContext *p, String *exceptionVarName)
+void ExecutionContext::initForCatch(ExecutionContext *p, String *exceptionVarName, const Value &exceptionValue)
{
engine = p->engine;
parent = p;
@@ -272,7 +270,7 @@ void ExecutionContext::initForCatch(ExecutionContext *p, String *exceptionVarNam
argumentCount = 0;
locals = 0;
this->exceptionVarName = exceptionVarName;
- exceptionValue = engine->exception;
+ this->exceptionValue = exceptionValue;
strictMode = p->strictMode;
activation = 0;
withObject = 0;