You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Martin Hejnfelt (JIRA)" <ji...@apache.org> on 2017/04/07 09:29:42 UTC

[jira] [Closed] (THRIFT-4132) Generated JavaScript code is missing a undefined check

     [ https://issues.apache.org/jira/browse/THRIFT-4132?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Hejnfelt closed THRIFT-4132.
-----------------------------------
    Resolution: Invalid

This bug ticket is wrong, and simply due to a missing include and my missing knowledge about how javascript engines inform about undefined objects or whatever we call them.

> 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)