mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-28 04:18:05 +00:00
Allow unions of table types with the same name but from different namespaces.
Also fixed most codegenerators using the wrong namespace when multiple namespace were used in a file, with some files not being generated. Change-Id: Ib42969221239d7244e431cbd667ef69200fc415f Tested: on Linux. Bug: 29338474
This commit is contained in:
@@ -10,6 +10,11 @@ var MyGame = MyGame || {};
|
||||
*/
|
||||
MyGame.Example = MyGame.Example || {};
|
||||
|
||||
/**
|
||||
* @const
|
||||
*/
|
||||
MyGame.Example2 = MyGame.Example2 || {};
|
||||
|
||||
/**
|
||||
* @const
|
||||
*/
|
||||
@@ -30,7 +35,59 @@ MyGame.Example.Color = {
|
||||
MyGame.Example.Any = {
|
||||
NONE: 0,
|
||||
Monster: 1,
|
||||
TestSimpleTableWithEnum: 2
|
||||
TestSimpleTableWithEnum: 2,
|
||||
MyGame_Example2_Monster: 3
|
||||
};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
MyGame.Example2.Monster = function() {
|
||||
/**
|
||||
* @type {flatbuffers.ByteBuffer}
|
||||
*/
|
||||
this.bb = null;
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.bb_pos = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {number} i
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @returns {MyGame.Example2.Monster}
|
||||
*/
|
||||
MyGame.Example2.Monster.prototype.__init = function(i, bb) {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.ByteBuffer} bb
|
||||
* @param {MyGame.Example2.Monster=} obj
|
||||
* @returns {MyGame.Example2.Monster}
|
||||
*/
|
||||
MyGame.Example2.Monster.getRootAsMonster = function(bb, obj) {
|
||||
return (obj || new MyGame.Example2.Monster).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
*/
|
||||
MyGame.Example2.Monster.startMonster = function(builder) {
|
||||
builder.startObject(0);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {flatbuffers.Builder} builder
|
||||
* @returns {flatbuffers.Offset}
|
||||
*/
|
||||
MyGame.Example2.Monster.endMonster = function(builder) {
|
||||
var offset = builder.endObject();
|
||||
return offset;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user