if (n <= argumentsAccessors.size())
return;
+ Scope scope(this);
+ ScopedFunctionObject get(scope);
+ ScopedFunctionObject set(scope);
+
uint oldSize = argumentsAccessors.size();
argumentsAccessors.resize(n);
for (int i = oldSize; i < n; ++i) {
- FunctionObject *get = new (memoryManager) ArgumentsGetterFunction(rootContext, i);
- FunctionObject *set = new (memoryManager) ArgumentsSetterFunction(rootContext, i);
- Property pd = Property::fromAccessor(get, set);
+ get = new (memoryManager) ArgumentsGetterFunction(rootContext, i);
+ set = new (memoryManager) ArgumentsSetterFunction(rootContext, i);
+ Property pd = Property::fromAccessor(get.getPointer(), set.getPointer());
argumentsAccessors[i] = pd;
}
}
{
type = Type_JSONObject;
+ Scope scope(engine);
+ ScopedObject protectThis(scope, this);
+
defineDefaultProperty(QStringLiteral("parse"), method_parse, 2);
defineDefaultProperty(QStringLiteral("stringify"), method_stringify, 3);
}
{
type = Type_MathObject;
+ Scope scope(engine);
+ ScopedObject protectThis(scope, this);
+
defineReadonlyProperty(QStringLiteral("E"), Primitive::fromDouble(::exp(1.0)));
defineReadonlyProperty(QStringLiteral("LN2"), Primitive::fromDouble(::log(2.0)));
defineReadonlyProperty(QStringLiteral("LN10"), Primitive::fromDouble(::log(10.0)));
{
vtbl = &static_vtbl;
+ Scope scope(engine);
+ ScopedObject protectThis(scope, this);
+
m_destroy = engine->newIdentifier(QStringLiteral("destroy"));
}
pattern = ecmaPattern;
}
+ Scope scope(engine);
+ ScopedObject protectThis(scope, this);
+
value = RegExp::create(engine, pattern, re.caseSensitivity() == Qt::CaseInsensitive, false);
init(engine);
{
type = Type_QmlSequence;
vtbl = &static_vtbl;
+ QV4::Scope scope(engine);
+ QV4::ScopedObject protectThis(scope, this);
init();
}
{
type = Type_QmlSequence;
vtbl = &static_vtbl;
+ QV4::Scope scope(engine);
+ QV4::ScopedObject protectThis(scope, this);
loadReference();
init();
}
return result->toNumber() <= 0;
}
- return p1.value.toString(m_context)->toQString() < p2.value.toString(m_context)->toQString();
+ ScopedString p1s(scope, p1.value.toString(m_context));
+ ScopedString p2s(scope, p2.value.toString(m_context));
+ return p1s->toQString() < p2s->toQString();
}
{
vtbl = &static_vtbl;
type = Type_StringObject;
+
+ Scope scope(engine());
+ ScopedObject protectThis(scope, this);
+
value = ic->engine->newString("")->asReturnedValue();
tmpProperty.value = Primitive::undefinedValue();
{
vtbl = &static_vtbl;
type = Type_StringObject;
+
+ Scope scope(engine);
+ ScopedObject protectThis(scope, this);
+
value = *val;
tmpProperty.value = Primitive::undefinedValue();
{
vtbl = &static_vtbl;
if (isScarce())
- internalClass->engine->scarceResources.insert(this);
+ engine->scarceResources.insert(this);
}
QVariant VariantObject::toVariant(const QV4::ValueRef v)
: Object(engine)
{
vtbl = &static_vtbl;
+
+ Scope scope(engine);
+ ScopedObject protectThis(scope, this);
+
defineAccessorProperty(QStringLiteral("nodeName"), method_get_nodeName, 0);
defineAccessorProperty(QStringLiteral("nodeValue"), method_get_nodeValue, 0);
defineAccessorProperty(QStringLiteral("nodeType"), method_get_nodeType, 0);
QQuickJSContext2DPrototype(QV4::ExecutionEngine *engine)
: QV4::Object(engine)
{
+ QV4::Scope scope(engine);
+ QV4::ScopedObject protectThis(scope, this);
+
defineDefaultProperty(QStringLiteral("quadraticCurveTo"), method_quadraticCurveTo, 0);
defineDefaultProperty(QStringLiteral("restore"), method_restore, 0);
defineDefaultProperty(QStringLiteral("moveTo"), method_moveTo, 0);
{
vtbl = &static_vtbl;
+ QV4::Scope scope(engine);
+ QV4::ScopedObject protectThis(scope, this);
+
defineAccessorProperty(QStringLiteral("width"), method_get_width, 0);
defineAccessorProperty(QStringLiteral("height"), method_get_height, 0);
defineAccessorProperty(QStringLiteral("data"), method_get_data, 0);