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

`Subscript out of range` on `class_terminate` #19

Closed Ryansoldier closed 7 years ago

Ryansoldier commented 8 years ago

Hello,

I just discover your project, looks very nice but when I want to test to see if I can use it, I have 1 error when I load your test page:

0x800a0009 - Microsoft VBScript runtime error: Subscript out of range: 'i_items'

And debugger shows error on set i_items(i) = nothing here :

    private sub class_terminate
        dim i
        for i = 0 to ubound(i_items)
            set i_items(i) = nothing
        next
    end sub

Regards, Ryan

rcdmk commented 8 years ago

Hi. I've done some tests this days and haven't got this error. Are you running the latest version? Are you running this on IIS?

Aside from this questions, I should take a look at this soon.

Thank you.

Ryansoldier commented 8 years ago

Hello, Yes it's the latest version (at this date). Yes I've executed it in a simple web project hosted on IIS.

But I've just found the solution to avoid/reproduce it. It's because in my applicationhost.config file, I added properties to enable debugging : Default configuration :

<asp scriptErrorSentToBrowser="true">
    <cache diskTemplateCacheDirectory="%TEMP%\iisexpress\ASP Compiled Templates" />
    <limits />
</asp>

Mine :

<asp scriptErrorSentToBrowser="true" enableParentPaths="true" bufferingOn="true" errorsToNTLog="true" appAllowDebugging="true" appAllowClientDebug="true">
    <cache diskTemplateCacheDirectory="%TEMP%\iisexpress\ASP Compiled Templates" />
    <session allowSessionState="true" />
    <limits />
</asp>

So you can reproduce this problem if you add : appAllowDebugging="true" appAllowClientDebug="true" (I think).

So, normally this problem occurs always but without blocking alert, but I don't understand why.

Here a screenshot of this error when I enable debugging : https://cloud.githubusercontent.com/assets/19835289/15931186/ee3609e2-2e56-11e6-8c55-76981a433828.png

rcdmk commented 8 years ago

Hum... Now I see. This doesn't came to the user, since the page is sent to the browser before it happens. You get this error because you are debugging the IIS process.

I should fix this on the next release.

rcdmk commented 8 years ago

Please, can you confirm if this is still occurring?

Ryansoldier commented 8 years ago

Hello, Yes indeed, except when I update my applicationhost.config file.

rcdmk commented 8 years ago

I've done some adjustments to the develop branch. Can you test if this is fixed there, please?