diff options
| author | Lars Knoll <lars.knoll@digia.com> | 2013-09-25 12:24:36 +0200 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-28 13:33:24 +0200 |
| commit | cf2a253f2f60c9f0c61682527d80143e72b355d4 (patch) | |
| tree | d60e8be50437e6f15513e25155817b902a2062c7 /src/qml/jsruntime/qv4object.cpp | |
| parent | 7872b380063d0497ba62fecfdc92148f1ea947af (diff) | |
Move Value::fromBool, ... to a new Primitive class
This will simplify finding the remaining direct usages of
QV4::Value that need fixing.
Change-Id: I223099727436d5748027c84c53d9dfc4028e38ed
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4object.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4object.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 78b963e12d..e0c8974440 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -135,7 +135,7 @@ ReturnedValue Object::getValue(const ValueRef thisObject, const Property *p, Pro return p->value.asReturnedValue(); FunctionObject *getter = p->getter(); if (!getter) - return Value::undefinedValue().asReturnedValue(); + return Primitive::undefinedValue().asReturnedValue(); Scope scope(getter->engine()); ScopedCallData callData(scope, 0); @@ -235,7 +235,7 @@ void Object::defineDefaultProperty(const QString &name, ReturnedValue (*code)(Si Scope scope(e); ScopedString s(scope, e->newIdentifier(name)); Scoped<FunctionObject> function(scope, e->newBuiltinFunction(e->rootContext, s, code)); - function->defineReadonlyProperty(e->id_length, Value::fromInt32(argumentCount)); + function->defineReadonlyProperty(e->id_length, Primitive::fromInt32(argumentCount)); defineDefaultProperty(s, function.asValue()); } @@ -244,7 +244,7 @@ void Object::defineDefaultProperty(const StringRef name, ReturnedValue (*code)(S ExecutionEngine *e = engine(); Scope scope(e); Scoped<FunctionObject> function(scope, e->newBuiltinFunction(e->rootContext, name, code)); - function->defineReadonlyProperty(e->id_length, Value::fromInt32(argumentCount)); + function->defineReadonlyProperty(e->id_length, Primitive::fromInt32(argumentCount)); defineDefaultProperty(name, function.asValue()); } @@ -538,7 +538,7 @@ ReturnedValue Object::getLookup(Managed *m, Lookup *l) return o->getValue(p, attrs); } } - return Value::undefinedValue().asReturnedValue(); + return Primitive::undefinedValue().asReturnedValue(); } void Object::setLookup(Managed *m, Lookup *l, const ValueRef value) @@ -710,7 +710,7 @@ ReturnedValue Object::internalGetIndexed(uint index, bool *hasProperty) if (hasProperty) *hasProperty = false; - return Value::undefinedValue().asReturnedValue(); + return Primitive::undefinedValue().asReturnedValue(); } @@ -902,7 +902,7 @@ bool Object::internalDeleteIndexedProperty(uint index) return true; if (!arrayAttributes || arrayAttributes[pidx].isConfigurable()) { - arrayData[pidx].value = Value::undefinedValue(); + arrayData[pidx].value = Primitive::undefinedValue(); if (!arrayAttributes) ensureArrayAttributes(); arrayAttributes[pidx].clear(); @@ -1061,7 +1061,7 @@ bool Object::__defineOwnProperty__(ExecutionContext *ctx, Property *current, con // 9c cattrs.setType(PropertyAttributes::Data); cattrs.setWritable(false); - current->value = Value::undefinedValue(); + current->value = Primitive::undefinedValue(); } } else if (cattrs.isData() && attrs.isData()) { // clause 10 if (!cattrs.isConfigurable() && !cattrs.isWritable()) { @@ -1293,12 +1293,12 @@ void Object::initSparse() arrayAlloc += off; int o = off; for (int i = 0; i < o - 1; ++i) { - arrayData[i].value = Value::fromInt32(i + 1); + arrayData[i].value = Primitive::fromInt32(i + 1); } - arrayData[o - 1].value = Value::fromInt32(arrayDataLen + off); + arrayData[o - 1].value = Primitive::fromInt32(arrayDataLen + off); } for (int i = arrayDataLen + off; i < arrayAlloc; ++i) { - arrayData[i].value = Value::fromInt32(i + 1); + arrayData[i].value = Primitive::fromInt32(i + 1); } } } @@ -1327,7 +1327,7 @@ void Object::arrayReserve(uint n) if (sparseArray) { for (uint i = arrayFreeList; i < arrayAlloc; ++i) { arrayData[i].value = Value::emptyValue(); - arrayData[i].value = Value::fromInt32(i + 1); + arrayData[i].value = Primitive::fromInt32(i + 1); } } else { arrayOffset = 0; @@ -1460,7 +1460,7 @@ ArrayObject::ArrayObject(ExecutionEngine *engine, const QStringList &list) void ArrayObject::init(ExecutionEngine *engine) { type = Type_ArrayObject; - memberData[LengthPropertyIndex].value = Value::fromInt32(0); + memberData[LengthPropertyIndex].value = Primitive::fromInt32(0); } QStringList ArrayObject::toQStringList() const |
