本文整理汇总了C++中Toplevel::callproperty方法的典型用法代码示例。如果您正苦于以下问题:C++ Toplevel::callproperty方法的具体用法?C++ Toplevel::callproperty怎么用?C++ Toplevel::callproperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Toplevel
的用法示例。
在下文中一共展示了Toplevel::callproperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toString
// Execute the ToString algorithm as described in ECMA-262 Section 9.8.
// This is ToString(ToPrimitive(input argument, hint String))
// ToPrimitive(input argument, hint String) calls [[DefaultValue]]
// described in ECMA-262 8.6.2.6. The [[DefaultValue]] algorithm
// with hint String is inlined here.
Stringp ScriptObject::toString()
{
AvmCore *core = this->core();
Toplevel* toplevel = this->toplevel();
Atom atomv_out[1];
// call this.toString()
// NOTE use callers versioned public to get correct toString
Multiname tempname(core->findPublicNamespace(), core->ktoString);
atomv_out[0] = atom();
Atom result = toplevel->callproperty(atom(), &tempname, 0, atomv_out, vtable);
// if result is primitive, return its ToString
if (atomKind(result) != kObjectType)
return core->string(result);
// otherwise call this.valueOf()
tempname.setName(core->kvalueOf);
atomv_out[0] = atom();
result = toplevel->callproperty(atom(), &tempname, 0, atomv_out, vtable);
// if result is primitive, return it
if (atomKind(result) != kObjectType)
return core->string(result);
// could not convert to primitive.
toplevel->throwTypeError(kConvertToPrimitiveError, core->toErrorString(traits()));
return NULL; // unreachable
}
示例2: do_abc_callpropx
Atom Stubs::do_abc_callpropx(MethodFrame* f, const Multiname* name, Atom index,
int argc, Atom* args) {
Multiname tempname;
initnamex(core(f), name, index, &tempname);
Toplevel* t = toplevel(f);
return t->callproperty(args[0], &tempname, argc - 1, args,
toVTable(t, args[0]));
}
示例3: do_abc_callprop
Atom Stubs::do_abc_callprop(MethodFrame* f, const Multiname* name, int argc,
Atom* args) {
Toplevel* t = toplevel(f);
return t->callproperty(args[0], name, argc - 1, args, toVTable(t, args[0]));
}
示例4: do_abc_callproplex
Atom Stubs::do_abc_callproplex(MethodFrame* f, const Multiname* name, int argc,
Atom* args) {
Atom base = getBase(args);
Toplevel* t = toplevel(f);
return t->callproperty(base, name, argc - 1, args, toVTable(t, base));
}