Fix #3773: Generated JS now avoids the flatbuffers object

This commit is contained in:
Evan Wallace
2016-02-25 01:06:16 -08:00
parent 959866b848
commit 31b30335f6
4 changed files with 98 additions and 21 deletions

View File

@@ -300,7 +300,7 @@ MyGame.Example.Stat.prototype.id = function(optionalEncoding) {
*/
MyGame.Example.Stat.prototype.val = function() {
var offset = this.bb.__offset(this.bb_pos, 6);
return offset ? this.bb.readInt64(this.bb_pos + offset) : flatbuffers.Long.ZERO;
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
};
/**
@@ -331,7 +331,7 @@ MyGame.Example.Stat.addId = function(builder, idOffset) {
* @param {flatbuffers.Long} val
*/
MyGame.Example.Stat.addVal = function(builder, val) {
builder.addFieldInt64(1, val, flatbuffers.Long.ZERO);
builder.addFieldInt64(1, val, builder.createLong(0, 0));
};
/**
@@ -593,7 +593,7 @@ MyGame.Example.Monster.prototype.testhashu32Fnv1 = function() {
*/
MyGame.Example.Monster.prototype.testhashs64Fnv1 = function() {
var offset = this.bb.__offset(this.bb_pos, 40);
return offset ? this.bb.readInt64(this.bb_pos + offset) : flatbuffers.Long.ZERO;
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
};
/**
@@ -601,7 +601,7 @@ MyGame.Example.Monster.prototype.testhashs64Fnv1 = function() {
*/
MyGame.Example.Monster.prototype.testhashu64Fnv1 = function() {
var offset = this.bb.__offset(this.bb_pos, 42);
return offset ? this.bb.readUint64(this.bb_pos + offset) : flatbuffers.Long.ZERO;
return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0);
};
/**
@@ -625,7 +625,7 @@ MyGame.Example.Monster.prototype.testhashu32Fnv1a = function() {
*/
MyGame.Example.Monster.prototype.testhashs64Fnv1a = function() {
var offset = this.bb.__offset(this.bb_pos, 48);
return offset ? this.bb.readInt64(this.bb_pos + offset) : flatbuffers.Long.ZERO;
return offset ? this.bb.readInt64(this.bb_pos + offset) : this.bb.createLong(0, 0);
};
/**
@@ -633,7 +633,7 @@ MyGame.Example.Monster.prototype.testhashs64Fnv1a = function() {
*/
MyGame.Example.Monster.prototype.testhashu64Fnv1a = function() {
var offset = this.bb.__offset(this.bb_pos, 50);
return offset ? this.bb.readUint64(this.bb_pos + offset) : flatbuffers.Long.ZERO;
return offset ? this.bb.readUint64(this.bb_pos + offset) : this.bb.createLong(0, 0);
};
/**
@@ -893,7 +893,7 @@ MyGame.Example.Monster.addTesthashu32Fnv1 = function(builder, testhashu32Fnv1) {
* @param {flatbuffers.Long} testhashs64Fnv1
*/
MyGame.Example.Monster.addTesthashs64Fnv1 = function(builder, testhashs64Fnv1) {
builder.addFieldInt64(18, testhashs64Fnv1, flatbuffers.Long.ZERO);
builder.addFieldInt64(18, testhashs64Fnv1, builder.createLong(0, 0));
};
/**
@@ -901,7 +901,7 @@ MyGame.Example.Monster.addTesthashs64Fnv1 = function(builder, testhashs64Fnv1) {
* @param {flatbuffers.Long} testhashu64Fnv1
*/
MyGame.Example.Monster.addTesthashu64Fnv1 = function(builder, testhashu64Fnv1) {
builder.addFieldInt64(19, testhashu64Fnv1, flatbuffers.Long.ZERO);
builder.addFieldInt64(19, testhashu64Fnv1, builder.createLong(0, 0));
};
/**
@@ -925,7 +925,7 @@ MyGame.Example.Monster.addTesthashu32Fnv1a = function(builder, testhashu32Fnv1a)
* @param {flatbuffers.Long} testhashs64Fnv1a
*/
MyGame.Example.Monster.addTesthashs64Fnv1a = function(builder, testhashs64Fnv1a) {
builder.addFieldInt64(22, testhashs64Fnv1a, flatbuffers.Long.ZERO);
builder.addFieldInt64(22, testhashs64Fnv1a, builder.createLong(0, 0));
};
/**
@@ -933,7 +933,7 @@ MyGame.Example.Monster.addTesthashs64Fnv1a = function(builder, testhashs64Fnv1a)
* @param {flatbuffers.Long} testhashu64Fnv1a
*/
MyGame.Example.Monster.addTesthashu64Fnv1a = function(builder, testhashu64Fnv1a) {
builder.addFieldInt64(23, testhashu64Fnv1a, flatbuffers.Long.ZERO);
builder.addFieldInt64(23, testhashu64Fnv1a, builder.createLong(0, 0));
};
/**