Change-Id: I989c2a546b7e4d9a4fd2f7ff8b682c747d38332f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
void Context::leaveConstructorContext(FunctionObject *f)
{
+ wireUpPrototype(f);
+ leaveCallContext();
+}
+
+void Context::wireUpPrototype(FunctionObject *f)
+{
assert(thisObject.isObject());
result = thisObject;
if (! thisObject.isObject())
thisObject.objectValue()->prototype = engine->objectPrototype;
- leaveCallContext();
}
extern "C" {
void initConstructorContext(Context *parent, Value that, FunctionObject *f, Value *args, unsigned argc);
void leaveConstructorContext(FunctionObject *f);
+ void wireUpPrototype(FunctionObject *f);
void throwError(Value value);
void throwError(const QString &message);
{
Value that = ctx->thisObject;
construct(ctx);
- ctx->result = ctx->thisObject;
+ ctx->wireUpPrototype(this);
+
ctx->thisObject = that;
}