Update monster_test_generated.js baseline after rebase

This commit is contained in:
Evan Wallace 2015-10-14 21:25:16 -07:00
parent c3bfefca57
commit 79222bf100
3 changed files with 52 additions and 3 deletions

View File

@ -579,8 +579,11 @@ static void GenStruct(const Parser &parser, StructDef &struct_def,
code += " builder.startVector(" + NumToString(elem_size);
code += ", data.length, " + NumToString(alignment) + ");\n";
code += " for (var i = data.length - 1; i >= 0; i--) {\n";
code += " builder.add" + GenWriteMethod(vector_type);
code += "(data[i]);\n";
code += " builder.add" + GenWriteMethod(vector_type) + "(";
if (vector_type.base_type == BASE_TYPE_BOOL) {
code += "+";
}
code += "data[i]);\n";
code += " }\n";
code += " return builder.endVector();\n";
code += "};\n\n";

Binary file not shown.

View File

@ -631,11 +631,28 @@ MyGame.Example.Monster.prototype.testhashu64Fnv1a = function() {
return offset ? this.bb.readUint64(this.bb_pos + offset) : flatbuffers.Long.ZERO;
};
/**
* @param {number} index
* @returns {boolean}
*/
MyGame.Example.Monster.prototype.testarrayofbools = function(index) {
var offset = this.bb.__offset(this.bb_pos, 52);
return offset ? !!this.bb.readInt8(this.bb.__vector(this.bb_pos + offset) + index) : false;
};
/**
* @returns {number}
*/
MyGame.Example.Monster.prototype.testarrayofboolsLength = function() {
var offset = this.bb.__offset(this.bb_pos, 52);
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
};
/**
* @param {flatbuffers.Builder} builder
*/
MyGame.Example.Monster.startMonster = function(builder) {
builder.startObject(24);
builder.startObject(25);
};
/**
@ -914,6 +931,35 @@ MyGame.Example.Monster.addTesthashu64Fnv1a = function(builder, testhashu64Fnv1a)
builder.addFieldInt64(23, testhashu64Fnv1a, flatbuffers.Long.ZERO);
};
/**
* @param {flatbuffers.Builder} builder
* @param {flatbuffers.Offset} testarrayofboolsOffset
*/
MyGame.Example.Monster.addTestarrayofbools = function(builder, testarrayofboolsOffset) {
builder.addFieldOffset(24, testarrayofboolsOffset, 0);
};
/**
* @param {flatbuffers.Builder} builder
* @param {Array.<boolean>} data
* @returns {flatbuffers.Offset}
*/
MyGame.Example.Monster.createTestarrayofboolsVector = function(builder, data) {
builder.startVector(1, data.length, 1);
for (var i = data.length - 1; i >= 0; i--) {
builder.addInt8(+data[i]);
}
return builder.endVector();
};
/**
* @param {flatbuffers.Builder} builder
* @param {number} numElems
*/
MyGame.Example.Monster.startTestarrayofboolsVector = function(builder, numElems) {
builder.startVector(1, numElems, 1);
};
/**
* @param {flatbuffers.Builder} builder
* @returns {flatbuffers.Offset}