rcdmk / aspJSON

A fast classic ASP JSON parser and encoder for easy JSON manipulation to work with the new JavaScript MV* libraries and frameworks.
MIT License
204 stars 89 forks source link

case sensitivity issue #2

Closed frumbert closed 9 years ago

frumbert commented 11 years ago

Set oJSON = New JSON

is not the same as

Set oJSON = New json

In incJson, code such as

if typeName(elm) = "JSON" then
    set val = elm
elseif typeName(elm) = "JSONarray" then
    val = elm.items

will sometimes fail because the typeName returns the exact case of the object as it was Set! Since once assumes that asp is case insensitive, it can be easy to get the case of the set statement wrong, leading to obscure problems later on.

rcdmk commented 9 years ago

Sorry for the late response.

Thanks for pointing that. I've done some work before seeing that I had some Issues. Somehow I didn't get any e-mail notification.

ASP with VBScript is indeed case insensitive for its names but the TypeName() function would always return the original Type Name case, not the "setted" case.

I've just done an example to test it and all names have the same case, the declared class case:

<%
class TesteComCase
end Class

set teste1 = new TesteComCase
set teste2 = new Testecomcase
set teste3 = new testecomcase

response.write TypeName(teste1)
response.write TypeName(teste2)
response.write TypeName(teste3)
%>

Outputs:

TesteComCase
TesteComCase
TesteComCase