ohos: map only own enumerable JS properties to JSON


QtHarmony::mapJsObjectToQJsonObject() is documented to map the
enumerable properties of a JS object, but on a HarmonyOS device it also
maps non-enumerable ones. The mapping iterates over a Napi::Object,
which takes its keys from napi_get_property_names(), and on that device
the function returns non-enumerable and symbol keys as well.

Even when napi_get_property_names() behaves as documented, it is not
the right source of keys for JSON: it includes inherited properties,
while JSON.stringify() takes only the object's own enumerable ones. On
that device inherited properties are not mapped either, so taking own
keys only changes nothing there.

Map the properties of the object's own enumerable string keys, taken
from QNapi::Object::getFilteredStringKeys().

Task-number: QTBUG-151396
Pick-to: 6.12
Change-Id: Ibb97bc4f2eaa62c04ce90c337a4fe0c6a9604963
Reviewed-by: SanthoshKumar Selvaraj <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Adam Krzykala <adam.krzykala@qt.io>
commitf744a9f43793f1d1a6f99b907b92f08bd073223c
parent1137a810a0061e905f6b19f8b654e44c0ca8651a
authorZbigniew Chyla <zbigniew.chyla@qt.io>
committerZbigniew Chyla <zbigniew.chyla@qt.io>
commit timeTue, 20 Oct 2026 10:41:22 +0000