MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / stringify

Method stringify

src/jsplugin/JSRepl.cpp:79–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79QString JSRepl::stringify(const QJSValue &value)
80{
81 if (value.isArray()) {
82 QStringList items;
83 const int length = value.property("length").toInt();
84 for (int i = 0; i < length; ++i) {
85 QJSValue v = value.property(i);
86 if (v.isArray()) {
87 items << QString("Array(%1)").arg(v.property("length").toInt());
88 } else {
89 items << stringify(v);
90 }
91 }
92 return QString("(%1) [%2]").arg(
93 QString::number(length), items.join(", "));
94 } else if (value.isString()) {
95 return "'" + value.toString() + "'";
96 } else {
97 return value.toString();
98 }
99}
100
101void JSRepl::printResult(const QJSValue &value)
102{

Callers 15

QWebChannelFunction · 0.80
WizOnSelectionChangeFunction · 0.80
wizEditorForMac.jsFile · 0.80
sFunction · 0.80
LeFunction · 0.80
tFunction · 0.80
uFunction · 0.80
eFunction · 0.80
oFunction · 0.80
kity.min.jsFile · 0.80
WizSvgPainter.jsFile · 0.80

Calls 4

isArrayMethod · 0.80
isStringMethod · 0.80
QStringClass · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected