thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (THRIFT-4625) let / const variable decorators for es6 compiler
Date Wed, 29 Aug 2018 02:06:00 GMT

    [ https://issues.apache.org/jira/browse/THRIFT-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16595844#comment-16595844
] 

ASF GitHub Bot commented on THRIFT-4625:
----------------------------------------

jeking3 commented on a change in pull request #1584: THRIFT-4625: Use let/const variable decorators
in ES6 Javascript
URL: https://github.com/apache/thrift/pull/1584#discussion_r213524969
 
 

 ##########
 File path: compiler/cpp/src/thrift/generate/t_js_generator.cc
 ##########
 @@ -860,14 +883,15 @@ void t_js_generator::generate_js_struct_reader(ostream& out, t_struct*
tstruct)
   indent(out) << "input.readStructBegin();" << endl;
 
   // Loop over reading in fields
-  indent(out) << "while (true)" << endl;
+  indent(out) << "while (true) {" << endl;
 
-  scope_up(out);
+  indent_up();
 
-  indent(out) << "var ret = input.readFieldBegin();" << endl;
-  indent(out) << "var fname = ret.fname;" << endl;
 
 Review comment:
   Is fname no longer important?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> let / const variable decorators for es6 compiler
> ------------------------------------------------
>
>                 Key: THRIFT-4625
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4625
>             Project: Thrift
>          Issue Type: Improvement
>          Components: JavaScript - Compiler, Node.js - Compiler
>            Reporter: Brian Forbis
>            Priority: Minor
>
> With support for the ES6 compiler, variables should be scoped using the ES6 *let* and
*const* variable decorators to define variable scoping and read/write behavior.
> This brings the generated code into compliance with the [no-var|https://eslint.org/docs/rules/no-var]
eslint rule.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message