G33kDude / cJson.ahk

AutoHotkey JSON library using embedded C for high performance
https://www.autohotkey.com/boards/viewtopic.php?f=6&p=408453
MIT License
80 stars 8 forks source link

Case conversion error #2

Closed telppa closed 1 year ago

telppa commented 2 years ago
a=
(
{
    "char": {
        "*LPSTR": 0,
        "*PCHAR": 0,
        "*PSTR": 0,
        "CCHAR": 0,
        "CHAR": 0
    }
}
)

aa:=json.load(a)

for k, v in aa
    MsgBox, % k     ; should be char, but it shows CHAR

ExitApp

#Include <json>
G33kDude commented 2 years ago

This appears to be a bug with AHK, please file a report over in the bugs forum:

js =
(
<script>
function test(Object) {
    var outer = Object();
    var inner = Object();
    inner["TEST"] = 1;
    outer["test"] = inner;
    return outer;
}
</script>
)

doc := ComObjCreate("htmlfile")
doc.Write(js)
doc.Close()

outer := doc.parentWindow.test(Func("Object"))

outer._NewEnum().Next(k1, inner)
inner._NewEnum().Next(k2, v2)
MsgBox, {"%k1%": {"%k2%": "%v2%"}} ; shows {"TEST": {"TEST": "1"}}
telppa commented 2 years ago

This appears to be a bug with AHK, please file a report over in the bugs forum:

js =
(
<script>
function test(Object) {
  var outer = Object();
  var inner = Object();
  inner["TEST"] = 1;
  outer["test"] = inner;
  return outer;
}
</script>
)

doc := ComObjCreate("htmlfile")
doc.Write(js)
doc.Close()

outer := doc.parentWindow.test(Func("Object"))

outer._NewEnum().Next(k1, inner)
inner._NewEnum().Next(k2, v2)
MsgBox, {"%k1%": {"%k2%": "%v2%"}} ; shows {"TEST": {"TEST": "1"}}

I didn't understand the code, maybe you can report bugs in the forum?

G33kDude commented 2 years ago

Being tracked at https://www.autohotkey.com/boards/viewtopic.php?f=14&t=100622

G33kDude commented 1 year ago

This has been fixed in the AHK interpreter.