Use `outputVar` instead of hard coding `this.output` in JS codegen
When generating the JS Thrift clients, it hard-codes this.output in a few places; however, if gen_node_ is true, our variable should be output instead. We set a variable, outputVar, up on line 1968/1970 of the file, but don't use it everywhere. In NodeJS environment, this can lead to the wrong flush being called, which can lead to issues; for example, with the header transport protocol, the headers can either go missing or be sent incorrectly.
I believe this is a trivial change not requiring a ticket.
- [ ] Did you create an Apache Jira ticket? (Request account here, not required for trivial changes)
- [ ] ~If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?~
- [x] Did you squash your changes to a single commit? (not required, but preferred)
- [x] Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
- [ ] ~If your change does not involve any code, include
[skip ci]anywhere in the commit message to free up build resources.~
CI is failing for this, but I'm incredibly unsure why or what's going wrong here. I'd greatly appreciate any assistance that folks could provide on this!
EDIT: Yeah, Java's failing, but this doesn't touch the Java code o_o
Please:
- Create a JIRA ticket to describe the issue (with what's the current generated code and what should be the correct code)
- Resolve the merge conflicts (java failing should be fixed on latest master version)
- Create an unit test under
lib/nodejs/test/(or maybelib/js/test/?) to verify this fix