aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4regexpobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4regexpobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index fee66d9d09..d9e8b2419b 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -147,7 +147,7 @@ void RegExpObject::init(ExecutionEngine *engine)
ScopedString lastIndex(scope, engine->newIdentifier(QStringLiteral("lastIndex")));
Property *lastIndexProperty = insertMember(lastIndex, Attr_NotEnumerable|Attr_NotConfigurable);
- lastIndexProperty->value = Value::fromInt32(0);
+ lastIndexProperty->value = Primitive::fromInt32(0);
if (!this->value)
return;
@@ -160,9 +160,9 @@ void RegExpObject::init(ExecutionEngine *engine)
}
defineReadonlyProperty(QStringLiteral("source"), Value::fromString(engine->newString(p)));
- defineReadonlyProperty(QStringLiteral("global"), Value::fromBoolean(global));
- defineReadonlyProperty(QStringLiteral("ignoreCase"), Value::fromBoolean(this->value->ignoreCase()));
- defineReadonlyProperty(QStringLiteral("multiline"), Value::fromBoolean(this->value->multiLine()));
+ defineReadonlyProperty(QStringLiteral("global"), Primitive::fromBoolean(global));
+ defineReadonlyProperty(QStringLiteral("ignoreCase"), Primitive::fromBoolean(this->value->ignoreCase()));
+ defineReadonlyProperty(QStringLiteral("multiline"), Primitive::fromBoolean(this->value->multiLine()));
}
@@ -240,8 +240,8 @@ ReturnedValue RegExpCtor::construct(Managed *m, CallData *callData)
ExecutionContext *ctx = m->engine()->current;
Scope scope(ctx);
- ScopedValue r(scope, callData->argc > 0 ? callData->args[0] : Value::undefinedValue());
- ScopedValue f(scope, callData->argc > 1 ? callData->args[1] : Value::undefinedValue());
+ ScopedValue r(scope, callData->argc > 0 ? callData->args[0] : Primitive::undefinedValue());
+ ScopedValue f(scope, callData->argc > 1 ? callData->args[1] : Primitive::undefinedValue());
if (RegExpObject *re = r->as<RegExpObject>()) {
if (!f->isUndefined())
ctx->throwTypeError();
@@ -292,7 +292,7 @@ ReturnedValue RegExpCtor::call(Managed *that, CallData *callData)
void RegExpPrototype::init(ExecutionEngine *engine, const Value &ctor)
{
ctor.objectValue()->defineReadonlyProperty(engine->id_prototype, Value::fromObject(this));
- ctor.objectValue()->defineReadonlyProperty(engine->id_length, Value::fromInt32(2));
+ ctor.objectValue()->defineReadonlyProperty(engine->id_length, Primitive::fromInt32(2));
defineDefaultProperty(QStringLiteral("constructor"), ctor);
defineDefaultProperty(QStringLiteral("exec"), method_exec, 1);
defineDefaultProperty(QStringLiteral("test"), method_test, 1);
@@ -313,14 +313,14 @@ ReturnedValue RegExpPrototype::method_exec(SimpleCallContext *ctx)
int offset = r->global ? r->lastIndexProperty(ctx)->value.toInt32() : 0;
if (offset < 0 || offset > s.length()) {
- r->lastIndexProperty(ctx)->value = Value::fromInt32(0);
+ r->lastIndexProperty(ctx)->value = Primitive::fromInt32(0);
return Encode::null();
}
uint* matchOffsets = (uint*)alloca(r->value->captureCount() * 2 * sizeof(uint));
int result = r->value->match(s, offset, matchOffsets);
if (result == -1) {
- r->lastIndexProperty(ctx)->value = Value::fromInt32(0);
+ r->lastIndexProperty(ctx)->value = Primitive::fromInt32(0);
return Encode::null();
}
@@ -331,16 +331,16 @@ ReturnedValue RegExpPrototype::method_exec(SimpleCallContext *ctx)
for (int i = 0; i < len; ++i) {
int start = matchOffsets[i * 2];
int end = matchOffsets[i * 2 + 1];
- array->arrayData[i].value = (start != -1 && end != -1) ? Value::fromString(ctx, s.mid(start, end - start)) : Value::undefinedValue();
+ array->arrayData[i].value = (start != -1 && end != -1) ? Value::fromString(ctx, s.mid(start, end - start)) : Primitive::undefinedValue();
array->arrayDataLen = i + 1;
}
array->setArrayLengthUnchecked(len);
- array->memberData[Index_ArrayIndex].value = Value::fromInt32(result);
+ array->memberData[Index_ArrayIndex].value = Primitive::fromInt32(result);
array->memberData[Index_ArrayInput].value = arg;
if (r->global)
- r->lastIndexProperty(ctx)->value = Value::fromInt32(matchOffsets[1]);
+ r->lastIndexProperty(ctx)->value = Primitive::fromInt32(matchOffsets[1]);
return array.asReturnedValue();
}