thqby / ahk2_lib

MIT License
197 stars 26 forks source link

JSON.Parse as_map FALSE throws an error yet #20

Closed aliztori closed 1 year ago

aliztori commented 1 year ago
    str  := JSON.stringify({ a: { m1: "v1", m2: "v2" } })

    obj1 := JSON.Parse(str, 0, 0)
    MsgBox type(obj1)

Debug:

Error: This value of type "Object" has no property named "__Item".

    ---- T:\Programming\AutoHotkey\ahk-v2\Lib\Extensions\JSON.ahk
    036: If !A && !V
    037: Throw Error("Malformed JSON - missing key.", 0, t)
▶   038: C := A_LoopField = "[" ? [] : maptype(), A ? D[L].Push(C) : D[L][K] := C, D.Has(++L) ? D[L] := C : D.Push(C), V := "", A := Type(C) = "Array"
    039: Continue
    040: }