diff --git a/qmljs_objects.cpp b/qmljs_objects.cpp index 37e3537e6a..61533b8592 100644 --- a/qmljs_objects.cpp +++ b/qmljs_objects.cpp @@ -126,11 +126,11 @@ void ScriptFunction::call(VM::Context *ctx) function->code(ctx); } -Property *ArgumentsObject::getOwnProperty(String *name) +Property *ArgumentsObject::getProperty(String *name) { - if (Property *prop = Object::getOwnProperty(name)) + if (Property *prop = Object::getProperty(name)) return prop; else if (context && context->scope) - return context->scope->getOwnProperty(name); + return context->scope->getProperty(name); return 0; } diff --git a/qmljs_objects.h b/qmljs_objects.h index 17c85b0701..b0109ec25d 100644 --- a/qmljs_objects.h +++ b/qmljs_objects.h @@ -258,7 +258,7 @@ struct ErrorObject: Object { struct ArgumentsObject: Object { Context *context; ArgumentsObject(Context *context): context(context) {} - virtual Property *getOwnProperty(String *name); + virtual Property *getProperty(String *name); }; struct Context { @@ -270,12 +270,12 @@ struct Context { size_t argumentCount; Value result; - Context() - : parent(0) - , scope(0) - , arguments(0) - , argumentCount(0) + void init() { + parent = 0; + scope = 0; + arguments = 0; + argumentCount = 0; activation.type = NULL_TYPE; thisObject.type = NULL_TYPE; result.type = UNDEFINED_TYPE; diff --git a/qmljs_runtime.cpp b/qmljs_runtime.cpp index 4870c0bf65..a85ef9da69 100644 --- a/qmljs_runtime.cpp +++ b/qmljs_runtime.cpp @@ -330,6 +330,7 @@ bool __qmljs_equal(Context *ctx, const Value *x, const Value *y) Context *__qmljs_new_context(Context *current, Value *thisObject, size_t argc) { Context *ctx = new Context; + ctx->init(); ctx->parent = current; ctx->scope = current->activation.objectValue; __qmljs_init_object(ctx, &ctx->activation, new ArgumentsObject(ctx));