{
if (!members)
members.reset(new PropertyTable());
- lastIndexProperty = members->insert(engine->identifier("lastIndex"));
+ lastIndexProperty = members->insert(engine->identifier(QStringLiteral("lastIndex")));
lastIndexProperty->type = PropertyDescriptor::Data;
lastIndexProperty->writable = PropertyDescriptor::Enabled;
lastIndexProperty->enumberable = PropertyDescriptor::Disabled;
lastIndexProperty->configurable = PropertyDescriptor::Disabled;
lastIndexProperty->value = Value::fromInt32(0);
-}
-
-Value RegExpObject::__get__(ExecutionContext *ctx, String *name, bool *hasProperty)
-{
- QString n = name->toQString();
- Value v = Value::undefinedValue();
- if (n == QLatin1String("source"))
- v = Value::fromString(ctx, value->pattern());
- else if (n == QLatin1String("global"))
- v = Value::fromBoolean(global);
- else if (n == QLatin1String("ignoreCase"))
- v = Value::fromBoolean(value->ignoreCase());
- else if (n == QLatin1String("multiline"))
- v = Value::fromBoolean(value->multiLine());
- if (v.type() != Value::Undefined_Type) {
- if (hasProperty)
- *hasProperty = true;
- return v;
- }
- return Object::__get__(ctx, name, hasProperty);
+ if (!this->value.get())
+ return;
+ defineDefaultProperty(engine->identifier(QStringLiteral("source")), Value::fromString(engine->newString(this->value->pattern())));
+ defineDefaultProperty(engine->identifier(QStringLiteral("global")), Value::fromBoolean(global));
+ defineDefaultProperty(engine->identifier(QStringLiteral("ignoreCase")), Value::fromBoolean(this->value->ignoreCase()));
+ defineDefaultProperty(engine->identifier(QStringLiteral("multiline")), Value::fromBoolean(this->value->multiLine()));
}
ErrorObject::ErrorObject(ExecutionEngine* engine, const Value &message)
struct RegExpObject: Object {
RefPtr<RegExp> value;
PropertyDescriptor *lastIndexProperty;
- bool global;
+ const bool global;
RegExpObject(ExecutionEngine *engine, PassRefPtr<RegExp> value, bool global);
virtual QString className() { return QStringLiteral("RegExp"); }
virtual RegExpObject *asRegExpObject() { return this; }
- virtual Value __get__(ExecutionContext *ctx, String *name, bool *hasProperty);
};
struct ErrorObject: Object {
Q_DISABLE_COPY(RegExp);
RegExp(ExecutionEngine* engine, const QString& pattern, bool ignoreCase, bool multiline);
- QString m_pattern;
+ const QString m_pattern;
OwnPtr<JSC::Yarr::BytecodePattern> m_byteCode;
int m_subPatternCount;
- bool m_ignoreCase;
- bool m_multiLine;
+ const bool m_ignoreCase;
+ const bool m_multiLine;
};
} // end of namespace VM
S15.10.7_A2_T1 failing
15.10.7.1-2 failing
S15.10.7.1_A10 failing
-S15.10.7.1_A8 failing
S15.10.7.1_A9 failing
15.10.7.2-2 failing
S15.10.7.2_A10 failing
-S15.10.7.2_A8 failing
S15.10.7.2_A9 failing
15.10.7.3-2 failing
S15.10.7.3_A10 failing
-S15.10.7.3_A8 failing
S15.10.7.3_A9 failing
15.10.7.4-2 failing
S15.10.7.4_A10 failing
-S15.10.7.4_A8 failing
S15.10.7.4_A9 failing
S15.11.4.2_A1 failing
S15.11.4.2_A2 failing
15.4.4.17-7-c-i-6 failing
# Regressions introduced with https://codereview.qt-project.org/#change,45044
-15.4.4.21-8-b-iii-1-6 failing
+15.4.4.21-8-b-iii-1-6 failing
\ No newline at end of file