Stringp ScriptObject::implToString() const { AvmCore* core = this->core(); Traits* t = this->traits(); Stringp s = core->concatStrings(core->newConstantStringLatin1("[object "), t->name()); return core->concatStrings(s, core->newConstantStringLatin1("]")); }
Stringp ClassClosure::implToString() const { AvmCore* core = this->core(); Traits* t = this->traits()->itraits; Stringp s = core->concatStrings(core->newConstantStringLatin1("[class "), t->name()); return core->concatStrings(s, core->newConstantStringLatin1("]")); }
/** * Object.prototype.toString() */ Stringp ObjectClass::_toString(Atom thisAtom) { AvmCore* core = this->core(); if (AvmCore::isObject(thisAtom)) { return AvmCore::atomToScriptObject(thisAtom)->implToString(); } else { Traits* t = toplevel()->toTraits(thisAtom); Stringp s = core->concatStrings(core->newConstantStringLatin1("[object "), t->name()); return core->concatStrings(s, core->newConstantStringLatin1("]")); } }
/** * Object.prototype.toString() */ Stringp ObjectClass::_toString(Atom thisAtom) { AvmCore* core = this->core(); if (core->istype(thisAtom, CLASS_TYPE)) { ClassClosure *cc = (ClassClosure *)AvmCore::atomToScriptObject(thisAtom); Traits* t = cc->ivtable()->traits; Stringp s = core->concatStrings(core->newString("[class "), t->name); return core->concatStrings(s, core->newString("]")); } else { Traits* t = toplevel()->toTraits(thisAtom); Stringp s = core->concatStrings(core->newString("[object "), t->name); return core->concatStrings(s, core->newString("]")); } }
static Stringp getStackTraceLine(MethodInfo* method, Stringp filename) { AvmCore *core = method->pool()->core; Stringp s = core->newStringLatin1("\tat "); s = core->concatStrings(s, method->format(core)); if (filename) { s = s->appendLatin1("["); s = s->append(filename); s = s->appendLatin1(":"); } return s; }
Stringp FunctionObject::implToString() const { AvmCore* core = this->core(); Stringp s = core->concatStrings(core->newConstantStringLatin1("[object Function-"), core->intToString(_call->method->method_id())); return core->concatStrings(s, core->newConstantStringLatin1("]")); }