[JS/TS] Size prefix support (#5326)

* WIP size prefix support

* Consider size prefix in overloaded variant

* Work on code gen

* Disabled helper functions in code gen

* Enabled helper functions in code gen

* Fix size prefixed test

* Fix bad function call

* Add SIZE_PREFIX_LENGTH

* Fix review comments
This commit is contained in:
Björn Harrtell
2019-05-16 20:43:31 +02:00
committed by Wouter van Oortmerssen
parent b56d60f058
commit 0bb3ce6935
11 changed files with 370 additions and 61 deletions

View File

@@ -29,6 +29,15 @@ static getRootAsTableInFirstNS(bb:flatbuffers.ByteBuffer, obj?:TableInFirstNS):T
return (obj || new TableInFirstNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};
/**
* @param flatbuffers.ByteBuffer bb
* @param TableInFirstNS= obj
* @returns TableInFirstNS
*/
static getSizePrefixedRootAsTableInFirstNS(bb:flatbuffers.ByteBuffer, obj?:TableInFirstNS):TableInFirstNS {
return (obj || new TableInFirstNS).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};
/**
* @param NamespaceA.NamespaceB.TableInNestedNS= obj
* @returns NamespaceA.NamespaceB.TableInNestedNS|null
@@ -147,6 +156,15 @@ static getRootAsTableInC(bb:flatbuffers.ByteBuffer, obj?:TableInC):TableInC {
return (obj || new TableInC).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};
/**
* @param flatbuffers.ByteBuffer bb
* @param TableInC= obj
* @returns TableInC
*/
static getSizePrefixedRootAsTableInC(bb:flatbuffers.ByteBuffer, obj?:TableInC):TableInC {
return (obj || new TableInC).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};
/**
* @param NamespaceA.TableInFirstNS= obj
* @returns NamespaceA.TableInFirstNS|null
@@ -233,6 +251,15 @@ static getRootAsSecondTableInA(bb:flatbuffers.ByteBuffer, obj?:SecondTableInA):S
return (obj || new SecondTableInA).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};
/**
* @param flatbuffers.ByteBuffer bb
* @param SecondTableInA= obj
* @returns SecondTableInA
*/
static getSizePrefixedRootAsSecondTableInA(bb:flatbuffers.ByteBuffer, obj?:SecondTableInA):SecondTableInA {
return (obj || new SecondTableInA).__init(bb.readInt32(bb.position()) + bb.position(), bb);
};
/**
* @param NamespaceC.TableInC= obj
* @returns NamespaceC.TableInC|null