diff options
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index ce81282aa3..daa3d5b0de 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -112,7 +112,6 @@ FunctionObject::FunctionObject(InternalClass *ic) { name = ic->engine->id_undefined; - type = Type_FunctionObject; needsActivation = false; strictMode = false; } @@ -130,7 +129,6 @@ void FunctionObject::init(const StringRef n, bool createProto) Scope s(internalClass->engine); ScopedValue protectThis(s, this); - type = Type_FunctionObject; needsActivation = true; strictMode = false; @@ -342,19 +340,19 @@ ReturnedValue FunctionPrototype::method_apply(CallContext *ctx) if (!arg->isNullOrUndefined()) return ctx->throwTypeError(); } else { - len = ArrayPrototype::getLength(ctx, arr); + len = arr->getLength(); } ScopedCallData callData(scope, len); if (len) { - if (!(arr->flags & SimpleArray) || arr->protoHasArray() || arr->hasAccessorProperty) { + if (arr->arrayType() != ArrayData::Simple || arr->protoHasArray() || arr->hasAccessorProperty) { for (quint32 i = 0; i < len; ++i) callData->args[i] = arr->getIndexed(i); } else { - int alen = qMin(len, arr->arrayDataLen); + int alen = qMin(len, arr->arrayData->length()); for (int i = 0; i < alen; ++i) - callData->args[i] = arr->arrayData[i].value; + callData->args[i] = arr->arrayData->data[i].value; for (quint32 i = alen; i < len; ++i) callData->args[i] = Primitive::undefinedValue(); } @@ -426,8 +424,8 @@ ScriptFunction::ScriptFunction(ExecutionContext *scope, Function *function) if (scope->strictMode) { Property pd = Property::fromAccessor(v4->thrower, v4->thrower); - *insertMember(scope->engine->id_caller, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable) = pd; - *insertMember(scope->engine->id_arguments, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable) = pd; + insertMember(scope->engine->id_caller, pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable); + insertMember(scope->engine->id_arguments, pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable); } } @@ -508,8 +506,8 @@ SimpleScriptFunction::SimpleScriptFunction(ExecutionContext *scope, Function *fu if (scope->strictMode) { Property pd = Property::fromAccessor(v4->thrower, v4->thrower); - *insertMember(scope->engine->id_caller, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable) = pd; - *insertMember(scope->engine->id_arguments, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable) = pd; + insertMember(scope->engine->id_caller, pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable); + insertMember(scope->engine->id_arguments, pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable); } } @@ -667,8 +665,8 @@ BoundFunction::BoundFunction(ExecutionContext *scope, FunctionObjectRef target, ExecutionEngine *v4 = scope->engine; Property pd = Property::fromAccessor(v4->thrower, v4->thrower); - *insertMember(scope->engine->id_arguments, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable) = pd; - *insertMember(scope->engine->id_caller, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable) = pd; + insertMember(scope->engine->id_arguments, pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable); + insertMember(scope->engine->id_caller, pd, Attr_Accessor|Attr_NotConfigurable|Attr_NotEnumerable); } void BoundFunction::destroy(Managed *that) |