#define V4THROW_SQL(error, desc) { \
Value v = Value::fromString(ctx, desc); \
Object *ex = ctx->engine->newErrorObject(v); \
- ex->put(ctx, ctx->engine->newIdentifier(QStringLiteral("code")), Value::fromInt32(error)); \
+ ex->put(ctx->engine->newIdentifier(QStringLiteral("code")), Value::fromInt32(error)); \
ctx->throwError(Value::fromObject(ex)); \
}
for (int ii = 0; ii < record.count(); ++ii) {
QVariant v = record.value(ii);
if (v.isNull()) {
- row->put(v4->current, v4->newIdentifier(record.fieldName(ii)), Value::nullValue());
+ row->put(v4->newIdentifier(record.fieldName(ii)), Value::nullValue());
} else {
- row->put(v4->current, v4->newIdentifier(record.fieldName(ii)), v8->fromVariant(v));
+ row->put(v4->newIdentifier(record.fieldName(ii)), v8->fromVariant(v));
}
}
if (hasProperty)
Object *resultObject = ctx->engine->newObject();
result = Value::fromObject(resultObject);
// XXX optimize
- resultObject->put(ctx, ctx->engine->newIdentifier("rowsAffected"), Value::fromInt32(query.numRowsAffected()));
- resultObject->put(ctx, ctx->engine->newIdentifier("insertId"), engine->toString(query.lastInsertId().toString()));
- resultObject->put(ctx, ctx->engine->newIdentifier("rows"), Value::fromObject(rows));
+ resultObject->put(ctx->engine->newIdentifier("rowsAffected"), Value::fromInt32(query.numRowsAffected()));
+ resultObject->put(ctx->engine->newIdentifier("insertId"), engine->toString(query.lastInsertId().toString()));
+ resultObject->put(ctx->engine->newIdentifier("rows"), Value::fromObject(rows));
} else {
err = true;
}
return Value::undefinedValue();
}
-void QmlContextWrapper::put(Managed *m, ExecutionContext *ctx, String *name, const Value &value)
+void QmlContextWrapper::put(Managed *m, String *name, const Value &value)
{
QmlContextWrapper *wrapper = m->as<QmlContextWrapper>();
+ ExecutionEngine *v4 = m->engine();
if (!wrapper)
- ctx->throwTypeError();
+ v4->current->throwTypeError();
if (wrapper->isNullWrapper) {
if (wrapper && wrapper->readOnly) {
QString error = QLatin1String("Invalid write to global property \"") + name->toQString() +
QLatin1Char('"');
- ctx->throwError(Value::fromString(ctx->engine->newString(error)));
+ v4->current->throwError(Value::fromString(v4->current->engine->newString(error)));
}
- Object::put(m, ctx, name, value);
+ Object::put(m, name, value);
return;
}
PropertyAttributes attrs;
Property *pd = wrapper->__getOwnProperty__(name, &attrs);
if (pd) {
- wrapper->putValue(ctx, pd, attrs, value);
+ wrapper->putValue(v4->current, pd, attrs, value);
return;
}
// See QV8ContextWrapper::Getter for resolution order
- QV8Engine *engine = wrapper->v8;
QObject *scopeObject = wrapper->getScopeObject();
QHashedV4String propertystring(Value::fromString(name));
// Search scope object
if (scopeObject &&
- QV4::QObjectWrapper::setQmlProperty(ctx, context, scopeObject, name, QV4::QObjectWrapper::CheckRevision, value))
+ QV4::QObjectWrapper::setQmlProperty(v4->current, context, scopeObject, name, QV4::QObjectWrapper::CheckRevision, value))
return;
scopeObject = 0;
// Search context object
if (context->contextObject &&
- QV4::QObjectWrapper::setQmlProperty(ctx, context, context->contextObject, name, QV4::QObjectWrapper::CheckRevision, value))
+ QV4::QObjectWrapper::setQmlProperty(v4->current, context, context->contextObject, name, QV4::QObjectWrapper::CheckRevision, value))
return;
context = context->parent;
if (wrapper->readOnly) {
QString error = QLatin1String("Invalid write to global property \"") + name->toQString() +
QLatin1Char('"');
- ctx->throwError(error);
+ v4->current->throwError(error);
}
- Object::put(m, ctx, name, value);
+ Object::put(m, name, value);
}
void QmlContextWrapper::destroy(Managed *that)
void setReadOnly(bool b) { readOnly = b; }
static Value get(Managed *m, String *name, bool *hasProperty);
- static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
+ static void put(Managed *m, String *name, const Value &value);
static void destroy(Managed *that);
return Value::undefinedValue();
}
-void QmlListWrapper::put(Managed *m, ExecutionContext *ctx, String *name, const Value &value)
+void QmlListWrapper::put(Managed *m, String *name, const Value &value)
{
// doesn't do anything. Should we throw?
Q_UNUSED(m);
- Q_UNUSED(ctx);
Q_UNUSED(name);
Q_UNUSED(value);
}
static Value get(Managed *m, String *name, bool *hasProperty);
static Value getIndexed(Managed *m, uint index, bool *hasProperty);
- static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
+ static void put(Managed *m, String *name, const Value &value);
static Property *advanceIterator(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attributes);
static void destroy(Managed *that);
}
-void QmlTypeWrapper::put(Managed *m, ExecutionContext *ctx, String *name, const Value &value)
+void QmlTypeWrapper::put(Managed *m, String *name, const Value &value)
{
QmlTypeWrapper *w = m->as<QmlTypeWrapper>();
+ QV4::ExecutionEngine *v4 = m->engine();
if (!w)
- ctx->throwTypeError();
+ v4->current->throwTypeError();
- QV8Engine *v8engine = w->v8;
+ QV8Engine *v8engine = v4->v8Engine;
QQmlContextData *context = v8engine->callingContext();
QHashedV4String propertystring(Value::fromString(name));
QObject *object = w->object;
QObject *ao = qmlAttachedPropertiesObjectById(type->attachedPropertiesId(), object);
if (ao)
- QV4::QObjectWrapper::setQmlProperty(ctx, context, ao, name, QV4::QObjectWrapper::IgnoreRevision, value);
+ QV4::QObjectWrapper::setQmlProperty(v4->current, context, ao, name, QV4::QObjectWrapper::IgnoreRevision, value);
} else if (type && type->isSingleton()) {
QQmlEngine *e = v8engine->engine();
QQmlType::SingletonInstanceInfo *siinfo = type->singletonInstanceInfo();
QObject *qobjectSingleton = siinfo->qobjectApi(e);
if (qobjectSingleton) {
- QV4::QObjectWrapper::setQmlProperty(ctx, context, qobjectSingleton, name, QV4::QObjectWrapper::IgnoreRevision, value);
+ QV4::QObjectWrapper::setQmlProperty(v4->current, context, qobjectSingleton, name, QV4::QObjectWrapper::IgnoreRevision, value);
} else if (!siinfo->scriptApi(e).isUndefined()) {
QV4::Object *apiprivate = QJSValuePrivate::get(siinfo->scriptApi(e))->value.asObject();
if (!apiprivate) {
QString error = QLatin1String("Cannot assign to read-only property \"") + name->toQString() + QLatin1Char('\"');
- ctx->throwError(error);
+ v4->current->throwError(error);
} else {
- QV4::ExecutionEngine *engine = QV8Engine::getV4(v8engine);
- apiprivate->put(engine->current, name, value);
+ apiprivate->put(name, value);
}
}
}
static Value get(Managed *m, String *name, bool *hasProperty);
- static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
+ static void put(Managed *m, String *name, const Value &value);
static void destroy(Managed *that);
private:
#undef VALUE_TYPE_ACCESSOR
}
-void QmlValueTypeWrapper::put(Managed *m, ExecutionContext *ctx, String *name, const Value &value)
+void QmlValueTypeWrapper::put(Managed *m, String *name, const Value &value)
{
QmlValueTypeWrapper *r = m->as<QmlValueTypeWrapper>();
+ ExecutionEngine *v4 = m->engine();
if (!r)
- ctx->throwTypeError();
+ v4->current->throwTypeError();
QByteArray propName = name->toQString().toUtf8();
if (r->objectType == QmlValueTypeWrapper::Reference) {
if (!f->bindingKeyFlag) {
// assigning a JS function to a non-var-property is not allowed.
QString error = QLatin1String("Cannot assign JavaScript function to value-type property");
- ctx->throwError(r->v8->toString(error));
+ v4->current->throwError(r->v8->toString(error));
}
QQmlContextData *context = r->v8->callingContext();
cacheData.valueTypeCoreIndex = index;
cacheData.valueTypePropType = p.userType();
- QV4::ExecutionEngine *v4 = ctx->engine;
QV4::ExecutionEngine::StackFrame frame = v4->currentStackFrame();
newBinding = new QQmlBinding(value, reference->object, context,
static Value get(Managed *m, String *name, bool *hasProperty);
- static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
+ static void put(Managed *m, String *name, const Value &value);
static void destroy(Managed *that);
static bool isEqualTo(Managed *m, Managed *other);
if (!len) {
if (!instance->isArrayObject())
- instance->put(ctx, ctx->engine->id_length, Value::fromInt32(0));
+ instance->put(ctx->engine->id_length, Value::fromInt32(0));
return Value::undefinedValue();
}
if (instance->isArrayObject())
instance->setArrayLengthUnchecked(len - 1);
else
- instance->put(ctx, ctx->engine->id_length, Value::fromDouble(len - 1));
+ instance->put(ctx->engine->id_length, Value::fromDouble(len - 1));
return result;
}
double l = len;
for (double i = 0; i < ctx->argumentCount; ++i) {
Value idx = Value::fromDouble(l + i);
- instance->put(ctx, idx.toString(ctx), ctx->argument(i));
+ instance->put(idx.toString(ctx), ctx->argument(i));
}
double newLen = l + ctx->argumentCount;
if (!instance->isArrayObject())
- instance->put(ctx, ctx->engine->id_length, Value::fromDouble(newLen));
+ instance->put(ctx->engine->id_length, Value::fromDouble(newLen));
else
ctx->throwRangeError(Value::fromString(ctx, QStringLiteral("Array.prototype.push: Overflow")));
return Value::fromDouble(newLen);
if (instance->isArrayObject())
instance->setArrayLengthUnchecked(len);
else
- instance->put(ctx, ctx->engine->id_length, Value::fromDouble(len));
+ instance->put(ctx->engine->id_length, Value::fromDouble(len));
if (len < INT_MAX)
return Value::fromInt32(len);
if (!len) {
if (!instance->isArrayObject())
- instance->put(ctx, ctx->engine->id_length, Value::fromInt32(0));
+ instance->put(ctx->engine->id_length, Value::fromInt32(0));
return Value::undefinedValue();
}
if (instance->isArrayObject())
instance->setArrayLengthUnchecked(len - 1);
else
- instance->put(ctx, ctx->engine->id_length, Value::fromDouble(len - 1));
+ instance->put(ctx->engine->id_length, Value::fromDouble(len - 1));
return result;
}
instance->putIndexed(start + i, ctx->argument(i + 2));
ctx->strictMode = true;
- instance->put(ctx, ctx->engine->id_length, Value::fromDouble(len - deleteCount + itemCount));
+ instance->put(ctx->engine->id_length, Value::fromDouble(len - deleteCount + itemCount));
return Value::fromObject(newArray);
}
if (instance->isArrayObject())
instance->setArrayLengthUnchecked(newLen);
else
- instance->put(ctx, ctx->engine->id_length, Value::fromDouble(newLen));
+ instance->put(ctx->engine->id_length, Value::fromDouble(newLen));
if (newLen < INT_MAX)
return Value::fromInt32(newLen);
if (ctx->type == Type_WithContext) {
Object *w = static_cast<WithContext *>(ctx)->withObject;
if (w->__hasProperty__(name)) {
- w->put(ctx, name, value);
+ w->put(name, value);
return;
}
} else if (ctx->type == Type_CatchContext && static_cast<CatchContext *>(ctx)->exceptionVarName->isEqualTo(name)) {
}
if (activation && (ctx->type == Type_QmlContext || activation->__hasProperty__(name))) {
- activation->put(this, name, value);
+ activation->put(name, value);
return;
}
}
}
if (strictMode || name->isEqualTo(engine->id_this))
throwReferenceError(Value::fromString(name));
- engine->globalObject->put(this, name, value);
+ engine->globalObject->put(name, value);
}
Value ExecutionContext::getProperty(String *name)
{
Object *o = engine->newObject();
for (QJsonObject::const_iterator it = object.begin(); it != object.end(); ++it)
- o->put(engine->current, engine->newString(it.key()), fromJsonValue(engine, it.value()));
+ o->put(engine->newString(it.key()), fromJsonValue(engine, it.value()));
return Value::fromObject(o);
}
bool (*hasInstance)(Managed *, const Value &value);
Value (*get)(Managed *, String *name, bool *hasProperty);
Value (*getIndexed)(Managed *, uint index, bool *hasProperty);
- void (*put)(Managed *, ExecutionContext *ctx, String *name, const Value &value);
+ void (*put)(Managed *, String *name, const Value &value);
void (*putIndexed)(Managed *, uint index, const Value &value);
PropertyAttributes (*query)(const Managed *, String *name);
PropertyAttributes (*queryIndexed)(const Managed *, uint index);
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);
- void put(ExecutionContext *ctx, String *name, const Value &value)
- { vtbl->put(this, ctx, name, value); }
+ void put(String *name, const Value &value)
+ { vtbl->put(this, name, value); }
void putIndexed(uint index, const Value &value)
{ vtbl->putIndexed(this, index, value); }
PropertyAttributes query(String *name) const
void Object::put(ExecutionContext *ctx, const QString &name, const Value &value)
{
- put(ctx, ctx->engine->newString(name), value);
+ put(ctx->engine->newString(name), value);
}
Value Object::getValue(const Value &thisObject, ExecutionContext *ctx, const Property *p, PropertyAttributes attrs)
Value v = get(name);
Value result;
op(ctx, &result, v, rhs);
- put(ctx, name, result);
+ put(name, result);
}
void Object::inplaceBinOp(ExecutionContext *ctx, BinOp op, const Value &index, const Value &rhs)
return static_cast<Object *>(m)->internalGetIndexed(index, hasProperty);
}
-void Object::put(Managed *m, ExecutionContext *ctx, String *name, const Value &value)
+void Object::put(Managed *m, String *name, const Value &value)
{
- static_cast<Object *>(m)->internalPut(ctx, name, value);
+ static_cast<Object *>(m)->internalPut(name, value);
}
void Object::putIndexed(Managed *m, uint index, const Value &value)
}
}
- o->put(o->engine()->current, l->name, value);
+ o->put(l->name, value);
}
Property *Object::advanceIterator(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attrs)
// Section 8.12.5
-void Object::internalPut(ExecutionContext *ctx, String *name, const Value &value)
+void Object::internalPut(String *name, const Value &value)
{
uint idx = name->asArrayIndex();
if (idx != UINT_MAX)
return putIndexed(idx, value);
- name->makeIdentifier(ctx);
+ name->makeIdentifier(engine()->current);
uint member = internalClass->find(name);
Property *pd = 0;
goto reject;
} else if (!attrs.isWritable())
goto reject;
- else if (isArrayObject() && name->isEqualTo(ctx->engine->id_length)) {
+ else if (isArrayObject() && name->isEqualTo(engine()->id_length)) {
bool ok;
uint l = value.asArrayLength(&ok);
if (!ok)
- ctx->throwRangeError(value);
+ engine()->current->throwRangeError(value);
ok = setArrayLength(l);
if (!ok)
goto reject;
Value args[1];
args[0] = value;
- pd->setter()->call(ctx, Value::fromObject(this), args, 1);
+ pd->setter()->call(engine()->current, Value::fromObject(this), args, 1);
return;
}
}
reject:
- if (ctx->strictMode) {
+ if (engine()->current->strictMode) {
QString message = QStringLiteral("Cannot assign to read-only property \"");
message += name->toQString();
message += QLatin1Char('\"');
- ctx->throwTypeError(message);
+ engine()->current->throwTypeError(message);
}
}
inline Value getIndexed(uint idx, bool *hasProperty = 0)
{ return vtbl->getIndexed(this, idx, hasProperty); }
inline void put(String *name, const Value &v)
- { vtbl->put(this, engine()->current, name, v); }
+ { vtbl->put(this, name, v); }
inline void putIndexed(uint idx, const Value &v)
{ vtbl->putIndexed(this, idx, v); }
using Managed::get;
static void markObjects(Managed *that);
static Value get(Managed *m, String *name, bool *hasProperty);
static Value getIndexed(Managed *m, uint index, bool *hasProperty);
- static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
+ static void put(Managed *m, String *name, const Value &value);
static void putIndexed(Managed *m, uint index, const Value &value);
static PropertyAttributes query(const Managed *m, String *name);
static PropertyAttributes queryIndexed(const Managed *m, uint index);
private:
Value internalGet(String *name, bool *hasProperty);
Value internalGetIndexed(uint index, bool *hasProperty);
- void internalPut(ExecutionContext *ctx, String *name, const Value &value);
+ void internalPut(String *name, const Value &value);
void internalPutIndexed(uint index, const Value &value);
bool internalDeleteProperty(String *name);
bool internalDeleteIndexedProperty(uint index);
return that->getQmlProperty(v4->current, qmlContext, name, IgnoreRevision, hasProperty, /*includeImports*/ true);
}
-void QObjectWrapper::put(Managed *m, ExecutionContext *ctx, String *name, const Value &value)
+void QObjectWrapper::put(Managed *m, String *name, const Value &value)
{
QObjectWrapper *that = static_cast<QObjectWrapper*>(m);
+ ExecutionEngine *v4 = m->engine();
if (QQmlData::wasDeleted(that->m_object))
return;
- QQmlContextData *qmlContext = QV4::QmlContextWrapper::callingContext(ctx->engine);
- if (!setQmlProperty(ctx, qmlContext, that->m_object, name, QV4::QObjectWrapper::IgnoreRevision, value)) {
+ QQmlContextData *qmlContext = QV4::QmlContextWrapper::callingContext(v4);
+ if (!setQmlProperty(v4->current, qmlContext, that->m_object, name, QV4::QObjectWrapper::IgnoreRevision, value)) {
QString error = QLatin1String("Cannot assign to non-existent property \"") +
name->toQString() + QLatin1Char('\"');
- ctx->throwError(error);
+ v4->current->throwError(error);
}
}
String *m_toString;
static Value get(Managed *m, String *name, bool *hasProperty);
- static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
+ static void put(Managed *m, String *name, const Value &value);
static PropertyAttributes query(const Managed *, String *name);
static Property *advanceIterator(Managed *m, ObjectIterator *it, String **name, uint *index, PropertyAttributes *attributes);
static void markObjects(Managed *that);
return Value::undefinedValue();
}
-void RegExp::put(Managed *m, ExecutionContext *ctx, String *name, const Value &value)
+void RegExp::put(Managed *m, String *name, const Value &value)
{
}
static void markObjects(Managed *that);
static Value get(Managed *m, String *name, bool *hasProperty);
static Value getIndexed(Managed *m, uint index, bool *hasProperty);
- static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
+ static void put(Managed *m, String *name, const Value &value);
static void putIndexed(Managed *m, uint index, const Value &value);
static PropertyAttributes query(const Managed *m, String *name);
static PropertyAttributes queryIndexed(const Managed *m, uint index);
void __qmljs_set_property(ExecutionContext *ctx, const Value &object, String *name, const Value &value)
{
Object *o = object.toObject(ctx);
- o->put(ctx, name, value);
+ o->put(name, value);
}
void __qmljs_get_element(ExecutionContext *ctx, Value *result, const Value &object, const Value &index)
}
String *name = index.toString(ctx);
- o->put(ctx, name, value);
+ o->put(name, value);
}
void __qmljs_foreach_iterator_object(ExecutionContext *ctx, Value *result, const Value &in)
v = Value::fromDouble(d + 1);
}
- o->put(context, name, v);
+ o->put(name, v);
}
void __qmljs_builtin_post_increment_element(ExecutionContext *context, Value *result, const Value &base, const Value *index)
v = Value::fromDouble(d - 1);
}
- o->put(context, name, v);
+ o->put(name, v);
}
void __qmljs_builtin_post_decrement_element(ExecutionContext *context, Value *result, const Value &base, const Value &index)
return engine->stringPrototype->getValue(Value::fromString(that), engine->current, pd, attrs);
}
-void String::put(Managed *m, ExecutionContext *ctx, String *name, const Value &value)
+void String::put(Managed *m, String *name, const Value &value)
{
String *that = static_cast<String *>(m);
- Object *o = ctx->engine->newStringObject(Value::fromString(that));
- o->put(ctx, name, value);
+ Object *o = that->engine()->newStringObject(Value::fromString(that));
+ o->put(name, value);
}
void String::putIndexed(Managed *m, uint index, const Value &value)
static void destroy(Managed *);
static Value get(Managed *m, String *name, bool *hasProperty);
static Value getIndexed(Managed *m, uint index, bool *hasProperty);
- static void put(Managed *m, ExecutionContext *ctx, String *name, const Value &value);
+ static void put(Managed *m, String *name, const Value &value);
static void putIndexed(Managed *m, uint index, const Value &value);
static PropertyAttributes query(const Managed *m, String *name);
static PropertyAttributes queryIndexed(const Managed *m, uint index);
return exec->call(context, Value::fromObject(rx), &arg, 1);
String *lastIndex = context->engine->newString(QStringLiteral("lastIndex"));
- rx->put(context, lastIndex, Value::fromInt32(0));
+ rx->put(lastIndex, Value::fromInt32(0));
ArrayObject *a = context->engine->newArrayObject();
double previousLastIndex = 0;
double thisIndex = rx->get(lastIndex, 0).toInteger();
if (previousLastIndex == thisIndex) {
previousLastIndex = thisIndex + 1;
- rx->put(context, lastIndex, Value::fromDouble(previousLastIndex));
+ rx->put(lastIndex, Value::fromDouble(previousLastIndex));
} else {
previousLastIndex = thisIndex;
}
QV4::ExecutionContext *ctx = engine->current;
s->makeIdentifier(ctx);
try {
- o->put(ctx, s, value.d->getValue(engine));
+ o->put(s, value.d->getValue(engine));
} catch (QV4::Exception &e) {
e.accept(ctx);
}
if (arrayIndex != UINT_MAX)
o->putIndexed(arrayIndex, value.d->getValue(engine));
else
- o->put(ctx, engine->id_uintMax, value.d->getValue(engine));
+ o->put(engine->id_uintMax, value.d->getValue(engine));
} catch (QV4::Exception &e) {
e.accept(ctx);
}
#define V4THROW_DOM(error, string) { \
QV4::Value v = QV4::Value::fromString(ctx, QStringLiteral(string)); \
QV4::Object *ex = ctx->engine->newErrorObject(v); \
- ex->put(ctx, ctx->engine->newIdentifier(QStringLiteral("code")), QV4::Value::fromInt32(error)); \
+ ex->put(ctx->engine->newIdentifier(QStringLiteral("code")), QV4::Value::fromInt32(error)); \
ctx->throwError(QV4::Value::fromObject(ex)); \
}
QV4::ExecutionEngine *e = QV8Engine::getV4(engine);
QV4::Object *o = e->newObject();
for (QVariantMap::ConstIterator iter = map.begin(); iter != map.end(); ++iter)
- o->put(e->current, e->newString(iter.key()), engine->fromVariant(iter.value()));
+ o->put(e->newString(iter.key()), engine->fromVariant(iter.value()));
return QV4::Value::fromObject(o);
}
QFontMetrics fm(r->context->state.font);
uint width = fm.width(ctx->arguments[0].toQString());
QV4::Object *tm = ctx->engine->newObject();
- tm->put(ctx->engine->current, ctx->engine->newIdentifier(QStringLiteral("width")), QV4::Value::fromDouble(width));
+ tm->put(ctx->engine->newIdentifier(QStringLiteral("width")), QV4::Value::fromDouble(width));
return QV4::Value::fromObject(tm);
}
return QV4::Value::undefinedValue();
std::cerr << qPrintable(msg->buildFullMessage(ctx)->toQString()) << std::endl;
}
} else {
- std::cerr << "Uncaught exception: " << qPrintable(e->get(ctx, ctx->engine->newString(QStringLiteral("message")), 0).toString(ctx)->toQString()) << std::endl;
+ std::cerr << "Uncaught exception: " << qPrintable(e->get(ctx->engine->newString(QStringLiteral("message")), 0).toString(ctx)->toQString()) << std::endl;
}
}
QV4::Object *globalObject = vm.globalObject;
QV4::Object *print = new (ctx->engine->memoryManager) builtins::Print(ctx);
print->prototype = ctx->engine->objectPrototype;
- globalObject->put(ctx, vm.newIdentifier(QStringLiteral("print")),
- QV4::Value::fromObject(print));
+ globalObject->put(vm.newIdentifier(QStringLiteral("print")), QV4::Value::fromObject(print));
QV4::Object *gc = new (ctx->engine->memoryManager) builtins::GC(ctx);
gc->prototype = ctx->engine->objectPrototype;
- globalObject->put(ctx, vm.newIdentifier(QStringLiteral("gc")),
- QV4::Value::fromObject(gc));
+ globalObject->put(vm.newIdentifier(QStringLiteral("gc")), QV4::Value::fromObject(gc));
foreach (const QString &fn, args) {
QFile file(fn);