QT_BEGIN_NAMESPACE
#define V4THROW_SQL(error, desc) { \
- QV4::Scoped<String> v(scope, scope.engine->newString(desc)); \
+ QV4::ScopedString v(scope, scope.engine->newString(desc)); \
QV4::Scoped<Object> ex(scope, scope.engine->newErrorObject(v)); \
ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(QStringLiteral("code"))).getPointer(), QV4::ScopedValue(scope, Primitive::fromInt32(error))); \
ctx->engine()->throwError(ex); \
}
#define V4THROW_SQL2(error, desc) { \
- QV4::Scoped<String> v(scope, scope.engine->newString(desc)); \
+ QV4::ScopedString v(scope, scope.engine->newString(desc)); \
QV4::Scoped<Object> ex(scope, scope.engine->newErrorObject(v)); \
ex->put(QV4::ScopedString(scope, scope.engine->newIdentifier(QStringLiteral("code"))).getPointer(), QV4::ScopedValue(scope, Primitive::fromInt32(error))); \
args->setReturnValue(ctx->engine()->throwError(ex)); \
}
#define V4THROW_REFERENCE(string) { \
- QV4::Scoped<String> v(scope, scope.engine->newString(string)); \
+ QV4::ScopedString v(scope, scope.engine->newString(string)); \
ctx->engine()->throwReferenceError(v); \
return Encode::undefined(); \
}
globalObject()->defineDefaultProperty(QStringLiteral("escape"), GlobalFunctions::method_escape, 1);
globalObject()->defineDefaultProperty(QStringLiteral("unescape"), GlobalFunctions::method_unescape, 1);
- Scoped<String> name(scope, newString(QStringLiteral("thrower")));
+ ScopedString name(scope, newString(QStringLiteral("thrower")));
thrower = BuiltinFunction::create(global, name, ::throwTypeError);
}
ReturnedValue ExecutionEngine::throwReferenceError(const ValueRef value)
{
Scope scope(this);
- Scoped<String> s(scope, value->toString(this));
+ ScopedString s(scope, value->toString(this));
QString msg = s->toQString() + QStringLiteral(" is not defined");
Scoped<Object> error(scope, newReferenceErrorObject(msg));
return throwError(error);
Scope scope(ctx);
// [15.1.2.3] step by step:
- Scoped<String> inputString(scope, ctx->argument(0), Scoped<String>::Convert);
+ ScopedString inputString(scope, ctx->argument(0), ScopedString::Convert);
if (scope.engine->hasException)
return Encode::undefined();
}
}
Scope scope(engine);
- Scoped<String> n(scope, engine->currentContext()->compilationUnit->runtimeStrings[l->nameIndex]);
+ ScopedString n(scope, engine->currentContext()->compilationUnit->runtimeStrings[l->nameIndex]);
return engine->throwReferenceError(n);
}
{
ExecutionEngine *e = engine();
Scope scope(e);
- Scoped<String> s(scope, e->newIdentifier(name));
+ ScopedString s(scope, e->newIdentifier(name));
defineAccessorProperty(s, getter, setter);
}
Scoped<ArgumentsObject>(scope, O)->fullyCreate();
ScopedValue v(scope, ctx->argument(1));
- Scoped<String> name(scope, v->toString(scope.engine));
+ ScopedString name(scope, v->toString(scope.engine));
if (scope.hasException())
return Encode::undefined();
PropertyAttributes attrs;
if (!O)
return ctx->engine()->throwTypeError();
- Scoped<String> name(scope, ctx->argument(1), Scoped<String>::Convert);
+ ScopedString name(scope, ctx->argument(1), ScopedString::Convert);
if (scope.engine->hasException)
return Encode::undefined();
ReturnedValue ObjectPrototype::method_hasOwnProperty(CallContext *ctx)
{
Scope scope(ctx);
- Scoped<String> P(scope, ctx->argument(0), Scoped<String>::Convert);
+ ScopedString P(scope, ctx->argument(0), ScopedString::Convert);
if (scope.engine->hasException)
return Encode::undefined();
Scoped<Object> O(scope, ctx->d()->callData->thisObject, Scoped<Object>::Convert);
ReturnedValue ObjectPrototype::method_propertyIsEnumerable(CallContext *ctx)
{
Scope scope(ctx);
- Scoped<String> p(scope, ctx->argument(0), Scoped<String>::Convert);
+ ScopedString p(scope, ctx->argument(0), ScopedString::Convert);
if (scope.engine->hasException)
return Encode::undefined();
if (!f)
return ctx->engine()->throwTypeError();
- Scoped<String> prop(scope, ctx->argument(0), Scoped<String>::Convert);
+ ScopedString prop(scope, ctx->argument(0), ScopedString::Convert);
if (scope.engine->hasException)
return Encode::undefined();
if (!f)
return ctx->engine()->throwTypeError();
- Scoped<String> prop(scope, ctx->argument(0), Scoped<String>::Convert);
+ ScopedString prop(scope, ctx->argument(0), ScopedString::Convert);
if (scope.engine->hasException)
return Encode::undefined();
if (wrapper && wrapper->d()->readOnly) {
QString error = QLatin1String("Invalid write to global property \"") + name->toQString() +
QLatin1Char('"');
- Scoped<String> e(scope, v4->currentContext()->engine->newString(error));
+ ScopedString e(scope, v4->currentContext()->engine->newString(error));
v4->throwError(e);
return;
}
if (!f->bindingKeyFlag()) {
// assigning a JS function to a non-var-property is not allowed.
QString error = QStringLiteral("Cannot assign JavaScript function to value-type property");
- Scoped<String> e(scope, v4->newString(error));
+ ScopedString e(scope, v4->newString(error));
v4->throwError(e);
return;
}
QV4::ScopedObject o(scope);
QV4::ObjectIterator it(scope, object, QV4::ObjectIterator::WithProtoChain|QV4::ObjectIterator::EnumerableOnly);
- QV4::Scoped<QV4::String> propertyName(scope);
+ QV4::ScopedString propertyName(scope);
QV4::ScopedValue propertyValue(scope);
QV4::ScopedString s(scope);
QV4::ScopedArrayObject a(scope);
QV4::Scope scope(v4);
QV4::ObjectIterator it(scope, object, QV4::ObjectIterator::WithProtoChain|QV4::ObjectIterator::EnumerableOnly);
- QV4::Scoped<QV4::String> propertyName(scope);
+ QV4::ScopedString propertyName(scope);
QV4::ScopedValue propertyValue(scope);
QV4::ScopedObject o(scope);
QV4::ScopedArrayObject a(scope);
QV4::Scoped<QQuickJSContext2D> r(scope, ctx->d()->callData->thisObject);
CHECK_CONTEXT_SETTER(r)
- QV4::Scoped<QV4::String> s(scope, ctx->argument(0), QV4::Scoped<QV4::String>::Convert);
+ QV4::ScopedString s(scope, ctx->argument(0), QV4::ScopedString::Convert);
if (scope.engine->hasException)
return QV4::Encode::undefined();
QFont font = qt_font_from_string(s->toQString(), r->d()->context->state.font);
QV4::Scoped<QQuickJSContext2D> r(scope, ctx->d()->callData->thisObject);
CHECK_CONTEXT_SETTER(r)
- QV4::Scoped<QV4::String> s(scope, ctx->argument(0), QV4::Scoped<QV4::String>::Convert);
+ QV4::ScopedString s(scope, ctx->argument(0), QV4::ScopedString::Convert);
if (scope.engine->hasException)
return QV4::Encode::undefined();
QString textAlign = s->toQString();
QV4::Scope scope(ctx);
QV4::Scoped<QQuickJSContext2D> r(scope, ctx->d()->callData->thisObject);
CHECK_CONTEXT_SETTER(r)
- QV4::Scoped<QV4::String> s(scope, ctx->argument(0), QV4::Scoped<QV4::String>::Convert);
+ QV4::ScopedString s(scope, ctx->argument(0), QV4::ScopedString::Convert);
if (scope.engine->hasException)
return QV4::Encode::undefined();
QString textBaseline = s->toQString();
QV4::ExecutionEngine *v4 = v4Engine();
QV4::Scope scope(v4);
- QV4::Scoped<QV4::String> name(scope, v4->newString(functionName));
+ QV4::ScopedString name(scope, v4->newString(functionName));
QV4::ScopedContext ctx(scope, v4->rootContext());
QV4::ScopedValue function(scope, BuiltinFunction::create(ctx, name, injectedFunction));
v4->globalObject()->put(name, function);