Right now, TdwsJSONValue has a default array property of:
Values[const index : Variant] : TdwsJSONValue
This means that any time anyone uses the most intuitive indexing syntax on any
dwsJSON object, "myObj[index]", it will turn the index variable into a Variant,
call GetValue which decodes the variant, and indexes into Items or Names as
appropriate.
JSON arrays are always indexed by ordinal, and JSON objects are always indexed
by name. Knowing this, it would make sense to set Items as the default
property for TdwsJSONObject, and Elements for TdwsJSONArray. This way, when
working with objects that are known at compile-time to be one of those two
classes, the compiler can produce more optimal code without the programmer
having to explicitly specify the appropriate property name.
It will also improve debuggability, because the debugger apparently doesn't
like Variants, and can't evaluate a call to Values.
Original issue reported on code.google.com by masonwhe...@gmail.com on 31 Dec 2012 at 6:22
Original issue reported on code.google.com by
masonwhe...@gmail.com
on 31 Dec 2012 at 6:22