Uploaded image for project: 'Arquillian Graphene'
  1. Arquillian Graphene
  2. ARQGRA-455

Guarded XHR2 request fails when its onload callback is JQuery proxy

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.0.3.Final
    • Fix Version/s: 2.0.4.Final
    • Component/s: core
    • Labels:
      None

      Description

      If Graphene is guarding an AJAX request, which onload callback is JQUery proxy, then it fails. There is a problem with arguments passing.

      XHR2 request:

      function makeXHR2() {
              var xhr = new XMLHttpRequest();
              xhr.open("GET", "sample1.html", true);
              xhr.responseType = 'text';
                      
              xhr.onload = $.proxy(function (e) {
                    switch (e.target.status) {
                            case 200:
                                 console.log('HTTP 200');
                                 break;
                            default:
                                  console.log('HTTP 500');
                    }
                          
                    var responseContext = {
                    }
               }, this);
                          
               xhr.send(null);
      }
      

      In browser console there is an error that states:

      e.target is undefined
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  okiss Oliver Kišš
                  Reporter:
                  jhuska Juraj Húska
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: