using namespace QQmlJS::VM;
-String *String::get(Context *ctx, const QString &s)
-{
- return ctx->engine->newString(s);
-}
-
Object::~Object()
{
delete members;
stringCtor = StringCtor::create(this);
numberCtor = NumberCtor::create(this);
- String *prototype = String::get(rootContext, QLatin1String("prototype"));
+ String *prototype = identifier(QLatin1String("prototype"));
objectCtor.objectValue->get(prototype, &objectPrototype);
stringCtor.objectValue->get(prototype, &stringPrototype);
return _hashValue;
}
- static String *get(Context *ctx, const QString &s);
-
private:
QString _text;
mutable unsigned _hashValue;
void __qmljs_string_from_number(Context *ctx, Value *result, double number)
{
- String *string = String::get(ctx, QString::number(number, 'g', 16));
+ String *string = ctx->engine->newString(QString::number(number, 'g', 16));
__qmljs_init_string(result, string);
}
String *__qmljs_string_concat(Context *ctx, String *first, String *second)
{
- return String::get(ctx, first->toQString() + second->toQString());
+ return ctx->engine->newString(first->toQString() + second->toQString());
}
bool __qmljs_is_function(Context *, const Value *value)
{
const Value arg = ctx->argument(0);
if (arg.is(UNDEFINED_TYPE))
- __qmljs_init_string(&ctx->result, String::get(ctx, QString()));
+ __qmljs_init_string(&ctx->result, ctx->engine->newString(QString()));
else
__qmljs_to_string(ctx, &ctx->result, &arg);
}
amd64_mov_reg_reg(_codePtr, AMD64_RDI, AMD64_R14, 8);
loadTempAddress(AMD64_RSI, base);
amd64_mov_reg_imm(_codePtr, AMD64_RDX, identifier(*m->name));
- amd64_mov_reg_imm(_codePtr, AMD64_RCX, VM::String::get(_engine->rootContext, *str->value));
+ amd64_mov_reg_imm(_codePtr, AMD64_RCX, _engine->newString(*str->value));
amd64_call_code(_codePtr, __qmljs_set_property_string);
return;
} else if (IR::Temp *t = s->source->asTemp()) {