diff options
author | Lars Knoll <[email protected]> | 2013-09-18 16:36:02 +0200 |
---|---|---|
committer | The Qt Project <[email protected]> | 2013-09-22 01:06:20 +0200 |
commit | df5edd28bc4258b89d9d5ffdddf837f339a17aad (patch) | |
tree | 2a5939d5e3c49928aadf43337832d3ef5a58df08 /src/qml/jsruntime/qv4context.cpp | |
parent | 700ba1bcb39e082049c96fafdfaccfe5d83cd77e (diff) |
convert Managed::put() API to be GC safe
Change-Id: I09198ce372fa545372db389fac26828d21ad5731
Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4context.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4context.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index 1da2499ec5..73a059c4e8 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -367,7 +367,7 @@ void ExecutionContext::mark() } } -void ExecutionContext::setProperty(String *name, const Value& value) +void ExecutionContext::setProperty(String *name, const ValueRef value) { Scope scope(this); ScopedString n(scope, name); @@ -375,11 +375,11 @@ void ExecutionContext::setProperty(String *name, const Value& value) if (ctx->type == Type_WithContext) { Object *w = static_cast<WithContext *>(ctx)->withObject; if (w->__hasProperty__(n)) { - w->put(name, value); + w->put(n, value); return; } } else if (ctx->type == Type_CatchContext && static_cast<CatchContext *>(ctx)->exceptionVarName->isEqualTo(name)) { - static_cast<CatchContext *>(ctx)->exceptionValue = value; + static_cast<CatchContext *>(ctx)->exceptionValue = *value; return; } else { Object *activation = 0; @@ -387,12 +387,12 @@ void ExecutionContext::setProperty(String *name, const Value& value) CallContext *c = static_cast<CallContext *>(ctx); for (unsigned int i = 0; i < c->function->varCount; ++i) if (c->function->varList[i]->isEqualTo(name)) { - c->locals[i] = value; + c->locals[i] = *value; return; } for (int i = (int)c->function->formalParameterCount - 1; i >= 0; --i) if (c->function->formalParameterList[i]->isEqualTo(name)) { - c->arguments[i] = value; + c->arguments[i] = *value; return; } activation = c->activation; @@ -401,7 +401,7 @@ void ExecutionContext::setProperty(String *name, const Value& value) } if (activation && (ctx->type == Type_QmlContext || activation->__hasProperty__(n))) { - activation->put(name, value); + activation->put(n, value); return; } } @@ -410,7 +410,7 @@ void ExecutionContext::setProperty(String *name, const Value& value) Scoped<String> n(scope, name); throwReferenceError(n); } - engine->globalObject->put(name, value); + engine->globalObject->put(n, value); } ReturnedValue ExecutionContext::getProperty(String *name) |