diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-11-21 09:17:01 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-12-11 08:40:41 +0100 |
commit | ddfe9defa803fdbfab10ab58b77df242cdb4cedd (patch) | |
tree | b13af2424e8ea466a9de9fece8f2fbb6415ce8b6 /src/qml/jsruntime/qv4object.cpp | |
parent | 254cf16ed4c6007a59a7cd5d64bb621430b3c01d (diff) |
Encapsulate accesses to the root context
Change-Id: I668cef1363a5c1a5c5b9a7e138f3bd0338712eea
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 1160e2c1c1..a9ce9b42f2 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -134,7 +134,7 @@ void Object::defineDefaultProperty(const QString &name, ReturnedValue (*code)(Ca ExecutionEngine *e = engine(); Scope scope(e); ScopedString s(scope, e->newIdentifier(name)); - Scoped<FunctionObject> function(scope, BuiltinFunction::create(e->rootContext, s.getPointer(), code)); + Scoped<FunctionObject> function(scope, BuiltinFunction::create(e->rootContext(), s.getPointer(), code)); function->defineReadonlyProperty(e->id_length, Primitive::fromInt32(argumentCount)); defineDefaultProperty(s.getPointer(), function); } @@ -143,7 +143,7 @@ void Object::defineDefaultProperty(String *name, ReturnedValue (*code)(CallConte { ExecutionEngine *e = engine(); Scope scope(e); - Scoped<FunctionObject> function(scope, BuiltinFunction::create(e->rootContext, name, code)); + Scoped<FunctionObject> function(scope, BuiltinFunction::create(e->rootContext(), name, code)); function->defineReadonlyProperty(e->id_length, Primitive::fromInt32(argumentCount)); defineDefaultProperty(name, function); } @@ -161,8 +161,8 @@ void Object::defineAccessorProperty(String *name, ReturnedValue (*getter)(CallCo ExecutionEngine *v4 = engine(); QV4::Scope scope(v4); ScopedProperty p(scope); - p->setGetter(getter ? ScopedFunctionObject(scope, BuiltinFunction::create(v4->rootContext, name, getter)).getPointer() : 0); - p->setSetter(setter ? ScopedFunctionObject(scope, BuiltinFunction::create(v4->rootContext, name, setter)).getPointer() : 0); + p->setGetter(getter ? ScopedFunctionObject(scope, BuiltinFunction::create(v4->rootContext(), name, getter)).getPointer() : 0); + p->setSetter(setter ? ScopedFunctionObject(scope, BuiltinFunction::create(v4->rootContext(), name, setter)).getPointer() : 0); insertMember(name, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); } |