if (c->proto)
c->proto->mark();
}
- static Value construct(Managed *that, ExecutionContext *context, Value *, int)
+ static Value construct(Managed *that, Value *, int)
{
QQmlXMLHttpRequestCtor *ctor = that->as<QQmlXMLHttpRequestCtor>();
if (!ctor)
- context->throwTypeError();
+ that->engine()->current->throwTypeError();
- QV8Engine *engine = context->engine->v8Engine;
+ QV8Engine *engine = that->engine()->v8Engine;
QQmlXMLHttpRequest *r = new QQmlXMLHttpRequest(engine, engine->networkAccessManager());
- QQmlXMLHttpRequestWrapper *w = new (context->engine->memoryManager) QQmlXMLHttpRequestWrapper(context->engine, r);
+ QQmlXMLHttpRequestWrapper *w = new (that->engine()->memoryManager) QQmlXMLHttpRequestWrapper(that->engine(), r);
w->prototype = ctor->proto;
return Value::fromObject(w);
}
vtbl = &static_vtbl;
}
-Value ArrayCtor::construct(Managed *, ExecutionContext *ctx, Value *argv, int argc)
+Value ArrayCtor::construct(Managed *m, Value *argv, int argc)
{
- ArrayObject *a = ctx->engine->newArrayObject();
+ ExecutionEngine *v4 = m->engine();
+ ArrayObject *a = v4->newArrayObject();
uint len;
if (argc == 1 && argv[0].isNumber()) {
bool ok;
len = argv[0].asArrayLength(&ok);
if (!ok)
- ctx->throwRangeError(argv[0]);
+ v4->current->throwRangeError(argv[0]);
if (len < 0x1000)
a->arrayReserve(len);
return Value::fromObject(a);
}
-Value ArrayCtor::call(Managed *that, ExecutionContext *ctx, const Value &thisObject, Value *argv, int argc)
+Value ArrayCtor::call(Managed *that, ExecutionContext *, const Value &, Value *argv, int argc)
{
- return construct(that, ctx, argv, argc);
+ return construct(that, argv, argc);
}
ArrayPrototype::ArrayPrototype(ExecutionContext *context)
{
ArrayCtor(ExecutionContext *scope);
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *m, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
protected:
vtbl = &static_vtbl;
}
-Value BooleanCtor::construct(Managed *, ExecutionContext *ctx, Value *args, int argc)
+Value BooleanCtor::construct(Managed *m, Value *args, int argc)
{
bool n = argc ? args[0].toBoolean() : false;
- return Value::fromObject(ctx->engine->newBooleanObject(Value::fromBoolean(n)));
+ return Value::fromObject(m->engine()->newBooleanObject(Value::fromBoolean(n)));
}
Value BooleanCtor::call(Managed *, ExecutionContext *parentCtx, const Value &thisObject, Value *argv, int argc)
{
BooleanCtor(ExecutionContext *scope);
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
protected:
vtbl = &static_vtbl;
}
-Value DateCtor::construct(Managed *, ExecutionContext *ctx, Value *args, int argc)
+Value DateCtor::construct(Managed *m, Value *args, int argc)
{
double t = 0;
t = TimeClip(UTC(t));
}
- Object *d = ctx->engine->newDateObject(Value::fromDouble(t));
+ Object *d = m->engine()->newDateObject(Value::fromDouble(t));
return Value::fromObject(d);
}
{
DateCtor(ExecutionContext *scope);
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
protected:
vtbl = &static_vtbl;
}
-Value ErrorCtor::construct(Managed *, ExecutionContext *ctx, Value *args, int argc)
+Value ErrorCtor::construct(Managed *m, Value *args, int argc)
{
- return Value::fromObject(ctx->engine->newErrorObject(argc ? args[0] : Value::undefinedValue()));
+ return Value::fromObject(m->engine()->newErrorObject(argc ? args[0] : Value::undefinedValue()));
}
Value ErrorCtor::call(Managed *that, ExecutionContext *ctx, const Value &, Value *args, int argc)
{
- return that->construct(ctx, args, argc);
+ return that->construct(args, argc);
}
EvalErrorCtor::EvalErrorCtor(ExecutionContext *scope)
vtbl = &static_vtbl;
}
-Value EvalErrorCtor::construct(Managed *, ExecutionContext *ctx, Value *args, int argc)
+Value EvalErrorCtor::construct(Managed *m, Value *args, int argc)
{
- return Value::fromObject(new (ctx->engine->memoryManager) EvalErrorObject(ctx->engine, argc ? args[0] : Value::undefinedValue()));
+ return Value::fromObject(new (m->engine()->memoryManager) EvalErrorObject(m->engine(), argc ? args[0] : Value::undefinedValue()));
}
RangeErrorCtor::RangeErrorCtor(ExecutionContext *scope)
vtbl = &static_vtbl;
}
-Value RangeErrorCtor::construct(Managed *, ExecutionContext *ctx, Value *args, int argc)
+Value RangeErrorCtor::construct(Managed *m, Value *args, int argc)
{
- return Value::fromObject(new (ctx->engine->memoryManager) RangeErrorObject(ctx->engine, argc ? args[0] : Value::undefinedValue()));
+ return Value::fromObject(new (m->engine()->memoryManager) RangeErrorObject(m->engine(), argc ? args[0] : Value::undefinedValue()));
}
ReferenceErrorCtor::ReferenceErrorCtor(ExecutionContext *scope)
vtbl = &static_vtbl;
}
-Value ReferenceErrorCtor::construct(Managed *, ExecutionContext *ctx, Value *args, int argc)
+Value ReferenceErrorCtor::construct(Managed *m, Value *args, int argc)
{
- return Value::fromObject(new (ctx->engine->memoryManager) ReferenceErrorObject(ctx->engine, argc ? args[0] : Value::undefinedValue()));
+ return Value::fromObject(new (m->engine()->memoryManager) ReferenceErrorObject(m->engine(), argc ? args[0] : Value::undefinedValue()));
}
SyntaxErrorCtor::SyntaxErrorCtor(ExecutionContext *scope)
vtbl = &static_vtbl;
}
-Value SyntaxErrorCtor::construct(Managed *, ExecutionContext *ctx, Value *args, int argc)
+Value SyntaxErrorCtor::construct(Managed *m, Value *args, int argc)
{
- return Value::fromObject(new (ctx->engine->memoryManager) SyntaxErrorObject(ctx->engine, argc ? args[0] : Value::undefinedValue()));
+ return Value::fromObject(new (m->engine()->memoryManager) SyntaxErrorObject(m->engine(), argc ? args[0] : Value::undefinedValue()));
}
TypeErrorCtor::TypeErrorCtor(ExecutionContext *scope)
vtbl = &static_vtbl;
}
-Value TypeErrorCtor::construct(Managed *, ExecutionContext *ctx, Value *args, int argc)
+Value TypeErrorCtor::construct(Managed *m, Value *args, int argc)
{
- return Value::fromObject(new (ctx->engine->memoryManager) TypeErrorObject(ctx->engine, argc ? args[0] : Value::undefinedValue()));
+ return Value::fromObject(new (m->engine()->memoryManager) TypeErrorObject(m->engine(), argc ? args[0] : Value::undefinedValue()));
}
URIErrorCtor::URIErrorCtor(ExecutionContext *scope)
vtbl = &static_vtbl;
}
-Value URIErrorCtor::construct(Managed *, ExecutionContext *ctx, Value *args, int argc)
+Value URIErrorCtor::construct(Managed *m, Value *args, int argc)
{
- return Value::fromObject(new (ctx->engine->memoryManager) URIErrorObject(ctx->engine, argc ? args[0] : Value::undefinedValue()));
+ return Value::fromObject(new (m->engine()->memoryManager) URIErrorObject(m->engine(), argc ? args[0] : Value::undefinedValue()));
}
void ErrorPrototype::init(ExecutionEngine *engine, const Value &ctor, Object *obj)
ErrorCtor(ExecutionContext *scope);
ErrorCtor(ExecutionContext *scope, String *name);
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
protected:
{
EvalErrorCtor(ExecutionContext *scope);
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *m, Value *args, int argc);
protected:
static const ManagedVTable static_vtbl;
{
RangeErrorCtor(ExecutionContext *scope);
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *m, Value *args, int argc);
protected:
static const ManagedVTable static_vtbl;
{
ReferenceErrorCtor(ExecutionContext *scope);
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *m, Value *args, int argc);
protected:
static const ManagedVTable static_vtbl;
{
SyntaxErrorCtor(ExecutionContext *scope);
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *m, Value *args, int argc);
protected:
static const ManagedVTable static_vtbl;
{
TypeErrorCtor(ExecutionContext *scope);
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *m, Value *args, int argc);
protected:
static const ManagedVTable static_vtbl;
{
URIErrorCtor(ExecutionContext *scope);
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *m, Value *args, int argc);
protected:
static const ManagedVTable static_vtbl;
Value FunctionObject::newInstance()
{
- return construct(internalClass->engine->current, 0, 0);
+ return construct(0, 0);
}
bool FunctionObject::hasInstance(Managed *that, const Value &value)
return false;
}
-Value FunctionObject::construct(Managed *that, ExecutionContext *context, Value *, int)
+Value FunctionObject::construct(Managed *that, Value *, int)
{
FunctionObject *f = static_cast<FunctionObject *>(that);
+ ExecutionEngine *v4 = f->engine();
- Object *obj = context->engine->newObject();
- Value proto = f->get(context->engine->id_prototype);
+ Object *obj = v4->newObject();
+ Value proto = f->get(v4->id_prototype);
if (proto.isObject())
obj->prototype = proto.objectValue();
return Value::fromObject(obj);
}
// 15.3.2
-Value FunctionCtor::construct(Managed *that, ExecutionContext *ctx, Value *args, int argc)
+Value FunctionCtor::construct(Managed *that, Value *args, int argc)
{
FunctionCtor *f = static_cast<FunctionCtor *>(that);
- MemoryManager::GCBlocker gcBlocker(ctx->engine->memoryManager);
+ MemoryManager::GCBlocker gcBlocker(f->engine()->memoryManager);
+ ExecutionContext *ctx = f->engine()->current;
QString arguments;
QString body;
if (argc > 0) {
const bool parsed = parser.parseExpression();
if (!parsed)
- ctx->throwSyntaxError(0);
+ f->engine()->current->throwSyntaxError(0);
using namespace QQmlJS::AST;
FunctionExpression *fe = QQmlJS::AST::cast<FunctionExpression *>(parser.rootNode());
+ ExecutionEngine *v4 = f->engine();
if (!fe)
- ctx->throwSyntaxError(0);
+ v4->current->throwSyntaxError(0);
QQmlJS::V4IR::Module module;
- QQmlJS::Codegen cg(ctx, f->strictMode);
+ QQmlJS::Codegen cg(v4->current, f->strictMode);
QQmlJS::V4IR::Function *irf = cg(QString(), function, fe, &module);
- QScopedPointer<QQmlJS::EvalInstructionSelection> isel(ctx->engine->iselFactory->create(ctx->engine, &module));
+ QScopedPointer<QQmlJS::EvalInstructionSelection> isel(v4->iselFactory->create(v4, &module));
QV4::Function *vmf = isel->vmFunction(irf);
- return Value::fromObject(ctx->engine->newScriptFunction(ctx->engine->rootContext, vmf));
+ return Value::fromObject(v4->newScriptFunction(v4->rootContext, vmf));
}
// 15.3.1: This is equivalent to new Function(...)
Value FunctionCtor::call(Managed *that, ExecutionContext *context, const Value &thisObject, Value *args, int argc)
{
- return construct(that, context, args, argc);
+ return construct(that, args, argc);
}
FunctionPrototype::FunctionPrototype(ExecutionContext *ctx)
}
}
-Value ScriptFunction::construct(Managed *that, ExecutionContext *context, Value *args, int argc)
+Value ScriptFunction::construct(Managed *that, Value *args, int argc)
{
ScriptFunction *f = static_cast<ScriptFunction *>(that);
assert(f->function->code);
- Object *obj = context->engine->newObject();
- Value proto = f->get(context->engine->id_prototype);
+ ExecutionEngine *v4 = f->engine();
+ Object *obj = v4->newObject();
+ Value proto = f->get(v4->id_prototype);
if (proto.isObject())
obj->prototype = proto.objectValue();
+ ExecutionContext *context = v4->current;
quintptr stackSpace[stackContextSize/sizeof(quintptr)];
- ExecutionContext *ctx = context->engine->newCallContext(stackSpace, f, Value::fromObject(obj), args, argc);
+ ExecutionContext *ctx = v4->newCallContext(stackSpace, f, Value::fromObject(obj), args, argc);
Value result;
try {
isBuiltinFunction = true;
}
-Value BuiltinFunctionOld::construct(Managed *, ExecutionContext *ctx, Value *, int)
+Value BuiltinFunctionOld::construct(Managed *f, Value *, int)
{
- ctx->throwTypeError();
+ f->engine()->current->throwTypeError();
return Value::undefinedValue();
}
return f->target->call(context, f->boundThis, newArgs, f->boundArgs.size() + argc);
}
-Value BoundFunction::construct(Managed *that, ExecutionContext *context, Value *args, int argc)
+Value BoundFunction::construct(Managed *that, Value *args, int argc)
{
BoundFunction *f = static_cast<BoundFunction *>(that);
Value *newArgs = static_cast<Value *>(alloca(sizeof(Value)*(f->boundArgs.size() + argc)));
memcpy(newArgs, f->boundArgs.constData(), f->boundArgs.size()*sizeof(Value));
memcpy(newArgs + f->boundArgs.size(), args, argc*sizeof(Value));
- return f->target->construct(context, newArgs, f->boundArgs.size() + argc);
+ return f->target->construct(newArgs, f->boundArgs.size() + argc);
}
bool BoundFunction::hasInstance(Managed *that, const Value &value)
Value newInstance();
- static Value construct(Managed *that, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *that, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
- inline Value construct(ExecutionContext *context, Value *args, int argc) {
- return vtbl->construct(this, context, args, argc);
- }
inline Value construct(Value *args, int argc) {
- return vtbl->construct(this, engine()->current, args, argc);
+ return vtbl->construct(this, args, argc);
}
inline Value call(ExecutionContext *context, const Value &thisObject, Value *args, int argc) {
return vtbl->call(this, context, thisObject, args, argc);
{
FunctionCtor(ExecutionContext *scope);
- static Value construct(Managed *that, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *that, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
protected:
BuiltinFunctionOld(ExecutionContext *scope, String *name, Value (*code)(SimpleCallContext *));
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
protected:
isBuiltinFunction = true;
}
- static Value construct(Managed *, ExecutionContext *ctx, Value *, int)
+ static Value construct(Managed *m, Value *, int)
{
- ctx->throwTypeError();
+ m->engine()->current->throwTypeError();
return Value::undefinedValue();
}
struct ScriptFunction: FunctionObject {
ScriptFunction(ExecutionContext *scope, Function *function);
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
protected:
~BoundFunction() {}
- static Value construct(Managed *, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
static const ManagedVTable static_vtbl;
m->engine()->current->throwTypeError();
}
-Value Managed::construct(Managed *, ExecutionContext *context, Value *, int)
+Value Managed::construct(Managed *m, Value *, int)
{
- context->throwTypeError();
+ m->engine()->current->throwTypeError();
}
Value Managed::call(Managed *, ExecutionContext *context, const Value &, Value *, int)
struct ManagedVTable
{
Value (*call)(Managed *, ExecutionContext *context, const Value &thisObject, Value *args, int argc);
- Value (*construct)(Managed *, ExecutionContext *context, Value *args, int argc);
+ Value (*construct)(Managed *, Value *args, int argc);
void (*markObjects)(Managed *);
void (*destroy)(Managed *);
void (*collectDeletables)(Managed *, GCDeletable **deletable);
inline bool hasInstance(const Value &v) {
return vtbl->hasInstance(this, v);
}
- Value construct(ExecutionContext *context, Value *args, int argc);
+ Value construct(Value *args, int argc);
Value call(ExecutionContext *context, const Value &thisObject, Value *args, int argc);
Value get(String *name, bool *hasProperty = 0);
Value getIndexed(uint index, bool *hasProperty = 0);
static void destroy(Managed *that) { that->_data = 0; }
static bool hasInstance(Managed *that, const Value &value);
- static Value construct(Managed *, ExecutionContext *context, Value *, int);
+ static Value construct(Managed *m, Value *, int);
static Value call(Managed *, ExecutionContext *, const Value &, Value *, int);
static void getLookup(Managed *m, Lookup *, Value *);
static void setLookup(Managed *m, Lookup *l, const Value &v);
vtbl = &static_vtbl;
}
-Value NumberCtor::construct(Managed *, ExecutionContext *ctx, Value *args, int argc)
+Value NumberCtor::construct(Managed *m, Value *args, int argc)
{
double d = argc ? args[0].toNumber() : 0.;
- return Value::fromObject(ctx->engine->newNumberObject(Value::fromDouble(d)));
+ return Value::fromObject(m->engine()->newNumberObject(Value::fromDouble(d)));
}
Value NumberCtor::call(Managed *m, ExecutionContext *parentCtx, const Value &thisObject, Value *argv, int argc)
{
NumberCtor(ExecutionContext *scope);
- static Value construct(Managed *that, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *that, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
protected:
vtbl = &static_vtbl;
}
-Value ObjectCtor::construct(Managed *that, ExecutionContext *ctx, Value *args, int argc)
+Value ObjectCtor::construct(Managed *that, Value *args, int argc)
{
ObjectCtor *ctor = static_cast<ObjectCtor *>(that);
+ ExecutionEngine *v4 = that->engine();
if (!argc || args[0].isUndefined() || args[0].isNull()) {
- Object *obj = ctx->engine->newObject();
- Value proto = ctor->get(ctx->engine->id_prototype);
+ Object *obj = v4->newObject();
+ Value proto = ctor->get(v4->id_prototype);
if (proto.isObject())
obj->prototype = proto.objectValue();
return Value::fromObject(obj);
}
- return __qmljs_to_object(ctx, args[0]);
+ return __qmljs_to_object(v4->current, args[0]);
}
Value ObjectCtor::call(Managed *, ExecutionContext *ctx, const Value &/*thisObject*/, Value *args, int argc)
{
ObjectCtor(ExecutionContext *scope);
- static Value construct(Managed *that, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *that, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
protected:
vtbl = &static_vtbl;
}
-Value RegExpCtor::construct(Managed *, ExecutionContext *ctx, Value *argv, int argc)
+Value RegExpCtor::construct(Managed *m, Value *argv, int argc)
{
Value r = argc > 0 ? argv[0] : Value::undefinedValue();
Value f = argc > 1 ? argv[1] : Value::undefinedValue();
+ ExecutionContext *ctx = m->engine()->current;
if (RegExpObject *re = r.as<RegExpObject>()) {
if (!f.isUndefined())
ctx->throwTypeError();
return argv[0];
}
- return construct(that, ctx, argv, argc);
+ return construct(that, argv, argc);
}
void RegExpPrototype::init(ExecutionContext *ctx, const Value &ctor)
if (!r)
ctx->throwTypeError();
- RegExpObject *re = ctx->engine->regExpCtor.asFunctionObject()->construct(ctx, ctx->arguments, ctx->argumentCount).as<RegExpObject>();
+ RegExpObject *re = ctx->engine->regExpCtor.asFunctionObject()->construct(ctx->arguments, ctx->argumentCount).as<RegExpObject>();
r->value = re->value;
r->global = re->global;
{
RegExpCtor(ExecutionContext *scope);
- static Value construct(Managed *that, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *m, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
protected:
l->globalGetter(l, context, &func);
if (Object *f = func.asObject()) {
- Value res = f->construct(context, args, argc);
+ Value res = f->construct(args, argc);
if (result)
*result = res;
return;
void __qmljs_construct_value(ExecutionContext *context, Value *result, const Value &func, Value *args, int argc)
{
if (Object *f = func.asObject()) {
- Value res = f->construct(context, args, argc);
+ Value res = f->construct(args, argc);
if (result)
*result = res;
return;
Value func = thisObject->get(name);
if (Object *f = func.asObject()) {
- Value res = f->construct(context, args, argc);
+ Value res = f->construct(args, argc);
if (result)
*result = res;
return;
vtbl = &static_vtbl;
}
-Value StringCtor::construct(Managed *, ExecutionContext *ctx, Value *argv, int argc)
+Value StringCtor::construct(Managed *m, Value *argv, int argc)
{
Value value;
if (argc)
- value = Value::fromString(argv[0].toString(ctx));
+ value = Value::fromString(argv[0].toString(m->engine()->current));
else
- value = Value::fromString(ctx, QString());
- return Value::fromObject(ctx->engine->newStringObject(value));
+ value = Value::fromString(m->engine()->current, QString());
+ return Value::fromObject(m->engine()->newStringObject(value));
}
Value StringCtor::call(Managed *, ExecutionContext *parentCtx, const Value &thisObject, Value *argv, int argc)
Value regexp = context->argumentCount ? context->arguments[0] : Value::undefinedValue();
RegExpObject *rx = regexp.as<RegExpObject>();
if (!rx)
- rx = context->engine->regExpCtor.asFunctionObject()->construct(context, ®exp, 1).as<RegExpObject>();
+ rx = context->engine->regExpCtor.asFunctionObject()->construct(®exp, 1).as<RegExpObject>();
if (!rx)
// ### CHECK
Value regExpValue = ctx->argument(0);
RegExpObject *regExp = regExpValue.as<RegExpObject>();
if (!regExp) {
- regExpValue = ctx->engine->regExpCtor.asFunctionObject()->construct(ctx, ®ExpValue, 1);
+ regExpValue = ctx->engine->regExpCtor.asFunctionObject()->construct(®ExpValue, 1);
regExp = regExpValue.as<RegExpObject>();
}
uint* matchOffsets = (uint*)alloca(regExp->value->captureCount() * 2 * sizeof(uint));
{
StringCtor(ExecutionContext *scope);
- static Value construct(Managed *that, ExecutionContext *context, Value *args, int argc);
+ static Value construct(Managed *m, Value *args, int argc);
static Value call(Managed *that, ExecutionContext *, const Value &, Value *, int);
protected:
}
// ###
-inline Value Managed::construct(ExecutionContext *context, Value *args, int argc) {
- return vtbl->construct(this, context, args, argc);
+inline Value Managed::construct(Value *args, int argc) {
+ return vtbl->construct(this, args, argc);
}
inline Value Managed::call(ExecutionContext *context, const Value &thisObject, Value *args, int argc) {
return vtbl->call(this, context, thisObject, args, argc);
Value result;
QV4::ExecutionContext *ctx = engine->current;
try {
- result = f->construct(ctx, arguments.data(), arguments.size());
+ result = f->construct(arguments.data(), arguments.size());
} catch (Exception &e) {
e.accept(ctx);
result = e.value();
isBuiltinFunction = true;
}
- static QV4::Value construct(QV4::Managed *, QV4::ExecutionContext *ctx, QV4::Value *, int)
+ static QV4::Value construct(QV4::Managed *m, QV4::Value *, int)
{
- ctx->throwTypeError();
+ m->engine()->current->throwTypeError();
return QV4::Value::undefinedValue();
}