THRIFT-4653: ES6 classes support (#1615)
* ES6 classes support
* Lint generated code
* ES6 Tests for NodeJS
* Add eslint rules for nodejs
* Run prettier/eslint on nodejs test code
diff --git a/lib/nodejs/test/helpers.js b/lib/nodejs/test/helpers.js
index 5f828b3..72d128d 100644
--- a/lib/nodejs/test/helpers.js
+++ b/lib/nodejs/test/helpers.js
@@ -17,16 +17,21 @@
* under the License.
*/
-'use strict';
-var thrift = require('../lib/thrift');
+"use strict";
+const thrift = require("../lib/thrift");
module.exports.transports = {
- 'buffered': thrift.TBufferedTransport,
- 'framed': thrift.TFramedTransport
+ buffered: thrift.TBufferedTransport,
+ framed: thrift.TFramedTransport
};
module.exports.protocols = {
- 'json': thrift.TJSONProtocol,
- 'binary': thrift.TBinaryProtocol,
- 'compact': thrift.TCompactProtocol
+ json: thrift.TJSONProtocol,
+ binary: thrift.TBinaryProtocol,
+ compact: thrift.TCompactProtocol
};
+
+module.exports.ecmaMode = process.argv.includes("--es6") ? "es6" : "es5";
+module.exports.genPath = process.argv.includes("--es6")
+ ? "gen-nodejs-es6"
+ : "gen-nodejs";