return Value::fromObject(ctx->engine->newBooleanObject(Value::fromBoolean(n)));
}
-Value BooleanCtor::call(ExecutionContext *ctx)
+Value BooleanCtor::call(ExecutionContext *parentCtx, Value thisObject, Value *argv, int argc)
{
- bool value = ctx->argumentCount ? ctx->argument(0).toBoolean(ctx) : 0;
+ bool value = argc ? argv[0].toBoolean(parentCtx) : 0;
return Value::fromBoolean(value);
}
BooleanCtor(ExecutionContext *scope);
virtual Value construct(ExecutionContext *ctx);
- virtual Value call(ExecutionContext *ctx);
+ virtual Value call(ExecutionContext *parentCtx, Value thisObject, Value *argv, int argc);
};
struct BooleanPrototype: BooleanObject
return Value::fromObject(ctx->engine->newNumberObject(Value::fromDouble(d)));
}
-Value NumberCtor::call(ExecutionContext *ctx)
+Value NumberCtor::call(ExecutionContext *parentCtx, Value thisObject, Value *argv, int argc)
{
- double d = ctx->argumentCount ? ctx->argument(0).toNumber(ctx) : 0;
+ double d = argc ? argv[0].toNumber(parentCtx) : 0.;
return Value::fromDouble(d);
}
NumberCtor(ExecutionContext *scope);
virtual Value construct(ExecutionContext *ctx);
- virtual Value call(ExecutionContext *ctx);
+ virtual Value call(ExecutionContext *parentCtx, Value thisObject, Value *argv, int argc);
};
struct NumberPrototype: NumberObject
return Value::fromObject(ctx->engine->newStringObject(ctx, value));
}
-Value StringCtor::call(ExecutionContext *ctx)
+Value StringCtor::call(ExecutionContext *parentCtx, Value thisObject, Value *argv, int argc)
{
Value value;
- if (ctx->argumentCount)
- value = Value::fromString(ctx->argument(0).toString(ctx));
+ if (argc)
+ value = Value::fromString(argv[0].toString(parentCtx));
else
- value = Value::fromString(ctx, QString());
+ value = Value::fromString(parentCtx, QString());
return value;
}
StringCtor(ExecutionContext *scope);
virtual Value construct(ExecutionContext *ctx);
- virtual Value call(ExecutionContext *ctx);
+ virtual Value call(ExecutionContext *parentCtx, Value thisObject, Value *argv, int argc);
};
struct StringPrototype: StringObject