thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Hejnfelt (JIRA)" <j...@apache.org>
Subject [jira] [Created] (THRIFT-4132) Generated JavaScript code is missing a undefined check
Date Fri, 24 Mar 2017 14:45:41 GMT
Martin Hejnfelt created THRIFT-4132:
---------------------------------------

             Summary: Generated JavaScript code is missing a undefined check
                 Key: THRIFT-4132
                 URL: https://issues.apache.org/jira/browse/THRIFT-4132
             Project: Thrift
          Issue Type: Bug
          Components: JSON - Compiler
    Affects Versions: 0.10.0
         Environment: All
            Reporter: Martin Hejnfelt


The generated code of a *_result object can take an "args" argument to its "constructor".
However, at least when using WebSocket, the *_result object is not passed an "args" parameter,
hence args is undefined. However the code still makes an instanceof test on args, causing
an exception to be thrown at least on newer browsers (Tested on Chrome 57 and Firefox 52).
Adding an "args !== undefined &&" in front of this, makes everything work nicely again.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message