You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.
See sciter-sdk/go-sciter#17. In order to get the keys of an sciter object type, one have to use EnumerateKeyValue, because ValueNthElementKey(idx) always returns NULL value.
{
"string":"hello",
"number":123
}
While ValueElementsCount both works on array/map/function and on sciter Object type, should ValueNthElementKey supports all those composit types?
The text was updated successfully, but these errors were encountered:
Script object is an unordered map of name/value pairs so it does not provide indexed access.
Moreover internal implementation of object inside script is pure hash map with collision lists.
Getting nth-element key/value from object is O(N) complex operation. And if you want to do something like this :
for( int n = 0; n < length; ++n)
VALUE k = ValueNthElementKey(obj, idx);
You will get O(N*N) complex operation. I simply don't want even to enable this possibility in API.
Options:
Use ValueIsolate(obj) - after the call all script objects will be converted to JSON dictionaries (that have indexed access by design).
See sciter-sdk/go-sciter#17. In order to get the keys of an sciter object type, one have to use
EnumerateKeyValue
, becauseValueNthElementKey(idx)
always returns NULL value.While
ValueElementsCount
both works onarray/map/function
and on sciterObject
type, shouldValueNthElementKey
supports all those composit types?The text was updated successfully, but these errors were encountered: