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;
}
struct ArgumentsObject: Object {
Context *context;
ArgumentsObject(Context *context): context(context) {}
- virtual Property *getOwnProperty(String *name);
+ virtual Property *getProperty(String *name);
};
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;
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));