Change-Id: I02b00b22cdd2d1bd32de3273ff69185c9b0f4e5b
This commit is contained in:
Wouter van Oortmerssen 2016-11-21 15:20:33 -08:00
commit d342918790
7 changed files with 70 additions and 62 deletions

1
.gitignore vendored
View File

@ -65,3 +65,4 @@ build/VS2010/FlatBuffers.sdf
build/VS2010/FlatBuffers.opensdf build/VS2010/FlatBuffers.opensdf
build/VS2010/ipch/**/*.ipch build/VS2010/ipch/**/*.ipch
*.so *.so
Testing/Temporary

View File

@ -593,6 +593,10 @@ class FlatbufferBuilder
protected function is_utf8($bytes) protected function is_utf8($bytes)
{ {
if (function_exists('mb_detect_encoding')) {
return (bool) mb_detect_encoding($bytes, 'UTF-8', true);
}
$len = strlen($bytes); $len = strlen($bytes);
if ($len < 1) { if ($len < 1) {
/* NOTE: always return 1 when passed string is null */ /* NOTE: always return 1 when passed string is null */

View File

@ -557,13 +557,13 @@ void GenStruct(const Parser &parser, StructDef &struct_def, std::string *code_pt
"@returns {boolean}"); "@returns {boolean}");
code += object_name + ".prototype.mutate_" + field.name + " = function(value) {\n"; code += object_name + ".prototype.mutate_" + field.name + " = function(value) {\n";
code += " var offset = this.bb.__offset(this.bb_pos, " + NumToString(field.value.offset) + ")\n\n"; code += " var offset = this.bb.__offset(this.bb_pos, " + NumToString(field.value.offset) + ");\n\n";
code += " if (offset === 0) {\n"; code += " if (offset === 0) {\n";
code += " return false;\n"; code += " return false;\n";
code += " }\n\n"; code += " }\n\n";
code += " this.bb.write" + MakeCamel(GenType(field.value.type)) + "(this.bb_pos + offset, value);\n"; code += " this.bb.write" + MakeCamel(GenType(field.value.type)) + "(this.bb_pos + offset, value);\n";
code += " return true;\n"; code += " return true;\n";
code += "}\n\n"; code += "};\n\n";
} }
// Emit vector helpers // Emit vector helpers

View File

@ -1758,6 +1758,9 @@ CheckedError Parser::SkipAnyJsonValue() {
case kTokenFloatConstant: case kTokenFloatConstant:
EXPECT(kTokenFloatConstant); EXPECT(kTokenFloatConstant);
break; break;
case kTokenNull:
EXPECT(kTokenNull);
break;
default: default:
return Error(std::string("Unexpected token:") + std::string(1, static_cast<char>(token_))); return Error(std::string("Unexpected token:") + std::string(1, static_cast<char>(token_)));
} }

View File

@ -132,7 +132,7 @@ MyGame.Example.Test.prototype.a = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Test.prototype.mutate_a = function(value) { MyGame.Example.Test.prototype.mutate_a = function(value) {
var offset = this.bb.__offset(this.bb_pos, 0) var offset = this.bb.__offset(this.bb_pos, 0);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -140,7 +140,7 @@ MyGame.Example.Test.prototype.mutate_a = function(value) {
this.bb.writeInt16(this.bb_pos + offset, value); this.bb.writeInt16(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -154,7 +154,7 @@ MyGame.Example.Test.prototype.b = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Test.prototype.mutate_b = function(value) { MyGame.Example.Test.prototype.mutate_b = function(value) {
var offset = this.bb.__offset(this.bb_pos, 2) var offset = this.bb.__offset(this.bb_pos, 2);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -162,7 +162,7 @@ MyGame.Example.Test.prototype.mutate_b = function(value) {
this.bb.writeInt8(this.bb_pos + offset, value); this.bb.writeInt8(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {flatbuffers.Builder} builder * @param {flatbuffers.Builder} builder
@ -226,7 +226,7 @@ MyGame.Example.TestSimpleTableWithEnum.prototype.color = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.TestSimpleTableWithEnum.prototype.mutate_color = function(value) { MyGame.Example.TestSimpleTableWithEnum.prototype.mutate_color = function(value) {
var offset = this.bb.__offset(this.bb_pos, 4) var offset = this.bb.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -234,7 +234,7 @@ MyGame.Example.TestSimpleTableWithEnum.prototype.mutate_color = function(value)
this.bb.writeInt8(this.bb_pos + offset, value); this.bb.writeInt8(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {flatbuffers.Builder} builder * @param {flatbuffers.Builder} builder
@ -298,7 +298,7 @@ MyGame.Example.Vec3.prototype.x = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Vec3.prototype.mutate_x = function(value) { MyGame.Example.Vec3.prototype.mutate_x = function(value) {
var offset = this.bb.__offset(this.bb_pos, 0) var offset = this.bb.__offset(this.bb_pos, 0);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -306,7 +306,7 @@ MyGame.Example.Vec3.prototype.mutate_x = function(value) {
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb.writeFloat32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -320,7 +320,7 @@ MyGame.Example.Vec3.prototype.y = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Vec3.prototype.mutate_y = function(value) { MyGame.Example.Vec3.prototype.mutate_y = function(value) {
var offset = this.bb.__offset(this.bb_pos, 4) var offset = this.bb.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -328,7 +328,7 @@ MyGame.Example.Vec3.prototype.mutate_y = function(value) {
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb.writeFloat32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -342,7 +342,7 @@ MyGame.Example.Vec3.prototype.z = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Vec3.prototype.mutate_z = function(value) { MyGame.Example.Vec3.prototype.mutate_z = function(value) {
var offset = this.bb.__offset(this.bb_pos, 8) var offset = this.bb.__offset(this.bb_pos, 8);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -350,7 +350,7 @@ MyGame.Example.Vec3.prototype.mutate_z = function(value) {
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb.writeFloat32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -364,7 +364,7 @@ MyGame.Example.Vec3.prototype.test1 = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Vec3.prototype.mutate_test1 = function(value) { MyGame.Example.Vec3.prototype.mutate_test1 = function(value) {
var offset = this.bb.__offset(this.bb_pos, 16) var offset = this.bb.__offset(this.bb_pos, 16);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -372,7 +372,7 @@ MyGame.Example.Vec3.prototype.mutate_test1 = function(value) {
this.bb.writeFloat64(this.bb_pos + offset, value); this.bb.writeFloat64(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {MyGame.Example.Color} * @returns {MyGame.Example.Color}
@ -386,7 +386,7 @@ MyGame.Example.Vec3.prototype.test2 = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Vec3.prototype.mutate_test2 = function(value) { MyGame.Example.Vec3.prototype.mutate_test2 = function(value) {
var offset = this.bb.__offset(this.bb_pos, 24) var offset = this.bb.__offset(this.bb_pos, 24);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -394,7 +394,7 @@ MyGame.Example.Vec3.prototype.mutate_test2 = function(value) {
this.bb.writeInt8(this.bb_pos + offset, value); this.bb.writeInt8(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {MyGame.Example.Test=} obj * @param {MyGame.Example.Test=} obj
@ -489,7 +489,7 @@ MyGame.Example.Stat.prototype.val = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Stat.prototype.mutate_val = function(value) { MyGame.Example.Stat.prototype.mutate_val = function(value) {
var offset = this.bb.__offset(this.bb_pos, 6) var offset = this.bb.__offset(this.bb_pos, 6);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -497,7 +497,7 @@ MyGame.Example.Stat.prototype.mutate_val = function(value) {
this.bb.writeInt64(this.bb_pos + offset, value); this.bb.writeInt64(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -512,7 +512,7 @@ MyGame.Example.Stat.prototype.count = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Stat.prototype.mutate_count = function(value) { MyGame.Example.Stat.prototype.mutate_count = function(value) {
var offset = this.bb.__offset(this.bb_pos, 8) var offset = this.bb.__offset(this.bb_pos, 8);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -520,7 +520,7 @@ MyGame.Example.Stat.prototype.mutate_count = function(value) {
this.bb.writeUint16(this.bb_pos + offset, value); this.bb.writeUint16(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {flatbuffers.Builder} builder * @param {flatbuffers.Builder} builder
@ -629,7 +629,7 @@ MyGame.Example.Monster.prototype.mana = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_mana = function(value) { MyGame.Example.Monster.prototype.mutate_mana = function(value) {
var offset = this.bb.__offset(this.bb_pos, 6) var offset = this.bb.__offset(this.bb_pos, 6);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -637,7 +637,7 @@ MyGame.Example.Monster.prototype.mutate_mana = function(value) {
this.bb.writeInt16(this.bb_pos + offset, value); this.bb.writeInt16(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -652,7 +652,7 @@ MyGame.Example.Monster.prototype.hp = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_hp = function(value) { MyGame.Example.Monster.prototype.mutate_hp = function(value) {
var offset = this.bb.__offset(this.bb_pos, 8) var offset = this.bb.__offset(this.bb_pos, 8);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -660,7 +660,7 @@ MyGame.Example.Monster.prototype.mutate_hp = function(value) {
this.bb.writeInt16(this.bb_pos + offset, value); this.bb.writeInt16(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {flatbuffers.Encoding=} optionalEncoding * @param {flatbuffers.Encoding=} optionalEncoding
@ -709,7 +709,7 @@ MyGame.Example.Monster.prototype.color = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_color = function(value) { MyGame.Example.Monster.prototype.mutate_color = function(value) {
var offset = this.bb.__offset(this.bb_pos, 16) var offset = this.bb.__offset(this.bb_pos, 16);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -717,7 +717,7 @@ MyGame.Example.Monster.prototype.mutate_color = function(value) {
this.bb.writeInt8(this.bb_pos + offset, value); this.bb.writeInt8(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {MyGame.Example.Any} * @returns {MyGame.Example.Any}
@ -732,7 +732,7 @@ MyGame.Example.Monster.prototype.testType = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_test_type = function(value) { MyGame.Example.Monster.prototype.mutate_test_type = function(value) {
var offset = this.bb.__offset(this.bb_pos, 18) var offset = this.bb.__offset(this.bb_pos, 18);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -740,7 +740,7 @@ MyGame.Example.Monster.prototype.mutate_test_type = function(value) {
this.bb.writeUint8(this.bb_pos + offset, value); this.bb.writeUint8(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {flatbuffers.Table} obj * @param {flatbuffers.Table} obj
@ -864,7 +864,7 @@ MyGame.Example.Monster.prototype.testbool = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_testbool = function(value) { MyGame.Example.Monster.prototype.mutate_testbool = function(value) {
var offset = this.bb.__offset(this.bb_pos, 34) var offset = this.bb.__offset(this.bb_pos, 34);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -872,7 +872,7 @@ MyGame.Example.Monster.prototype.mutate_testbool = function(value) {
this.bb.writeInt8(this.bb_pos + offset, value); this.bb.writeInt8(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -887,7 +887,7 @@ MyGame.Example.Monster.prototype.testhashs32Fnv1 = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_testhashs32_fnv1 = function(value) { MyGame.Example.Monster.prototype.mutate_testhashs32_fnv1 = function(value) {
var offset = this.bb.__offset(this.bb_pos, 36) var offset = this.bb.__offset(this.bb_pos, 36);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -895,7 +895,7 @@ MyGame.Example.Monster.prototype.mutate_testhashs32_fnv1 = function(value) {
this.bb.writeInt32(this.bb_pos + offset, value); this.bb.writeInt32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -910,7 +910,7 @@ MyGame.Example.Monster.prototype.testhashu32Fnv1 = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_testhashu32_fnv1 = function(value) { MyGame.Example.Monster.prototype.mutate_testhashu32_fnv1 = function(value) {
var offset = this.bb.__offset(this.bb_pos, 38) var offset = this.bb.__offset(this.bb_pos, 38);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -918,7 +918,7 @@ MyGame.Example.Monster.prototype.mutate_testhashu32_fnv1 = function(value) {
this.bb.writeUint32(this.bb_pos + offset, value); this.bb.writeUint32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {flatbuffers.Long} * @returns {flatbuffers.Long}
@ -933,7 +933,7 @@ MyGame.Example.Monster.prototype.testhashs64Fnv1 = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_testhashs64_fnv1 = function(value) { MyGame.Example.Monster.prototype.mutate_testhashs64_fnv1 = function(value) {
var offset = this.bb.__offset(this.bb_pos, 40) var offset = this.bb.__offset(this.bb_pos, 40);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -941,7 +941,7 @@ MyGame.Example.Monster.prototype.mutate_testhashs64_fnv1 = function(value) {
this.bb.writeInt64(this.bb_pos + offset, value); this.bb.writeInt64(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {flatbuffers.Long} * @returns {flatbuffers.Long}
@ -956,7 +956,7 @@ MyGame.Example.Monster.prototype.testhashu64Fnv1 = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_testhashu64_fnv1 = function(value) { MyGame.Example.Monster.prototype.mutate_testhashu64_fnv1 = function(value) {
var offset = this.bb.__offset(this.bb_pos, 42) var offset = this.bb.__offset(this.bb_pos, 42);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -964,7 +964,7 @@ MyGame.Example.Monster.prototype.mutate_testhashu64_fnv1 = function(value) {
this.bb.writeUint64(this.bb_pos + offset, value); this.bb.writeUint64(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -979,7 +979,7 @@ MyGame.Example.Monster.prototype.testhashs32Fnv1a = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_testhashs32_fnv1a = function(value) { MyGame.Example.Monster.prototype.mutate_testhashs32_fnv1a = function(value) {
var offset = this.bb.__offset(this.bb_pos, 44) var offset = this.bb.__offset(this.bb_pos, 44);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -987,7 +987,7 @@ MyGame.Example.Monster.prototype.mutate_testhashs32_fnv1a = function(value) {
this.bb.writeInt32(this.bb_pos + offset, value); this.bb.writeInt32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -1002,7 +1002,7 @@ MyGame.Example.Monster.prototype.testhashu32Fnv1a = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_testhashu32_fnv1a = function(value) { MyGame.Example.Monster.prototype.mutate_testhashu32_fnv1a = function(value) {
var offset = this.bb.__offset(this.bb_pos, 46) var offset = this.bb.__offset(this.bb_pos, 46);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -1010,7 +1010,7 @@ MyGame.Example.Monster.prototype.mutate_testhashu32_fnv1a = function(value) {
this.bb.writeUint32(this.bb_pos + offset, value); this.bb.writeUint32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {flatbuffers.Long} * @returns {flatbuffers.Long}
@ -1025,7 +1025,7 @@ MyGame.Example.Monster.prototype.testhashs64Fnv1a = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_testhashs64_fnv1a = function(value) { MyGame.Example.Monster.prototype.mutate_testhashs64_fnv1a = function(value) {
var offset = this.bb.__offset(this.bb_pos, 48) var offset = this.bb.__offset(this.bb_pos, 48);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -1033,7 +1033,7 @@ MyGame.Example.Monster.prototype.mutate_testhashs64_fnv1a = function(value) {
this.bb.writeInt64(this.bb_pos + offset, value); this.bb.writeInt64(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {flatbuffers.Long} * @returns {flatbuffers.Long}
@ -1048,7 +1048,7 @@ MyGame.Example.Monster.prototype.testhashu64Fnv1a = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_testhashu64_fnv1a = function(value) { MyGame.Example.Monster.prototype.mutate_testhashu64_fnv1a = function(value) {
var offset = this.bb.__offset(this.bb_pos, 50) var offset = this.bb.__offset(this.bb_pos, 50);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -1056,7 +1056,7 @@ MyGame.Example.Monster.prototype.mutate_testhashu64_fnv1a = function(value) {
this.bb.writeUint64(this.bb_pos + offset, value); this.bb.writeUint64(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {number} index * @param {number} index
@ -1096,7 +1096,7 @@ MyGame.Example.Monster.prototype.testf = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_testf = function(value) { MyGame.Example.Monster.prototype.mutate_testf = function(value) {
var offset = this.bb.__offset(this.bb_pos, 54) var offset = this.bb.__offset(this.bb_pos, 54);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -1104,7 +1104,7 @@ MyGame.Example.Monster.prototype.mutate_testf = function(value) {
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb.writeFloat32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -1119,7 +1119,7 @@ MyGame.Example.Monster.prototype.testf2 = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_testf2 = function(value) { MyGame.Example.Monster.prototype.mutate_testf2 = function(value) {
var offset = this.bb.__offset(this.bb_pos, 56) var offset = this.bb.__offset(this.bb_pos, 56);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -1127,7 +1127,7 @@ MyGame.Example.Monster.prototype.mutate_testf2 = function(value) {
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb.writeFloat32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -1142,7 +1142,7 @@ MyGame.Example.Monster.prototype.testf3 = function() {
* @returns {boolean} * @returns {boolean}
*/ */
MyGame.Example.Monster.prototype.mutate_testf3 = function(value) { MyGame.Example.Monster.prototype.mutate_testf3 = function(value) {
var offset = this.bb.__offset(this.bb_pos, 58) var offset = this.bb.__offset(this.bb_pos, 58);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -1150,7 +1150,7 @@ MyGame.Example.Monster.prototype.mutate_testf3 = function(value) {
this.bb.writeFloat32(this.bb_pos + offset, value); this.bb.writeFloat32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {number} index * @param {number} index

View File

@ -69,7 +69,7 @@ NamespaceA.NamespaceB.TableInNestedNS.prototype.foo = function() {
* @returns {boolean} * @returns {boolean}
*/ */
NamespaceA.NamespaceB.TableInNestedNS.prototype.mutate_foo = function(value) { NamespaceA.NamespaceB.TableInNestedNS.prototype.mutate_foo = function(value) {
var offset = this.bb.__offset(this.bb_pos, 4) var offset = this.bb.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -77,7 +77,7 @@ NamespaceA.NamespaceB.TableInNestedNS.prototype.mutate_foo = function(value) {
this.bb.writeInt32(this.bb_pos + offset, value); this.bb.writeInt32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {flatbuffers.Builder} builder * @param {flatbuffers.Builder} builder
@ -141,7 +141,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.a = function() {
* @returns {boolean} * @returns {boolean}
*/ */
NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_a = function(value) { NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_a = function(value) {
var offset = this.bb.__offset(this.bb_pos, 0) var offset = this.bb.__offset(this.bb_pos, 0);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -149,7 +149,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_a = function(value) {
this.bb.writeInt32(this.bb_pos + offset, value); this.bb.writeInt32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
@ -163,7 +163,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.b = function() {
* @returns {boolean} * @returns {boolean}
*/ */
NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_b = function(value) { NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_b = function(value) {
var offset = this.bb.__offset(this.bb_pos, 4) var offset = this.bb.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -171,7 +171,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_b = function(value) {
this.bb.writeInt32(this.bb_pos + offset, value); this.bb.writeInt32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {flatbuffers.Builder} builder * @param {flatbuffers.Builder} builder

View File

@ -75,7 +75,7 @@ NamespaceA.TableInFirstNS.prototype.fooEnum = function() {
* @returns {boolean} * @returns {boolean}
*/ */
NamespaceA.TableInFirstNS.prototype.mutate_foo_enum = function(value) { NamespaceA.TableInFirstNS.prototype.mutate_foo_enum = function(value) {
var offset = this.bb.__offset(this.bb_pos, 6) var offset = this.bb.__offset(this.bb_pos, 6);
if (offset === 0) { if (offset === 0) {
return false; return false;
@ -83,7 +83,7 @@ NamespaceA.TableInFirstNS.prototype.mutate_foo_enum = function(value) {
this.bb.writeInt8(this.bb_pos + offset, value); this.bb.writeInt8(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {NamespaceA.NamespaceB.StructInNestedNS=} obj * @param {NamespaceA.NamespaceB.StructInNestedNS=} obj