diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-09-11 11:07:32 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-09-17 07:47:09 +0000 |
commit | 1dac47c1418b44cf4a56b42bfca2b277795fd213 (patch) | |
tree | 26727943c30628340662a66d7cbe9f52d75c5b58 /src/qml/jsruntime/qv4dataview.cpp | |
parent | d89d5cffe79bd060a1b04a2c47a3d728bffbe195 (diff) |
Cleanups in Value/Primitive
Get rid of Primitive and move the corresponding methods
directly into Value. Mark many methods in Value as
constexpr and turn Value into a POD type again.
Keep Primitive as a pure alias to Value for source
compatibility of other modules that might be using it.
Change-Id: Icb47458947dd3482c8852e95782123ea4346f5ec
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4dataview.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4dataview.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/jsruntime/qv4dataview.cpp b/src/qml/jsruntime/qv4dataview.cpp index d52b9488ac..5ab8cf2dcb 100644 --- a/src/qml/jsruntime/qv4dataview.cpp +++ b/src/qml/jsruntime/qv4dataview.cpp @@ -75,11 +75,11 @@ static uint toIndex(ExecutionEngine *e, const Value &v) ReturnedValue DataViewCtor::virtualCallAsConstructor(const FunctionObject *f, const Value *argv, int argc, const Value *newTarget) { Scope scope(f->engine()); - Scoped<SharedArrayBuffer> buffer(scope, argc ? argv[0] : Primitive::undefinedValue()); + Scoped<SharedArrayBuffer> buffer(scope, argc ? argv[0] : Value::undefinedValue()); if (!newTarget || !buffer) return scope.engine->throwTypeError(); - uint offset = ::toIndex(scope.engine, argc > 1 ? argv[1]: Primitive::undefinedValue()); + uint offset = ::toIndex(scope.engine, argc > 1 ? argv[1]: Value::undefinedValue()); if (scope.hasException()) return Encode::undefined(); if (buffer->isDetachedBuffer()) @@ -111,7 +111,7 @@ void DataViewPrototype::init(ExecutionEngine *engine, Object *ctor) { Scope scope(engine); ScopedObject o(scope); - ctor->defineReadonlyConfigurableProperty(engine->id_length(), Primitive::fromInt32(1)); + ctor->defineReadonlyConfigurableProperty(engine->id_length(), Value::fromInt32(1)); ctor->defineReadonlyProperty(engine->id_prototype(), (o = this)); defineDefaultProperty(engine->id_constructor(), (o = ctor)); defineAccessorProperty(QStringLiteral("buffer"), method_get_buffer, nullptr); @@ -188,7 +188,7 @@ ReturnedValue DataViewPrototype::method_getChar(const FunctionObject *b, const V const DataView *v = thisObject->as<DataView>(); if (!v) return e->throwTypeError(); - uint idx = ::toIndex(e, argc ? argv[0] : Primitive::undefinedValue()); + uint idx = ::toIndex(e, argc ? argv[0] : Value::undefinedValue()); if (e->hasException) return Encode::undefined(); if (v->d()->buffer->isDetachedBuffer()) @@ -209,7 +209,7 @@ ReturnedValue DataViewPrototype::method_get(const FunctionObject *b, const Value const DataView *v = thisObject->as<DataView>(); if (!v) return e->throwTypeError(); - uint idx = ::toIndex(e, argc ? argv[0] : Primitive::undefinedValue()); + uint idx = ::toIndex(e, argc ? argv[0] : Value::undefinedValue()); if (e->hasException) return Encode::undefined(); if (v->d()->buffer->isDetachedBuffer()) @@ -234,7 +234,7 @@ ReturnedValue DataViewPrototype::method_getFloat(const FunctionObject *b, const const DataView *v = thisObject->as<DataView>(); if (!v) return e->throwTypeError(); - uint idx = ::toIndex(e, argc ? argv[0] : Primitive::undefinedValue()); + uint idx = ::toIndex(e, argc ? argv[0] : Value::undefinedValue()); if (e->hasException) return Encode::undefined(); if (v->d()->buffer->isDetachedBuffer()) @@ -275,7 +275,7 @@ ReturnedValue DataViewPrototype::method_setChar(const FunctionObject *b, const V const DataView *v = thisObject->as<DataView>(); if (!v) return e->throwTypeError(); - uint idx = ::toIndex(e, argc ? argv[0] : Primitive::undefinedValue()); + uint idx = ::toIndex(e, argc ? argv[0] : Value::undefinedValue()); if (e->hasException) return Encode::undefined(); @@ -300,7 +300,7 @@ ReturnedValue DataViewPrototype::method_set(const FunctionObject *b, const Value const DataView *v = thisObject->as<DataView>(); if (!v) return e->throwTypeError(); - uint idx = ::toIndex(e, argc ? argv[0] : Primitive::undefinedValue()); + uint idx = ::toIndex(e, argc ? argv[0] : Value::undefinedValue()); if (e->hasException) return Encode::undefined(); @@ -330,7 +330,7 @@ ReturnedValue DataViewPrototype::method_setFloat(const FunctionObject *b, const const DataView *v = thisObject->as<DataView>(); if (!v) return e->throwTypeError(); - uint idx = ::toIndex(e, argc ? argv[0] : Primitive::undefinedValue()); + uint idx = ::toIndex(e, argc ? argv[0] : Value::undefinedValue()); if (e->hasException) return Encode::undefined(); |