break;
QString key = name.toQString();
- result.insert(key, toJsonValue(v, visitedObjects));
+ if (!v.asFunctionObject())
+ result.insert(key, toJsonValue(v, visitedObjects));
}
visitedObjects.remove(o);
quint32 length = a->arrayLength();
for (quint32 i = 0; i < length; ++i) {
Value v = a->getIndexed(i);
- result.append(toJsonValue(v, visitedObjects));
+ result.append(toJsonValue(v.asFunctionObject() ? QV4::Value::nullValue() : v, visitedObjects));
}
visitedObjects.remove(a);
QTest::newRow("object = object with function property")
<< "object" << "{ foo: function() {} }" << "{}";
QTest::newRow("array = array with function property")
- << "array" << "[function() {}]" << "[]";
+ << "array" << "[function() {}]" << "[null]";
// Inherited properties should not be included.
QTest::newRow("value = object with inherited property")