void __qmljs_set_activation_property(ExecutionContext *ctx, String *name, Value value)
{
PropertyDescriptor tmp;
- if (PropertyDescriptor *prop = ctx->lookupPropertyDescriptor(name, &tmp))
+ PropertyDescriptor *prop = ctx->lookupPropertyDescriptor(name, &tmp);
+ if (prop) {
prop->value = value;
- else
- ctx->engine->globalObject.objectValue()->__put__(ctx, name, value);
+ return;
+ }
+ if (ctx->strictMode)
+ ctx->throwReferenceError(Value::fromString(name));
+ ctx->engine->globalObject.objectValue()->__put__(ctx, name, value);
}
Value __qmljs_get_property(ExecutionContext *ctx, Value object, String *name)
Value __qmljs_get_activation_property(ExecutionContext *ctx, String *name)
{
PropertyDescriptor tmp;
- if (PropertyDescriptor *prop = ctx->lookupPropertyDescriptor(name, &tmp))
- return prop->value;
- ctx->throwReferenceError(Value::fromString(name));
- return Value::undefinedValue();
+ PropertyDescriptor *prop = ctx->lookupPropertyDescriptor(name, &tmp);
+ if (!prop)
+ ctx->throwReferenceError(Value::fromString(name));
+ return prop->value;
}
Value __qmljs_get_thisObject(ExecutionContext *ctx)
{
PropertyDescriptor tmp;
PropertyDescriptor *func = context->lookupPropertyDescriptor(name, &tmp);
- if (! func) {
+ if (! func)
context->throwReferenceError(Value::fromString(name));
- return Value::undefinedValue();
- }
return __qmljs_construct_value(context, func->value, args, argc);
}
// clean up call contexts
while (context != handler.context) {
+ ExecutionContext *parent = context->parent;
context->leaveCallContext();
- context = context->parent;
+ context = parent;
}
while (context->withObject != handler.with) {