Files
linguist/samples/JavaScript/gen-js-linguist-thrift.js
Vighnesh Rege 6d2aa601cd Added tests
2015-05-12 12:53:59 -07:00

61 lines
1.2 KiB
JavaScript

//
// Autogenerated by Thrift Compiler (1.0.0-dev)
//
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
//
PullRequest = function(args) {
this.title = null;
if (args) {
if (args.title !== undefined) {
this.title = args.title;
}
}
};
PullRequest.prototype = {};
PullRequest.prototype.read = function(input) {
input.readStructBegin();
while (true)
{
var ret = input.readFieldBegin();
var fname = ret.fname;
var ftype = ret.ftype;
var fid = ret.fid;
if (ftype == Thrift.Type.STOP) {
break;
}
switch (fid)
{
case 1:
if (ftype == Thrift.Type.STRING) {
this.title = input.readString().value;
} else {
input.skip(ftype);
}
break;
case 0:
input.skip(ftype);
break;
default:
input.skip(ftype);
}
input.readFieldEnd();
}
input.readStructEnd();
return;
};
PullRequest.prototype.write = function(output) {
output.writeStructBegin('PullRequest');
if (this.title !== null && this.title !== undefined) {
output.writeFieldBegin('title', Thrift.Type.STRING, 1);
output.writeString(this.title);
output.writeFieldEnd();
}
output.writeFieldStop();
output.writeStructEnd();
return;
};