Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi for PHP/IDE/Code Editor    [ Add a report in this area ]  
Report #:  112029   Status: Closed
Access Violation with Code Insight when using $.ajax() in JavaScript client page
Project:  HTML5 Builder Build #:  RTM
Version:    5.0 Submitted By:   Morney Plescia
Report Type:  Crash / Data loss / Total failure Date Reported:  1/18/2013 4:04:46 AM
Severity:    Infrequently encountered problem Last Updated: 1/26/2013 8:29:31 PM
Platform:    All platforms Internal Tracking #:  
Resolution: Cannot Reproduce (Resolution Comments) Resolved in Build: : Update 1
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
HTML 5 Builder's code insight generates an Access Violation in a Client Page (consisting of JavaScript), when creating a $.ajax() section in the code.

The AV occurs as soon as the cursor is past the first function(...) definition for one of the $.ajax events.

In other words, the jQuery definition of .ajax() has certain events, such as complete(), error(), etc.

Once an event-handler has been defined, the code-insight starts failing with AV's.

Please check the STEPS section of this QC report for more details.
      
Steps to Reproduce:
1) Create a new CLIENT PAGE in HTML 5 Builder.
2) Create a simple function that contains a .ajax() request as per below.

Code-insight throws Access Violations for any activity in the editor after this function.
==============================
// This is where you can place your Javascript code

function f()
{
  $.ajax ( {
           url: "/action.php",
           data: "action=listusers&username=" + $("#username").val() + "&sessionid=" + $("#sessionid").val(),    
           cache: false,
           async: true,
           timeout: 30000,
           dataType: "json",

           //********** CODE INSIGHT WORKS FINE UP TO HERE **********

           complete : function (jqXHR, textStatus)           //********** CODE INSIGHT FAILS FROM HERE ON **********
                      {

                      },
                      
           error : function (jqXHR, textStatus, errorThrown)
                      {
                        DisplayError (errorThrown, false);
                      },
           success : function (data, textStatus, jqXHR)
                      {
                         if (typeof data==="object")
                         {
                           DisplayUserTable(data);
                         } else
                         {
                           DisplayError ("Failed to retrieve user information", false);
                         }
                      }
         });
        
}
==============================
Workarounds
None
Attachment
h5builder_av_code_completion.zip
Comments

Tomohiro Takahashi at 1/19/2013 8:28:05 PM -
I tried to reproduce your issue with Update 1(Build No: 5.1.167.137). But, I can not.

When you press CTRL+SPACE at Line#17, does AV occur?

Morney Plescia at 1/26/2013 2:51:27 AM -
You are correct - it does not happen with Update 1.

I have (RAD Studio) Professional Version at home which includes HTML5 Builder Update 1 and Enterprise at the office: the one at the office needs to be updated.

Thank you and my apologies for the delay in getting back to you.

Tomohiro Takahashi at 1/26/2013 8:30:58 PM -
I guess your issue same as QC#108864, which was fixed with Update 1.

Morney Plescia at 2/10/2013 11:35:47 PM -
Hi - yes, it seems indeed that it was the same.

I have updated all my installations and the issue has gone - problem definitely resolved in update 1.

Server Response from: ETNACODE01